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 # Parts of the tree that are expected to be print free
declare print_free_tree=( declare print_free_tree=(
'core/src' ':core/src/**.rs'
'faucet/src' ':faucet/src/**.rs'
'ledger/src' ':ledger/src/**.rs'
'metrics/src' ':metrics/src/**.rs'
'net-utils/src' ':net-utils/src/**.rs'
'runtime/src' ':runtime/src/**.rs'
'sdk/bpf/rust/rust-utils' ':sdk/bpf/rust/rust-utils/**.rs'
'sdk/src' ':sdk/**.rs'
'programs/bpf/rust' ':programs/**.rs'
'programs/stake/src' ':^**bin**.rs'
'programs/vote/src' ':^**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 exit 1
fi fi