-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: Make lint-includes.sh work from any directory #16768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
56ab427 to
ed628d6
Compare
|
Changed |
|
Rebooted the test to be sure, and Travis still doesn't like it: In test/lint/lint-includes.sh line 15:
cd "$(dirname $0)/../.." > /dev/null
^-- SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
In test/lint/lint-includes.sh line 114:
cd - > /dev/null
^--------------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
^--------------^ SC2103: Use a ( subshell ) to avoid having to cd back.
For more information:
https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |...
https://www.shellcheck.net/wiki/SC2103 -- Use a ( subshell ) to avoid havin...
^---- failure generated from test/lint/lint-shell.sh |
ed628d6 to
0182555
Compare
|
It wants the check of exist status of |
|
Tested ACK 01825553fd1e10d95c8b1539b8d0245ede39fd74 Nice developer ergonomics fix! @kristapsk, you might want to apply this fix to the other These linters invoke |
|
I'd rather not change all the linter scripts to provide maximum flexibility. This is all code that needs to be reviewed and maintained. And changing one script to be flexible, but keeping the others doesn't really help. So -0 from me. |
|
So, as I understand, @MarcoFalke is against merging this, but @practicalswift things it's good idea to modify other scripts too. What do others think? I will not stand and fight for this too hard, does not seem to be of high importance, just think it's not good that script gives false positive outputs just because it's ran from the wrong directory. |
|
@kristapsk @MarcoFalke Even if the other scripts are left unchanged I think this specific change is worth doing: |
|
Ok, fair enough |
0182555 to
9d518b5
Compare
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 9d518b5f0ffedc79b98dba7aed35637d11e7f736, tested.
9d518b5 to
490da63
Compare
490da63 Make lint-includes.sh work from any directory (Kristaps Kaupe) Pull request description: Before this change it works from root folder of bitcoin git repo, but if you do `cd test/lint; ./test-includes.sh`, you will have a lot of false positive messages like this: ``` Good job! The circular dependency "chainparamsbase -> util/system -> chainparamsbase" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. Good job! The circular dependency "index/txindex -> validation -> index/txindex" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. ``` Top commit has no ACKs. Tree-SHA512: 07fa69cb2883181dcee922191acac4b242722eeb2916cdffdc7163421302b22f3c9525aaf4c754a9dba1c307032c05285e38191d5c6aabc894321f8a27bbceaa
Backport useful lints from upstream Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6892 - bitcoin/bitcoin#11151 - bitcoin/bitcoin#11300 - bitcoin/bitcoin@96d91b7 - bitcoin/bitcoin#12097 - bitcoin/bitcoin#12098 - bitcoin/bitcoin#12442 - bitcoin/bitcoin#12572 - bitcoin/bitcoin#12757 - bitcoin/bitcoin#11878 - bitcoin/bitcoin#12933 - bitcoin/bitcoin#12871 - bitcoin/bitcoin#12972 - bitcoin/bitcoin#13281 - bitcoin/bitcoin#13385 - bitcoin/bitcoin#13041 - bitcoin/bitcoin#13454 - bitcoin/bitcoin#13448 - bitcoin/bitcoin#13510 - bitcoin/bitcoin#13851 - bitcoin/bitcoin#13863 - bitcoin/bitcoin#14115 - bitcoin/bitcoin#14831 - bitcoin/bitcoin#15164 - bitcoin/bitcoin#15170 - bitcoin/bitcoin#15166 - bitcoin/bitcoin#16036 - bitcoin/bitcoin#16768 Several of the lints fail for our current codebase; these will be addressed in a subsequent PR.
Backport useful lints from upstream Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6892 - bitcoin/bitcoin#11151 - bitcoin/bitcoin#11300 - bitcoin/bitcoin@96d91b7 - bitcoin/bitcoin#12097 - bitcoin/bitcoin#12098 - bitcoin/bitcoin#12442 - bitcoin/bitcoin#12572 - bitcoin/bitcoin#12757 - bitcoin/bitcoin#11878 - bitcoin/bitcoin#12933 - bitcoin/bitcoin#12871 - bitcoin/bitcoin#12972 - bitcoin/bitcoin#13281 - bitcoin/bitcoin#13385 - bitcoin/bitcoin#13041 - bitcoin/bitcoin#13454 - bitcoin/bitcoin#13448 - bitcoin/bitcoin#13510 - bitcoin/bitcoin#13851 - bitcoin/bitcoin#13863 - bitcoin/bitcoin#14115 - bitcoin/bitcoin#14831 - bitcoin/bitcoin#15164 - bitcoin/bitcoin#15170 - bitcoin/bitcoin#15166 - bitcoin/bitcoin#16036 - bitcoin/bitcoin#16768 - bitcoin/bitcoin#13494 Several of the lints fail for our current codebase; these will be addressed in a subsequent PR.
490da63 Make lint-includes.sh work from any directory (Kristaps Kaupe) Pull request description: Before this change it works from root folder of bitcoin git repo, but if you do `cd test/lint; ./test-includes.sh`, you will have a lot of false positive messages like this: ``` Good job! The circular dependency "chainparamsbase -> util/system -> chainparamsbase" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. Good job! The circular dependency "index/txindex -> validation -> index/txindex" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. ``` Top commit has no ACKs. Tree-SHA512: 07fa69cb2883181dcee922191acac4b242722eeb2916cdffdc7163421302b22f3c9525aaf4c754a9dba1c307032c05285e38191d5c6aabc894321f8a27bbceaa
490da63 Make lint-includes.sh work from any directory (Kristaps Kaupe) Pull request description: Before this change it works from root folder of bitcoin git repo, but if you do `cd test/lint; ./test-includes.sh`, you will have a lot of false positive messages like this: ``` Good job! The circular dependency "chainparamsbase -> util/system -> chainparamsbase" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. Good job! The circular dependency "index/txindex -> validation -> index/txindex" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. ``` Top commit has no ACKs. Tree-SHA512: 07fa69cb2883181dcee922191acac4b242722eeb2916cdffdc7163421302b22f3c9525aaf4c754a9dba1c307032c05285e38191d5c6aabc894321f8a27bbceaa
Before this change it works from root folder of bitcoin git repo, but if you do
cd test/lint; ./test-includes.sh, you will have a lot of false positive messages like this: