test/lint/lint-locale-dependence.sh
to a Python-script as part of the request of #24783. Checked for output-consistency.
lint: Convert lint-locale-dependence.sh to Python #24932
pull Kvaciral wants to merge 2 commits into bitcoin:master from Kvaciral:lint-locale-dependence-port changing 2 files +259 −241-
Kvaciral commented at 2:05 pm on April 20, 2022: contributorA port of
-
DrahtBot added the label Tests on Apr 20, 2022
-
DrahtBot commented at 2:59 pm on April 20, 2022: member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #24922 (Isolate the storage abstraction layer from the application/serialization layer by TheQuantumPhysicist)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
Kvaciral force-pushed on Apr 20, 2022
-
laanwj commented at 3:18 pm on April 20, 2022: member
No idea if you want to do it here, but FWIW here’s a patch that makes
KNOWN_VIOLATIONS
specific:0diff --git a/test/lint/lint-locale-dependence.py b/test/lint/lint-locale-dependence.py 1index 47f1395dd626468eb8a427ee64897f6abcdf8acb..6c7b5f549f9bd67d40dfdb38df201303b43079b2 100755 2--- a/test/lint/lint-locale-dependence.py 3+++ b/test/lint/lint-locale-dependence.py 4@@ -46,9 +46,10 @@ from subprocess import check_output, CalledProcessError 5 KNOWN_VIOLATIONS = [ 6 "src/dbwrapper.cpp:.*vsnprintf", 7 "src/test/dbwrapper_tests.cpp:.*snprintf", 8- "src/test/fuzz/locale.cpp", 9- "src/test/fuzz/string.cpp", 10- "src/test/util_tests.cpp" 11+ "src/test/fuzz/locale.cpp:.*setlocale", 12+ "src/test/fuzz/string.cpp:.*strtol", 13+ "src/test/fuzz/string.cpp:.*strtoul", 14+ "src/test/util_tests.cpp:.*strtoll" 15 ] 16 17 REGEXP_EXTERNAL_DEPENDENCIES_EXCLUSIONS = [
Edit: and after #24933 we could also enable checking for strerror except for
src/util/strerror.cpp
, but I would guess this gets merged first. -
laanwj commented at 3:20 pm on April 20, 2022: memberTested ACK 0628561af940b8dd08565586af911a1b06576b97 re-ACK d1a7d2af231597c200441f9ffdd277f4888a41e9
-
in test/lint/lint-locale-dependence.py:218 in d1a7d2af23 outdated
213+ "wcwidth", 214+ "wprintf" 215+] 216+ 217+ 218+def git_grep_call(regexp_locale_dependent_functions):
laanwj commented at 4:44 pm on April 21, 2022:This function name is too generic for what it does. Maybefind_locale_dependent_function_uses
? -
lint: Convert lint-locale-dependence.sh to Python 229917d3d4
-
in test/lint/lint-locale-dependence.py:237 in d1a7d2af23 outdated
232+def main(): 233+ exit_code = 0 234+ 235+ regexp_ignore_known_violations = "|".join(KNOWN_VIOLATIONS) 236+ regexp_locale_dependent_functions = "|".join(LOCALE_DEPENDENT_FUNCTIONS) 237+ git_grep_output = git_grep_call(regexp_locale_dependent_functions)
laanwj commented at 4:46 pm on April 21, 2022:I think it’d make sense to pass in the list of locale dependent functions to this function, then build the regexp inside (it’s a implementation detail). -
Kvaciral force-pushed on Apr 21, 2022
-
lint: Make known violations more specific in lint-locale-dependence 3043a1bc9d
-
Kvaciral force-pushed on Apr 21, 2022
-
laanwj commented at 3:53 pm on April 25, 2022: memberTested and code review ACK 3043a1bc9d32b451020b511c8340c12e0d99f8cc
-
laanwj merged this on Apr 25, 2022
-
laanwj closed this on Apr 25, 2022
-
sidhujag referenced this in commit 8b554817a2 on Apr 26, 2022
-
DrahtBot locked this on Apr 25, 2023