fix(ego-lint): auto-exclude examples/ directory from pattern rules#158
Open
fix(ego-lint): auto-exclude examples/ directory from pattern rules#158
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PaperWM ships an
examples/directory with user-facing documentation written in the legacyimports.*style (pre-GNOME 45). These files are not extension runtime code — they are copy-paste reference snippets for end users — butego-lintwas flagging them with 5 false-positive R-DEPR-04 FAILs:examples/winprops.jsexamples/layouts.jsexamples/keybindings.jsFix
Add
'examples'to the globalskip_dirstuple inapply-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 existingnode_modulesexclusion.Why
skip_dirsvsexclude-dirsThe existing
service/daemon exclusion uses a per-ruleexclude-dirsmechanism (requires each rule author to opt in). Theskip_dirsglobal tuple is the right place for directories that are universally non-extension code, of whichexamples/is a clear example.Test Coverage
examples-exclusion@testfixture withexamples/winprops.js(legacyimports.*doc file)R-DEPR-04produces no FAIL or WARN on the examples fileAffected Extensions
🤖 Generated with Claude Code