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

Move Black to pre-commit #503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arturdryomov
Copy link
Member

@arturdryomov arturdryomov commented Dec 16, 2024

Description

Moves the Black formatter from test dependencies (see comments below) to pre-commit so it can be enforced during local workflows and CI checks as well.

Release notes

This is not user-visible or docs only and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Dec 16, 2024
@@ -27,27 +27,30 @@
readme = f.read()

kerberos_require = ["requests_kerberos"]
gssapi_require = [""
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure about the purpose of "" here. Perhaps it should be removed?

"pytest-runner",
"pre-commit",
"black",
"isort",
Copy link
Member Author

Choose a reason for hiding this comment

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

Both isort and black are here but were never enforced. Neither were mentioned in the development documentation as well.

Copy link
Member

Choose a reason for hiding this comment

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

might want to look at #227 for context.

The TL;DR version was:

  • While standard code format is nice black often makes changes to the detriment of readability
  • If we ever do this we need to figure out a way to be history preserving (probably via blame-ignore config - jvanzyl/provisio@a4cdb8d)
  • black and isort running in pre-commit makes iteration slower sometimes since you are prevented from committing or running ci just because of style issues

@arturdryomov arturdryomov requested a review from hashhar December 16, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants