Skip to content

tools/verifygitlog.py: Fix --pretty filter to inspect each arg.#19274

Open
finnmglas wants to merge 1 commit into
micropython:masterfrom
finnmglas:finn/fix-verifygitlog-pretty-filter
Open

tools/verifygitlog.py: Fix --pretty filter to inspect each arg.#19274
finnmglas wants to merge 1 commit into
micropython:masterfrom
finnmglas:finn/fix-verifygitlog-pretty-filter

Conversation

@finnmglas
Copy link
Copy Markdown

Summary

Small fix:

The list comprehension in git_log() was meant to strip a user-supplied --pretty argument before appending the scripts own --pretty=format:, but the test checked the wrong variable:

args = ["git", "log"] + [arg for arg in args if "--pretty" not in args]
                                                                  ^here

The check "--pretty" not in args looks for an exact "--pretty" element in the entire arg list rather than testing the current arg for --pretty as a substring, so the filter never strips anything.

Testing

Tested locally:

  • python3 tools/verifygitlog.py -n5 still passes on master.
  • python3 tools/verifygitlog.py -v -n3 --pretty=format:%h now drops
    the user-supplied --pretty before the script appends its own.
  • ruff check tools/verifygitlog.py and ruff format --check tools/verifygitlog.py both pass.

Generative AI

I did not use generative AI tools when creating this PR.
(This fix is very minor so didn't need it. Generally use it tho.)

The list comprehension checked "--pretty" not in args (the entire
argument list) instead of "--pretty" not in arg (the current element),
so the filter could not actually strip a user-supplied --pretty
argument from the call to git log.

Signed-off-by: Finn Glas <finn@finnmglas.com>
@github-actions
Copy link
Copy Markdown

Code size report:

Reference:  esp32: Make a generic sdkconfig.flash_qio_80m config snippet. [4fd7295]
Comparison: tools/verifygitlog.py: Fix --pretty filter to inspect each arg. [merge of 5e2c260]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (8c57717) to head (5e2c260).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19274   +/-   ##
=======================================
  Coverage   98.47%   98.47%           
=======================================
  Files         176      176           
  Lines       22845    22845           
=======================================
  Hits        22497    22497           
  Misses        348      348           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@agatti agatti added the tools Relates to tools/ directory in source, or other tooling label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Relates to tools/ directory in source, or other tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants