Skip to content

Conversation

Kvaciral
Copy link
Contributor

A port of test/lint/lint-locale-dependence.sh to a Python-script as part of the request of #24783. Checked for output-consistency.

@DrahtBot DrahtBot added the Tests label Apr 20, 2022
@DrahtBot
Copy link
Contributor

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 Kvaciral force-pushed the lint-locale-dependence-port branch from afa11c6 to 0628561 Compare April 20, 2022 15:00
@laanwj
Copy link
Member

laanwj commented Apr 20, 2022

No idea if you want to do it here, but FWIW here's a patch that makes KNOWN_VIOLATIONS specific:

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 src/util/strerror.cpp, but I would guess this gets merged first.

@laanwj
Copy link
Member

laanwj commented Apr 20, 2022

Tested ACK 0628561
re-ACK d1a7d2a

]


def git_grep_call(regexp_locale_dependent_functions):
Copy link
Member

@laanwj laanwj Apr 21, 2022

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?


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)
Copy link
Member

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).

@Kvaciral Kvaciral force-pushed the lint-locale-dependence-port branch from d1a7d2a to 6dc01c6 Compare April 21, 2022 17:35
@Kvaciral Kvaciral force-pushed the lint-locale-dependence-port branch from 6dc01c6 to 3043a1b Compare April 21, 2022 18:10
@laanwj
Copy link
Member

laanwj commented Apr 25, 2022

Tested and code review ACK 3043a1b

@laanwj laanwj merged commit 7134327 into bitcoin:master Apr 25, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 26, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants