Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit replace bandit with ruff #45

Merged
merged 5 commits into from Mar 25, 2024

Conversation

JoseRZapata
Copy link
Owner

@JoseRZapata JoseRZapata commented Mar 25, 2024

♻️ Replace Bandit with ruff in pre-commit

✨ Context

ruff has reimplemented the bandit rules[1], so it can be use that as a better-integrated tool. So enable all the bandit rules and selectively disable some across the codebase and some in just tests where they don't make sense (e.g. flagging use of assert ).

[1] Per astral-sh/ruff#1646 they've implemented nearly all of them, and the remaining ones aren't that important IMO.

🧠 Rationale behind the change

uses less tools in pre-commit and get rid of the GitPython dependency, lees tools less security holes

Type of changes

  • 🔥 Improvements (Minor refactoring, code changes or optimizations)
  • ✅ Tests (Unit tests, integration tests, end-to-end tests)
  • 👷 🔧 CI or Configuration Files

🛠 What does this PR implement

remove bandit form pre-commit and replace it using RUff Rules

change unit test to ignore warning detected by ruff

🧪 How should this be tested?

  • make check

  • poetry run pytest --cov

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6c37c22) to head (6d96827).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #45   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines           63        62    -1     
=========================================
- Hits            63        62    -1     

@JoseRZapata JoseRZapata self-assigned this Mar 25, 2024
@JoseRZapata JoseRZapata marked this pull request as ready for review March 25, 2024 18:08
@JoseRZapata JoseRZapata merged commit f425353 into main Mar 25, 2024
8 checks passed
@JoseRZapata JoseRZapata deleted the feature/pre-commit-remove-bandit branch March 25, 2024 18:10
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.

None yet

1 participant