Skip to content

Support --use-gitignore via optional flags(AST-179472) - #1575

Merged
cx-sumit-morchhale merged 3 commits into
mainfrom
feature/AST-179472-gitignore-optionalFlag
Sep 22, 2026
Merged

cx-sumit-morchhale merged 3 commits into
mainfrom
feature/AST-179472-gitignore-optionalFlag

Conversation

@cx-sumit-morchhale

Copy link
Copy Markdown
Contributor

Summary

Support passing --use-gitignore flag through --optional-flags mechanism, enabling IDE/CI-CD plugins to pass gitignore configuration.

Changes

  • Added use-gitignore to allowedOptionalKeys in utils.go to whitelist the flag as a valid optional parameter
  • Modified scan.go to check both command-line flag and optional-flags, with command-line taking priority

How It Works

Users can now pass gitignore filtering in multiple ways:

  1. Command-line flag (existing):

    cx scan --use-gitignore --project-name my-project
  2. Optional-flags (new):

    cx scan --optional-flags use-gitignore=true --project-name my-project

Feature Priority

  1. Command-line flag takes priority
  2. Falls back to optional-flags if flag not set
  3. Defaults to false if neither is set

Testing

  • Supports both --optional-flags use-gitignore=true and --optional-flags=use-gitignore=true syntaxes
  • Only true value is recognized as true (simple approach)
  • Other values like 1, false, 0 are treated as false

Backward Compatibility

✅ Fully backward compatible - existing command-line usage unchanged

🤖 Generated with Claude Code

@cx-sumit-morchhale
cx-sumit-morchhale requested a review from a team September 18, 2026 10:19
@cx-sumit-morchhale cx-sumit-morchhale changed the title feat: Support --use-gitignore via optional flags Support --use-gitignore via optional flags(AST-179472) Sep 18, 2026
cx-rahul-pidde
cx-rahul-pidde previously approved these changes Sep 21, 2026
cx-rakesh-kadu
cx-rakesh-kadu previously approved these changes Sep 21, 2026
@cx-sumit-morchhale
cx-sumit-morchhale merged commit 00d6c2b into main Sep 22, 2026
25 of 30 checks passed
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.

6 participants