Skip to content

Commit

Permalink
Hide errors for ignored files with default globs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 25, 2018
1 parent 7ae54e2 commit bf11df5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
3 changes: 3 additions & 0 deletions cli.js
Expand Up @@ -76,6 +76,7 @@ var cli = meow(

/* Set-up. */
var defaultGlobs = ['{docs/**/,doc/**/,}*.{' + extensions.join(',') + '}']
var silentlyIgnore
var globs

if (cli.flags.stdin) {
Expand All @@ -84,6 +85,7 @@ if (cli.flags.stdin) {
}
} else if (cli.input.length === 0) {
globs = defaultGlobs
silentlyIgnore = true
} else {
globs = cli.input
}
Expand All @@ -100,6 +102,7 @@ engine(
rcName: '.alexrc',
packageField: 'alex',
ignoreName: '.alexignore',
silentlyIgnore: silentlyIgnore,
frail: true,
defaultConfig: transform()
},
Expand Down
15 changes: 3 additions & 12 deletions test/cli.js
Expand Up @@ -136,21 +136,12 @@ test('non-binary (optional)', function(t) {
})

test('default globs', function(t) {
return execa.stderr('./cli.js').catch(function(err) {
return execa.stderr('./cli.js').then(function(stderr) {
var expected = [
'code-of-conduct.md',
' 1:1 error Cannot process specified file: it’s ignored',
'',
'contributing.md: no issues found',
'example.md',
' 1:1 error Cannot process specified file: it’s ignored',
'',
'readme.md: no issues found',
'',
'✖ 2 errors',
''
'readme.md: no issues found'
].join('\n')

t.is(err.stderr, expected)
t.is(stderr, expected)
})
})

0 comments on commit bf11df5

Please sign in to comment.