mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 14:36:25 +00:00
docs(config): Don't show [template] for long strings (#16224)
This commit is contained in:
parent
db4160a205
commit
7ac91e452c
3 changed files with 4 additions and 8 deletions
|
@ -160,13 +160,14 @@ describe('logger/index', () => {
|
|||
constructor(public field: string) {}
|
||||
}
|
||||
|
||||
const prBody = 'test';
|
||||
logger.error({
|
||||
foo: 'secret"password',
|
||||
bar: ['somethingelse', 'secret"password'],
|
||||
npmToken: 'token',
|
||||
buffer: Buffer.from('test'),
|
||||
content: 'test',
|
||||
prBody: 'test',
|
||||
prBody,
|
||||
secrets: {
|
||||
foo: 'barsecret',
|
||||
},
|
||||
|
@ -181,7 +182,7 @@ describe('logger/index', () => {
|
|||
expect(logged.npmToken).not.toBe('token');
|
||||
expect(logged.buffer).toBe('[content]');
|
||||
expect(logged.content).toBe('[content]');
|
||||
expect(logged.prBody).toBe('[Template]');
|
||||
expect(logged.prBody).toBe(prBody);
|
||||
expect(logged.secrets.foo).toBe('***********');
|
||||
expect(logged.someFn).toBe('[function]');
|
||||
expect(logged.someObject.field).toBe('**redacted**');
|
||||
|
|
|
@ -39,7 +39,7 @@ export class ProblemStream extends Stream {
|
|||
this._problems = [];
|
||||
}
|
||||
}
|
||||
const templateFields = ['prBody'];
|
||||
|
||||
const contentFields = [
|
||||
'content',
|
||||
'contents',
|
||||
|
@ -148,8 +148,6 @@ export function sanitizeValue(
|
|||
curValue = '***********';
|
||||
} else if (contentFields.includes(key)) {
|
||||
curValue = '[content]';
|
||||
} else if (templateFields.includes(key)) {
|
||||
curValue = '[Template]';
|
||||
} else if (key === 'secrets') {
|
||||
curValue = {};
|
||||
Object.keys(val).forEach((secretKey) => {
|
||||
|
|
|
@ -116,9 +116,6 @@ function genTable(obj: [string, string][], type: string, def: any): string {
|
|||
) {
|
||||
el[1] = `<code>${el[1]}</code>`;
|
||||
}
|
||||
if (type === 'string' && el[0] === 'default' && el[1].length > 200) {
|
||||
el[1] = `[template]`;
|
||||
}
|
||||
// objects and arrays should be printed in JSON notation
|
||||
if ((type === 'object' || type === 'array') && el[0] === 'default') {
|
||||
// only show array and object defaults if they are not null and are not empty
|
||||
|
|
Loading…
Reference in a new issue