Skip to content

Commit

Permalink
Merge pull request #27 from vegaprotocol/add-ignore-glob
Browse files Browse the repository at this point in the history
Add ignore parameter
  • Loading branch information
edd authored Mar 8, 2022
2 parents 6e3da8d + a818de3 commit 79fb9e8
Show file tree
Hide file tree
Showing 25 changed files with 641 additions and 136 deletions.
12 changes: 9 additions & 3 deletions bin/approbation.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,32 @@ if (argv && argv['show-branches']) {

if (command === 'check-filenames') {
let paths = '{./non-protocol-specs/**/*.md,./protocol/**/*.md}'
const ignoreGlob = argv.ignore

if (!argv.specs) {
warn(['No --specs argument provided, defaulting to:', `--specs="${paths}"`, '(This behaviour will be deprecated in 3.0.0)'])
} else {
paths = argv.specs
}

res = checkFilenames(paths)
res = checkFilenames(paths, ignoreGlob)
process.exit(res.exitCode)
} else if (command === 'check-codes') {
let paths = '{./non-protocol-specs/**/*.md,./protocol/**/*.md}'
const ignoreGlob = argv.ignore

if (!argv.specs) {
warn(['No --specs argument provided, defaulting to:', `--specs="${paths}"`, '(This behaviour will be deprecated in 3.0.0)'])
} else {
paths = argv.specs
}

res = checkCodes(paths)
res = checkCodes(paths, ignoreGlob)
process.exit(res.exitCode)
} else if (command === 'check-references') {
let specsGlob = '{./non-protocol-specs/**/*.md,./protocol/**/*.md}'
let testsGlob = '{./qa-scenarios/**/*.{feature,py}}'
const ignoreGlob = argv.ignore

if (!argv.specs) {
warn(['No --specs argument provided, defaulting to:', `--specs="${specsGlob}"`, '(This behaviour will be deprecated in 3.0.0)'])
Expand All @@ -64,7 +67,7 @@ if (command === 'check-filenames') {
testsGlob = argv.tests
}

res = checkReferences(specsGlob, testsGlob)
res = checkReferences(specsGlob, testsGlob, ignoreGlob)

process.exit(res.exitCode)
} else {
Expand All @@ -75,13 +78,15 @@ if (command === 'check-filenames') {
console.log('Looks for possible errors in the coding of acceptance criteria')
console.group('Arguments')
console.log('--specs="{**/*.md}"')
console.log('--ignore="{**/*.md}"')
console.groupEnd('Arguments')
console.groupEnd('check-codes')

console.group('check-filenames')
console.log('Check that spec filenames are valid')
console.group('Arguments')
console.log('--specs="{**/*.md}"')
console.log('--ignore="{**/*.md}"')
console.groupEnd('Arguments')
console.groupEnd('check-filenames')

Expand All @@ -90,6 +95,7 @@ if (command === 'check-filenames') {
console.group('Arguments')
console.log('--specs="{specs/**/*.md}"')
console.log('--tests="tests/**/*.{py,feature}"')
console.log('--ignore="tests/**/*.{py,feature}"')
console.groupEnd('Arguments')
console.groupEnd('check-references')
}
Loading

0 comments on commit 79fb9e8

Please sign in to comment.