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

Upgrade ruff #922

Merged
merged 5 commits into from
Dec 19, 2023
Merged

Upgrade ruff #922

merged 5 commits into from
Dec 19, 2023

Conversation

Lee-W
Copy link
Member

@Lee-W Lee-W commented Dec 3, 2023

Description

  • relax ruff and black constraint
  • upgrade dev depedencies
  • use ruff format

closes: #915

Checklist

  • Add test cases to all the changes you introduce
  • Run ./scripts/format and ./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

Steps to Test This Pull Request

Additional context

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (120d514) 97.33% compared to head (b748d9f) 97.39%.
Report is 124 commits behind head on master.

Files Patch % Lines
commitizen/cli.py 82.14% 5 Missing ⚠️
commitizen/providers/scm_provider.py 91.17% 3 Missing ⚠️
commitizen/git.py 80.00% 2 Missing ⚠️
commitizen/changelog_formats/__init__.py 97.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #922      +/-   ##
==========================================
+ Coverage   97.33%   97.39%   +0.05%     
==========================================
  Files          42       55      +13     
  Lines        2104     2341     +237     
==========================================
+ Hits         2048     2280     +232     
- Misses         56       61       +5     
Flag Coverage Δ
unittests 97.39% <97.93%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@noirbizarre noirbizarre left a comment

Choose a reason for hiding this comment

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

Good to me ! Beware of black versioning, using an open bounds can leads to formatting and CI breakage the day a version with updated rules is published.

pyproject.toml Outdated
@@ -58,9 +59,9 @@ pytest-regressions = "^2.4.0"
pytest-freezer = "^0.4.6"
pytest-xdist = "^3.1.0"
# code formatter
black = ">=22.10,<24.0"
black = ">=22.10"
Copy link
Member

Choose a reason for hiding this comment

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

You should keep pre-commit version in sync: https://github.com/commitizen-tools/commitizen/blob/master/.pre-commit-config.yaml#L36
Maybe rely on ~= notation to avoid silent black update (or the opposite, not updated because already present in earlier version) with formatting changes in both: black~=23.11 in pre-commit and black = "~=22.10" in pyproject

Copy link
Member Author

Choose a reason for hiding this comment

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

good point! let me update it to black~=23.11 on both sides

Copy link
Member

@noirbizarre noirbizarre left a comment

Choose a reason for hiding this comment

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

Note: I have been deploying this on my repositories lately: https://github.com/GabDug/sync-pre-commit-lock
It's a game changer: it update pre-commit hooks and keep them in sync when locking using poetry (I use it with pdm but same behavior)

@Lee-W
Copy link
Member Author

Lee-W commented Dec 19, 2023

Note: I have been deploying this on my repositories lately: https://github.com/GabDug/sync-pre-commit-lock It's a game changer: it update pre-commit hooks and keep them in sync when locking using poetry (I use it with pdm but same behavior)

This indeed looks cool! How do you feel about pdm? I was thinking of trying it in my personal project as well

@Lee-W Lee-W merged commit aa9eda8 into master Dec 19, 2023
17 of 18 checks passed
@Lee-W Lee-W deleted the upgrade-ruff branch December 19, 2023 01:08
@noirbizarre
Copy link
Member

I am a pdm contributor and maintainer. I use it on all my personal projects (or at least I am migrating them) and I am currently migrating my clients to pdm too.
So far it's just so good !!

Note that I am currently working with a copier+ pdm + commitizen + pre-commit` stack, it's just perfect 👌🏼

@Lee-W
Copy link
Member Author

Lee-W commented Jan 3, 2024

I am a pdm contributor and maintainer. I use it on all my personal projects (or at least I am migrating them) and I am currently migrating my clients to pdm too. So far it's just so good !!

Note that I am currently working with a copier+ pdm + commitizen + pre-commit` stack, it's just perfect 👌🏼

Sounds cool! Will try it in my next project and see how it works 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants