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 and pre-commit fight each other #25

Closed
jaraco opened this issue Sep 14, 2020 · 1 comment
Closed

black and pre-commit fight each other #25

jaraco opened this issue Sep 14, 2020 · 1 comment

Comments

@jaraco
Copy link
Owner

jaraco commented Sep 14, 2020

The skeleton, attempting to follow best practices, requires three different versions of black installed:

  • black installed in the test suite to validate the syntax during test runs, defined in the tests requirements based on PyPI releases.
  • black installed in the developer's environment to apply the syntax changes, defined by the developer across any number of projects.
  • black installed by pre-commit to prevent the developer from committing invalid syntax, defined in pre-commit yaml based on Git rev refs.

As you can see, there are three different versions of black defined in three different places, one at a different scope than the others (user vs project), and using different version schemes (git refs vs. releases).

And because black changes what is considered valid syntax on a release-by-release basis, there's no reliable way to maintain consistency short of pinning to a specific version and updating that pinned version across projects and environments.

Even installing the "latest" "stable" version of all dependencies (as is currently defined), I've run into issues getting everything in sync.

There's got to be a better way.

@jaraco
Copy link
Owner Author

jaraco commented Dec 30, 2020

In pre-commit/pre-commit#1748, I learned that there's no intention to support a "latest" concept, so the best way to manage this for now is to repeatedly update the version here using the "autoupdate" command, and Anthony recommends to consider using https://pre-commit.ci instead.

@jaraco jaraco closed this as completed Jan 9, 2021
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

No branches or pull requests

1 participant