Skip to content

fix(ego-lint): auto-exclude examples/ directory from pattern rules#158

Open
ZviBaratz wants to merge 5 commits intomainfrom
fix/examples-dir-exclusion
Open

fix(ego-lint): auto-exclude examples/ directory from pattern rules#158
ZviBaratz wants to merge 5 commits intomainfrom
fix/examples-dir-exclusion

Conversation

@ZviBaratz
Copy link
Copy Markdown
Owner

Problem

PaperWM ships an examples/ directory with user-facing documentation written in the legacy imports.* style (pre-GNOME 45). These files are not extension runtime code — they are copy-paste reference snippets for end users — but ego-lint was flagging them with 5 false-positive R-DEPR-04 FAILs:

  • examples/winprops.js
  • examples/layouts.js
  • examples/keybindings.js

Fix

Add 'examples' to the global skip_dirs tuple in apply-patterns.py, alongside 'node_modules', '.git', and '__pycache__'. This is a zero-config solution — no per-rule changes needed — and follows the same approach as the existing node_modules exclusion.

Why skip_dirs vs exclude-dirs

The existing service/ daemon exclusion uses a per-rule exclude-dirs mechanism (requires each rule author to opt in). The skip_dirs global tuple is the right place for directories that are universally non-extension code, of which examples/ is a clear example.

Test Coverage

  • New examples-exclusion@test fixture with examples/winprops.js (legacy imports.* doc file)
  • 4 assertions: R-DEPR-04 produces no FAIL or WARN on the examples file

Affected Extensions

  • PaperWM — primary case: 5 false-positive FAILs eliminated

🤖 Generated with Claude Code

PaperWM field test revealed that extensions may ship an examples/ directory
with user documentation written in the old pre-GNOME 45 imports.* style.
These are not extension runtime code and should not be flagged by R-DEPR-04
or other rules.

Add 'examples' to the global skip_dirs tuple in apply-patterns.py alongside
'node_modules', '.git', and '__pycache__'. This mirrors how service/ daemons
are excluded (though via per-rule exclude-dirs) and provides the most concise
solution for a well-known documentation directory convention.

Fixes false positives on:
- PaperWM: examples/winprops.js, examples/layouts.js, examples/keybindings.js (R-DEPR-04 x5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant