Broaden pattern in nits.sh to be less fragile (#8090)

* Broaden pattern in nits.sh to be less fragile

* Even more general matching
This commit is contained in:
Ryo Onodera 2020-02-04 08:53:01 +09:00 committed by GitHub
parent c835749563
commit 0d7e093415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -18,20 +18,22 @@ declare prints=(
# Parts of the tree that are expected to be print free
declare print_free_tree=(
'core/src'
'faucet/src'
'ledger/src'
'metrics/src'
'net-utils/src'
'runtime/src'
'sdk/bpf/rust/rust-utils'
'sdk/src'
'programs/bpf/rust'
'programs/stake/src'
'programs/vote/src'
':core/src/**.rs'
':faucet/src/**.rs'
':ledger/src/**.rs'
':metrics/src/**.rs'
':net-utils/src/**.rs'
':runtime/src/**.rs'
':sdk/bpf/rust/rust-utils/**.rs'
':sdk/**.rs'
':programs/**.rs'
':^**bin**.rs'
':^**bench**.rs'
':^**test**.rs'
':^**/build.rs'
)
if _ git --no-pager grep -n --max-depth=0 "${prints[@]/#/-e }" -- "${print_free_tree[@]}"; then
if _ git --no-pager grep -n "${prints[@]/#/-e}" -- "${print_free_tree[@]}"; then
exit 1
fi