Skip to content

Add --select and --ignore CLI flags for rule filtering#3

Open
jmerkow wants to merge 1 commit into
cm2435:mainfrom
jmerkow:cli-rule-filters
Open

Add --select and --ignore CLI flags for rule filtering#3
jmerkow wants to merge 1 commit into
cm2435:mainfrom
jmerkow:cli-rule-filters

Conversation

@jmerkow

@jmerkow jmerkow commented Jul 6, 2026

Copy link
Copy Markdown

Closes #2.

Adds --select and --ignore flags so rules can be toggled from the CLI without a pyproject.toml.

  • --select sets the active rules; --ignore removes from it (ruff/flake8 semantics)
  • CLI flags override [tool.slopcop] config
  • Unknown rule IDs error out before scanning
  • Reuses the existing Config.exclude path, so the engine's rule-filtering logic is unchanged
  • Includes tests and a README note

@cm2435 cm2435 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks for the PR :)

if you want to go further and add some unit test coverage for the flags on the CLI that'd be great. else I'll do it

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.

Allow filters from cli?

2 participants