Skip to content

Upgrade ruff - #922

Merged
Lee-W merged 5 commits into
masterfrom
upgrade-ruff
Dec 19, 2023
Merged

Upgrade ruff#922
Lee-W merged 5 commits into
masterfrom
upgrade-ruff

Conversation

@Lee-W

@Lee-WLee-W commented Dec 3, 2023

Copy link
Copy Markdown
Member

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

@codecov

codecovBot commented Dec 4, 2023

Copy link
Copy Markdown

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.

FilesPatch %Lines
commitizen/cli.py82.14%5 Missing ⚠️
commitizen/providers/scm_provider.py91.17%3 Missing ⚠️
commitizen/git.py80.00%2 Missing ⚠️
commitizen/changelog_formats/__init__.py97.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 
FlagCoverage Δ
unittests97.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.

@noirbizarrenoirbizarre left a comment

Copy link
Copy Markdown
Member

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.

Comment threadpyproject.toml Outdated
pytest-xdist = "^3.1.0"
# code formatter
black = ">=22.10,<24.0"
black = ">=22.10"

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

@noirbizarrenoirbizarre left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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 masterDec 19, 2023
@Lee-W
Lee-W deleted the upgrade-ruff branch December 19, 2023 01:08
@noirbizarre

Copy link
Copy Markdown
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

Lee-W commented Jan 3, 2024

Copy link
Copy Markdown
MemberAuthor

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 freeto 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

@Lee-W@noirbizarre