Skip to content

Commit

Permalink
fix: log schema names correctly, do not log unmatched files
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Nov 12, 2019
1 parent d5e3210 commit 02ccffd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rule/index.ts
Expand Up @@ -132,7 +132,7 @@ export async function loadRulePaths(paths: Array<string>, ctx: VisitorContext):
.filter((name) => name[0] !== '.')
.filter((name) => match.match(name));

ctx.logger.debug({ allFiles, files }, 'path matched files');
ctx.logger.debug({ files }, 'path matched rule files');

const pathRules = await loadRuleFiles(files, ctx);
rules.push(...pathRules);
Expand Down
2 changes: 1 addition & 1 deletion src/visitor/VisitorContext.ts
Expand Up @@ -51,8 +51,8 @@ export class VisitorContext implements VisitorContextOptions, VisitorResult {

public addSchema(name: string, schema: any): void {
this.logger.debug({
name,
schema,
schemaName: name,
}, 'adding ajv schema');

this.ajv.addSchema({
Expand Down
1 change: 0 additions & 1 deletion test/rule/TestLoadRule.ts
Expand Up @@ -96,7 +96,6 @@ describeLeaks('load rule path helper', async () => {
});

itLeaks('should recursively load rule files', async () => {

mockFS({
test: {
'bar-dir': {
Expand Down

0 comments on commit 02ccffd

Please sign in to comment.