Skip to content

Conversation

@KJhellico
Copy link
Collaborator

@KJhellico KJhellico commented May 16, 2025

Proposed change

Update pre-commit config:

  • replace bandit hook with flake8-bandit
  • remove excessive mypy additional dependencies

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 16, 2025

Summary by CodeRabbit

  • Chores
    • Updated pre-commit configuration, including renaming and removal of certain hooks and dependencies.
    • Modified linter and security scanner settings for improved consistency and maintenance.
  • Style
    • Removed specific type annotations and comments in the Malaysia holidays module for cleaner code.

Summary by CodeRabbit

  • Chores
    • Updated pre-commit configuration, including renaming a linting hook and removing the Bandit security scanner.
    • Adjusted project settings to remove Bandit configuration and update linting rules for better control over security checks in test files.
    • Cleaned up type annotations and comments in the Malaysia holiday country module.

Walkthrough

The updates remove Bandit security scanning from both the pre-commit configuration and the project settings. Ruff linter configuration is adjusted to include security checks and to ignore them in test files. The Ruff pre-commit hook is renamed, and configuration for per-file ignores is updated for clarity and scope. Additionally, type annotations and explanatory comments were removed from the Malaysia holiday module without changing functionality.

Changes

File(s) Change Summary
.pre-commit-config.yaml Removed Bandit hook; renamed Ruff hook from ruff to ruff-check; kept Ruff formatting hook unchanged.
pyproject.toml Deleted [tool.bandit] section; added "S" codes to Ruff select; renamed per-file ignores key; ignored "S" in tests; preserved existing ignore for scripts/generate_release_notes.py.
holidays/countries/malaysia.py Removed conditional import of date for type checking; deleted type annotation and explanatory comment for dts_observed in Malaysia class.

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch upd-pre-commit-cfg
  • Post Copyable Unit Tests in Comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented May 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ed09644) to head (5d951ba).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2548   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          216       216           
  Lines        13739     13737    -2     
  Branches      1942      1942           
=========================================
- Hits         13739     13737    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between ed09644 and 3501d52.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml (1 hunks)
  • pyproject.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: Test build on windows-latest
🔇 Additional comments (1)
pyproject.toml (1)

70-70: Enable Ruff security checks by including “S” codes
Adding the “S” category to select ensures Ruff will pick up the Bandit‐style security rules via flake8-bandit. This aligns perfectly with the goal of replacing the old Bandit hook.

@KJhellico KJhellico changed the title Update pre-commit config: replace bandit with ruff.lint.flake8-bandit Update pre-commit config May 16, 2025
PPsyrius
PPsyrius previously approved these changes May 16, 2025
Copy link
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

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

LGTM - great work on test suite consolidation 👍

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
pyproject.toml (1)

72-72: Rename to per-file-ignores.

Switching from extend-per-file-ignores to the documented per-file-ignores format is correct and aligns with Ruff’s latest configuration style.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 48e9a42 and dd09aa6.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
🔇 Additional comments (1)
pyproject.toml (1)

70-70: Include security checks in Ruff select.

Adding "S" to the select list ensures Ruff continues to enforce security rules now that Bandit is removed.

@arkid15r arkid15r enabled auto-merge May 18, 2025 18:24
@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
pyproject.toml (1)

72-72: Rename per-file-ignores as intended
The switch from extend-per-file-ignores to per-file-ignores correctly follows Ruff’s configuration conventions.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between dd09aa6 and 5d951ba.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: Test build on windows-latest
🔇 Additional comments (1)
pyproject.toml (1)

70-70: Include security rule codes in Ruff linting
Adding "S" to the select list ensures Ruff will check security-related rules via the flake8-bandit integration. This aligns with replacing the Bandit hook in pre-commit.

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@arkid15r arkid15r added this pull request to the merge queue May 18, 2025
Merged via the queue into vacanza:dev with commit cf52064 May 18, 2025
33 checks passed
@KJhellico KJhellico deleted the upd-pre-commit-cfg branch May 18, 2025 20:26
@KJhellico KJhellico mentioned this pull request May 19, 2025
Wasif-Shahzad pushed a commit to Wasif-Shahzad/holidays that referenced this pull request May 21, 2025
ShalomDee pushed a commit to ShalomDee/holidays that referenced this pull request Jun 2, 2025
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.

3 participants