Skip to content

fix(cli): wire --rules/--rules-include/--rules-exclude/--ruleset into github and gitlab cmds#220

Merged
michaelweber merged 1 commit intopraetorian-inc:mainfrom
n0kovo:feature/gh-gl-rules-args
May 5, 2026
Merged

fix(cli): wire --rules/--rules-include/--rules-exclude/--ruleset into github and gitlab cmds#220
michaelweber merged 1 commit intopraetorian-inc:mainfrom
n0kovo:feature/gh-gl-rules-args

Conversation

@n0kovo
Copy link
Copy Markdown
Contributor

@n0kovo n0kovo commented May 5, 2026

These flags were only registered on titus scan, so titus github and titus gitlab always loaded builtins with the default ruleset and ignored custom rules. This binds the existing scan globals to both cmds (and their scan subcmds) and passes them through to loadRules so custom rules merge with builtins as documented.

complements #218: that PR fixes how --rules parses input; this one exposes the flag on github/gitlab cmds.

These args were only registered on `titus scan`, so `titus github` and `titus gitlab` always loaded builtins with the default ruleset and ignored custom rules. This binds the existing scan globals to both cmds (and their `scan` subcmds) and passes them through to loadRules so custom rules merge with builtins as documented.
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Hey @n0kovo, thanks for taking the time to submit this PR! Our team has been notified and someone will be picking this up shortly.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 343fdbf6-e452-4f81-80a9-2f7a4311138b

📥 Commits

Reviewing files that changed from the base of the PR and between d487992 and d4eb876.

📒 Files selected for processing (2)
  • cmd/titus/github.go
  • cmd/titus/gitlab.go

Walkthrough

The change adds configurable rule loading to GitHub and GitLab scanning commands. Four new CLI flags (--rules, --rules-include, --rules-exclude, --ruleset) are registered on both the scan subcommands and top-level commands in each file. The scan functions are updated to pass these flag values to the rule loading function instead of empty strings, enabling custom rule paths and filtering during scans.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator

@michaelweber michaelweber left a comment

Choose a reason for hiding this comment

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

Good catch. I feel we're probably using the flags wrong if we need to do this for every command, but I'll leave that for a future refactor. Let's remove the pain point right away. Thanks for the PR!

@michaelweber michaelweber merged commit 57f8a4d into praetorian-inc:main May 5, 2026
18 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Hey @n0kovo, this should now be resolved. If everything looks good on your end, no action needed. If you're still seeing issues, feel free to reopen and we'll take another look. Thanks for helping us improve!

michaelweber added a commit that referenced this pull request May 5, 2026
The flag was registered on githubScanCmd and gitlabScanCmd but missing
from the legacy root invocation path (githubCmd / gitlabCmd), which
already had the four --rules* flags from #220. Adds flag parity.
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.

2 participants