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

dev: swap black to ruff, drop pre-commit #62

Merged
merged 1 commit into from
Mar 29, 2024
Merged

dev: swap black to ruff, drop pre-commit #62

merged 1 commit into from
Mar 29, 2024

Conversation

NickCrews
Copy link
Contributor

now that ruff has formatting capabilities, we can drop one more dependency.
This also means that pre-commit is a bit overkill.
Also, the version of black and ruff in the pre-commit config was
out of sync from the version pinned in pdm.lock. That is bad.
So just drop pre-commit, and run stuff manually, there
are only a few commands.

I had to adjust a few of the example docstrings
so that ruff wouldn't autoformat away the needed leading indentation.

I was lazy and just added a bunch of # noqa: E721 for the
type(match.value) == str checks that should be isinstance()
checks, because when I tried isinstance, some tests failed.
The current method isn't that egregious.

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (649869e) to head (344d70e).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #62   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          463       463           
=========================================
  Hits           463       463           

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

@NickCrews NickCrews force-pushed the drop-black branch 2 times, most recently from 959eecd to 372226c Compare March 29, 2024 20:51
now that ruff has formatting capabilities, we can drop one more dependency.

Also, the version of black and ruff in the pre-commit config was
out of sync from the version pinned in pdm.lock. That is bad.
So just drop pre-commit, and run stuff manually, there
are only a few commands. But I can't remove it entirely,
since pre-commit.ci is enabled on all jazzband repos
and I can't turn it off. So there needs to be some content in there, so I added some of the generic builtin ones.

I had to adjust a few of the example docstrings
so that ruff wouldn't autoformat away the needed leading indentation.

I was lazy and just added a bunch of `# noqa: E721` for the
`type(match.value) == str` checks that should be isinstance()
checks, because when I tried isinstance, some tests failed.
The current method isn't that egregious.
@NickCrews NickCrews merged commit 897226e into master Mar 29, 2024
10 checks passed
@NickCrews NickCrews deleted the drop-black branch March 29, 2024 21:00
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