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

black: specify major version 22 only #3326

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

Minnozz
Copy link
Contributor

@Minnozz Minnozz commented Mar 20, 2024

This changes some places where black (the Python formatter) is referenced:

  • The GitHub Action version itself is set to stable (as recommended)
  • The GitHub Action version constraint for black is relaxed to 22.* (formatting is guaranteed to be stable within a major version)
  • The required black major version is set in pyproject.toml to avoid formatting with a different major version. This improves consistency between different contributors (eg, me) having different black versions set up in their IDE
  • Add black as a dependency so IDEs (like VSCode) can be configured to use black from the local environment

This ensures consistent formatting among different contributors / development setups.

https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#required-version
This way, IDEs can be set up to use the black version from the environment instead of a globally
available/bundled black version.
@Minnozz
Copy link
Contributor Author

Minnozz commented Mar 20, 2024

I'm not well-versed enough with Python development setups to know if the last point (adding black as a dependency) is acceptable. Input is welcome!

@Minnozz Minnozz marked this pull request as ready for review March 20, 2024 11:56
Copy link
Contributor

@dato dato left a comment

Choose a reason for hiding this comment

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

I'm not well-versed enough with Python development setups to know if the last point (adding black as a dependency) is acceptable. Input is welcome!

Sounds acceptable to me, we just need to drop it in the merge to the production branch (i.e. when resolving conflicts there).

requirements.txt Show resolved Hide resolved
@Minnozz
Copy link
Contributor Author

Minnozz commented Mar 21, 2024

Sounds acceptable to me, we just need to drop it in the merge to the production branch (i.e. when resolving conflicts there).

Cool! (I wasn't aware a production branch existed until now)

@Minnozz Minnozz merged commit 3cde6db into bookwyrm-social:main Mar 21, 2024
10 checks passed
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

2 participants