lint: convert format strings linter test to python#24802
lint: convert format strings linter test to python#24802laanwj merged 1 commit intobitcoin:masterfrom
Conversation
396ed2c to
c4f7833
Compare
c4f7833 to
08de596
Compare
I think calling out to
I don't know the original motivation, the only thing I can think of is that printing errors in with the files in a deterministic sorted order is somewhat-user-friendly. But I don't think it's a big deal. |
ed2ade4 to
879c836
Compare
test/lint/lint-format-strings.py
Outdated
There was a problem hiding this comment.
| #!/usr/bin/env python3 | |
| # | |
| # Copyright (c) 2018-2020 The Bitcoin Core developers | |
| # Distributed under the MIT software license, see the accompanying | |
| # file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
| # | |
| """ | |
| Lint format strings: This program checks that the number of arguments passed | |
| to a variadic format string function matches the number of format specifiers | |
| in the format string. | |
| """ | |
| #!/usr/bin/env python3 | |
| """ | |
| Lint format strings: This program checks that the number of arguments passed | |
| to a variadic format string function matches the number of format specifiers | |
| in the format string. | |
| Copyright (c) 2018-2020 The Bitcoin Core developers | |
| Distributed under the MIT software license, see the accompanying | |
| file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
| """ |
There was a problem hiding this comment.
Previously ported python scripts have the copyright comment in the way, existing version of this PR has it. Changing it to the suggested way might make it appear inconsistent with other lint files. Do you still suggest changing ?
|
From reading the code it looks like all output and stderr are muted. If yes, why? If no, please provide example stdout/stderr of the test before and after this change. |
879c836 to
267684e
Compare
|
@MarcoFalke Thanks for highlighting that! That led me to update this PR so output matches with the older version. The reason why before version has 3 lines printed and not 2 is due to the issue highlighed in point (3) in the additional notes of PR header section. IMO the new version is the intended behavior. |
|
Code review ACK 267684e |
|
|
||
| def check_doctest(): | ||
| command = [ | ||
| 'python3', |
There was a problem hiding this comment.
wouldn't it be better to use sys.executable?


Refs #24783
Attempted to keep the style and flow of implementation as it is.
Additional Notes(Optional):
git grepwithsubprocessis still used as I found it to be the simplest. Any pointers on this are appreciated.function_namesiterated so far. Fixed that in this PR.