-
Notifications
You must be signed in to change notification settings - Fork 37.7k
lint: Convert lint-locale-dependence.sh to Python #24932
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
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
afa11c6
to
0628561
Compare
No idea if you want to do it here, but FWIW here's a patch that makes diff --git a/test/lint/lint-locale-dependence.py b/test/lint/lint-locale-dependence.py
index 47f1395dd626468eb8a427ee64897f6abcdf8acb..6c7b5f549f9bd67d40dfdb38df201303b43079b2 100755
--- a/test/lint/lint-locale-dependence.py
+++ b/test/lint/lint-locale-dependence.py
@@ -46,9 +46,10 @@ from subprocess import check_output, CalledProcessError
KNOWN_VIOLATIONS = [
"src/dbwrapper.cpp:.*vsnprintf",
"src/test/dbwrapper_tests.cpp:.*snprintf",
- "src/test/fuzz/locale.cpp",
- "src/test/fuzz/string.cpp",
- "src/test/util_tests.cpp"
+ "src/test/fuzz/locale.cpp:.*setlocale",
+ "src/test/fuzz/string.cpp:.*strtol",
+ "src/test/fuzz/string.cpp:.*strtoul",
+ "src/test/util_tests.cpp:.*strtoll"
]
REGEXP_EXTERNAL_DEPENDENCIES_EXCLUSIONS = [ Edit: and after #24933 we could also enable checking for strerror except for |
test/lint/lint-locale-dependence.py
Outdated
] | ||
|
||
|
||
def git_grep_call(regexp_locale_dependent_functions): |
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.
This function name is too generic for what it does. Maybe find_locale_dependent_function_uses
?
test/lint/lint-locale-dependence.py
Outdated
|
||
regexp_ignore_known_violations = "|".join(KNOWN_VIOLATIONS) | ||
regexp_locale_dependent_functions = "|".join(LOCALE_DEPENDENT_FUNCTIONS) | ||
git_grep_output = git_grep_call(regexp_locale_dependent_functions) |
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.
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).
d1a7d2a
to
6dc01c6
Compare
6dc01c6
to
3043a1b
Compare
Tested and code review ACK 3043a1b |
A port of
test/lint/lint-locale-dependence.sh
to a Python-script as part of the request of #24783. Checked for output-consistency.