Skip to content

feat: comprehensive improvements across CLI, security, providers, and core#29

Merged
mara-werils merged 26 commits into
mainfrom
feat/comprehensive-improvements
May 17, 2026
Merged

feat: comprehensive improvements across CLI, security, providers, and core#29
mara-werils merged 26 commits into
mainfrom
feat/comprehensive-improvements

Conversation

@mara-werils
Copy link
Copy Markdown
Owner

Summary

  • 25 commits improving CLI UX, SAST security scanner, LLM provider coverage, config validation, review engine integration, and i18n support
  • Touches 42 files across src/, tests/, adding ~1,029 lines and removing ~492 lines
  • No breaking changes — all improvements are additive and backward-compatible

Key Changes

CLI Enhancements

  • --version, --verbose, --config, --summary-only, --exit-code flags
  • --provider now validates via argparse choices (includes google)

Security Scanner (SAST)

  • 7 new rules: NoSQL injection, SSTI, LDAP injection, unsafe Rust, PHP code/file injection
  • Expanded test file & language detection patterns
  • SAST scanner now integrated directly into review engine output

Provider Updates

  • Updated pricing tables for Google (Gemini 2.5), Groq (Llama 4), Anthropic (Claude 4.6), OpenAI (o3/o4-mini)
  • Early warning when API key is missing

Config & Core

  • __version__ synced to 0.5.0 + PEP 561 py.typed marker
  • Provider name validation with fallback
  • Bitbucket credentials in ReviewConfig
  • Default ignore paths expanded (env files, keys, binaries, fonts, images)
  • Configurable retry settings (max_retries, retry_base_delay)
  • Cost limit enforcement with automatic diff truncation

Review Quality

  • i18n language injection wired into review engine
  • File concentration metric in complexity scoring
  • Complexity + security summary sections in formatter
  • Review duration in notifications
  • 6 new i18n languages (21 total)

Test plan

  • Verify pr-reviewer --version outputs 0.5.0
  • Verify pr-reviewer review --provider invalid shows validation error
  • Verify security scanner detects new rule patterns (NoSQL, SSTI, LDAP, PHP)
  • Verify --exit-code returns 1 when critical issues are found
  • Verify --summary-only generates summary without inline comments
  • Run existing test suite (pytest tests/ -v)

The package __init__.py still had version 0.1.0 while pyproject.toml
was at 0.5.0. Also adds PEP 561 py.typed marker so downstream users
get proper type-checking support.
Users can now run `pr-reviewer --version` to check the installed version.
--config allows specifying a custom .pr-reviewer.yml path instead of
relying on auto-detection. --verbose/-v enables debug-level logging
for troubleshooting.
Unknown provider names now produce a clear warning and fall back to
openai instead of silently breaking at provider creation time.
Expands SAST scanner coverage with:
- SEC130: NoSQL injection (MongoDB operator injection)
- SEC131: Server-Side Template Injection (SSTI)
- SEC132: LDAP injection via string formatting
- SEC140: Unsafe Rust blocks requiring extra review
- SEC150: PHP eval/assert code injection
- SEC151: PHP dynamic file inclusion (LFI/RFI)
Adds Hindi, Vietnamese, Thai, Ukrainian, Czech, and Swedish to the
supported review languages, covering more developer communities.
Allows generating just a PR summary without running the full review
with inline comments — useful for quick PR descriptions.
Adds pricing for Gemini 2.0 Flash Lite, Gemini 2.5 Flash/Pro stable,
and Groq Llama 4 Scout/Maverick models.
Adds pricing entries for the latest Claude 4.6 model variants so
cost tracking works correctly with newer model IDs.
The factory now checks for missing API keys before creating the
provider and logs a clear warning with the expected env var name.
Adds a "concentration" component (0-10 pts) that flags PRs where a
single file has very large changes, suggesting it should be split.
Bitbucket username and app password are now loaded from env vars
(BITBUCKET_USERNAME, BITBUCKET_APP_PASSWORD) in from_env(), matching
the pattern used for GitHub and GitLab tokens.
Adds .pyi, .mjs, .cjs, .kts, .cc, .cxx, .hpp, .zsh, .lua, .r,
.scala, .ex, .exs, .dart, .zig, .vue, .svelte for more accurate
diff statistics and file summaries.
Notification messages now show how long the review took, giving
teams visibility into review performance.
Adds .env files, private keys (.pem, .key, .cert), binary files
(.wasm), and static assets (images, fonts) to the default ignore
list to avoid reviewing non-code files.
The --provider flag now lists all 5 supported providers and uses
argparse choices for early validation instead of free text.
Expands the PR category taxonomy so LLM-assigned categories like
'style', 'perf', 'ci', and 'deps' render with proper labels.
The review engine now uses the i18n module to inject language
instructions into the system prompt when review_language is not
English, enabling reviews in the configured language.
Security scan results are now automatically appended to review
comments when check_security is enabled, adding zero-cost regex-based
vulnerability detection alongside the LLM review.
format_review_body() now accepts optional complexity_section and
security_summary parameters, allowing callers to embed SAST and
complexity results directly in the review comment.
The engine now estimates review cost before calling the LLM and
truncates the diff if the estimate exceeds the configured
cost_limit_usd, preventing surprise bills.
Retry behavior can now be tuned via config or YAML instead of being
hardcoded in each provider, useful for rate-limited environments.
Adds testing/, fixtures/, mocks/, testdata/, and test-data/ to the
test file patterns so security rules with exclude_test_files=True
correctly skip these directories.
Adds pricing entries for the latest OpenAI reasoning models
so cost tracking works correctly when using these models.
When --exit-code is passed, the CLI exits with code 1 if any critical
severity issues are found, enabling CI pipelines to fail on serious
code quality problems.
Adds .mjs, .cjs, .zsh, .dockerfile, .tf, .hcl extensions and
Dockerfile basename detection for more accurate rule matching.
@github-actions
Copy link
Copy Markdown

AI Code Review

Review failed: AuthenticationError: Error code: 401 - {'error': {'message': 'Invalid API Key', 'type': 'invalid_request_error', 'code': 'expired_api_key'}}

Check the Action logs for details.

@mara-werils mara-werils merged commit d3202f5 into main May 17, 2026
2 of 6 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.

1 participant