pylint: Adjust how the output is produced
PATCH 1/1 pylint: Adjust how the output is produced
The current Makefile rule requires there to be a 'Module' line in the pylint output, like this:
************* Module binman.fip_util
This line only appears if pylint has some comments about the module. We cannot rely on it for naming.
Update the code to instead use the filename as the identifier for each score, so rather than:
multiplexed_log 7.49
we output:
test_multiplexed_log.py 7.20
It is still easy to see which file the score relates to. In fact the new naming is nicer since the full subdirectories are shown.
The avoids the problem where a module name is not produced, and the output gets out of sync.
Regenerate pylint.base so we can start from the current baseline.
---
Makefile | 7 +- scripts/pylint.base | 441 +++++++++++++++++++++++--------------------- 2 files changed, 230 insertions(+), 218 deletions(-)
Makefile +4 -3
@@ -2269,9 +2269,10 @@ pylint: $(Q)find tools test -name "*.py" \ | xargs -n1 -P$(shell nproc 2>/dev/null || echo 1) \ sh -c 'pylint --reports=y --exit-zero -f parseable --ignore-imports=yes $$@ > pylint.out/$$(echo $$@ | tr / _ | sed s/.py//)' _ - $(Q)sed -n 's/Your code has been rated at \([-0-9.]*\).*/\1/p; s/\*\** Module \(.*\)/\1/p' pylint.out/* \ - |sed '$!N;s/\n/ /' \ - |sort > $(PYLINT_CUR) + $(Q)rm -f $(PYLINT_CUR) + $(Q)( cd pylint.out; for f in *; do \ + sed -ne "s/Your code has been rated at \([-0-9.]*\).*/$$f \1/p" $$f; \ + done ) | sort > $(PYLINT_CUR) $(Q)base=$$(mktemp) cur=$$(mktemp); cut -d' ' -f1 $(PYLINT_BASE) >$$base; \ cut -d' ' -f1 $(PYLINT_CUR) >$$cur; \ comm -3 $$base $$cur > $(PYLINT_DIFF); \
scripts/pylint.base +226 -215
441 lines not on this page · raw message
Signature · 1 line
2.35.0.rc2.247.g8bbb082509-goog
Quoted 20 lines · Simon Glass
The current
Makefilerule requires there to be a 'Module' line in the pylint output, like this:************* Module binman.fip_utilThis line only appears if pylint has some comments about the module. We cannot rely on it for naming.
Update the code to instead use the filename as the identifier for each score, so rather than:
multiplexed_log7.49we output:
test_multiplexed_log.py7.20It is still easy to see which file the score relates to. In fact the new naming is nicer since the full subdirectories are shown.
Quoted 6 lines
The avoids the problem where a module name is not produced, and the output gets out of sync.
Regenerate pylint.base so we can start from the current baseline.
Signed-off-by Simon Glass <[email protected]>
That does make it easier to see where a score comes from, thanks. I'll apply this soon if there's no further comments.
Signature · 1 line
Tom
Quoted 20 lines · Simon Glass
The current
Makefilerule requires there to be a 'Module' line in the pylint output, like this:************* Module binman.fip_utilThis line only appears if pylint has some comments about the module. We cannot rely on it for naming.
Update the code to instead use the filename as the identifier for each score, so rather than:
multiplexed_log7.49we output:
test_multiplexed_log.py7.20It is still easy to see which file the score relates to. In fact the new naming is nicer since the full subdirectories are shown.
Quoted 6 lines
The avoids the problem where a module name is not produced, and the output gets out of sync.
Regenerate pylint.base so we can start from the current baseline.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom