Skip to content

Flake8 inline suppression — zero issues on QGIS Plugin Store scanner#102

Open
andures wants to merge 1 commit into
FLYGHT7:mainfrom
andures:fix/flake8-inline-noqa
Open

Flake8 inline suppression — zero issues on QGIS Plugin Store scanner#102
andures wants to merge 1 commit into
FLYGHT7:mainfrom
andures:fix/flake8-inline-noqa

Conversation

@andures

@andures andures commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

fix: Flake8 inline suppression — zero issues on QGIS Plugin Store scanner

Summary

The QGIS Plugin Repository scanner was reporting 986 Flake8 issues after PR #98, even though flake8 qols/ returned 0 locally.

Root cause: the store unpacks the plugin ZIP and runs flake8 <plugin_dir>/ in isolation. setup.cfg lives at the repo root and is never included in the plugin ZIP, so the store never reads per-file-ignores.

This PR moves all suppressions into the source files:

  • # flake8: noqa (file-level) on the 7 exec()-dispatched scripts.
  • # noqa: <CODE> (line-level) on specific lines in generate_icons.py and qols_dockwidget.py.
  • W293 blank-line whitespace fixed directly in qols_dockwidget.py.
  • per-file-ignores removed from setup.cfg (now redundant; max-line-length = 119 and exclude retained for local use).

Result: 0 issues both locally and in the store scanner. 432 tests pass unchanged.


Changes

qols/scripts/*.py (7 files)

Added # flake8: noqa immediately after the closing ''' of each module docstring:

'''
Take Off Climb Surface - HYBRID VERSION
...
'''
# flake8: noqa  # exec()-dispatched script; star imports intentional (see TD-03)
myglobals = set(globals().keys())

Eliminates 731 issues (F403/F405 star imports, F541, E231 math spacing, E402, E722, F841, W291). Safe because these files are static bundled assets run via exec() — not importable modules. TD-03 will convert them to proper modules, at which point # flake8: noqa is removed.

Files changed: approach-surface-UTM.py, take-off-surface_UTM.py, conical.py, inner-horizontal-racetrack.py, outer-horizontal.py, OFZ_UTM.py, TransitionalSurface_UTM.py.


qols/assets/generate_icons.py

Added # noqa: E128 to 5 continuation lines (19, 31, 45, 52, 72). The draw-call argument lists use visual alignment that PEP 8 flags as under-indented but is intentional for readability:

# Before — E128 flagged
draw.rectangle([1, runway_y, size-1, runway_y + runway_height],
              fill=(74, 85, 104, 255), outline=(45, 55, 72, 255))

# After
draw.rectangle([1, runway_y, size-1, runway_y + runway_height],
              fill=(74, 85, 104, 255), outline=(45, 55, 72, 255))  # noqa: E128

qols/qols_dockwidget.py

W293 — fixed directly (5 lines: 882, 1064, 1069, 1079, 1084): removed invisible trailing spaces from blank lines inside the CSS multi-line string.

E128/E129 — # noqa (3 lines: 849, 931, 1320): two list-comprehension continuations and one if condition use a style consistent with surrounding legacy code.

E501 — # noqa: E501 (52 lines): all are debug print() statements and long string literals that will be removed or converted to logger calls in TD-02. Tagged individually rather than file-wide to preserve future E722/F401 detection.

print(f"QOLS DEBUG: ...")  # noqa: E501

setup.cfg

Removed the three per-file-ignores blocks (scripts, qols_dockwidget.py, generate_icons.py). They were only effective locally and are now replaced by inline suppressions:

# Before
per-file-ignores =
    qols/scripts/*.py: F401,F403,F405,E111,...
    qols/qols_dockwidget.py: E128,E129,E501,W293
    qols/assets/generate_icons.py: E128

# After — section removed entirely

Commits

Hash Message
5162e67 Refactor code to suppress flake8 warnings for intentional style choices and improve readability

@andures andures requested a review from antoniolocandro June 16, 2026 20:10
@andures andures self-assigned this Jun 16, 2026
@andures andures added the bug Something isn't working label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant