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

Use an automatic code formatter and pre-commit hook? #3464

Closed
nicoddemus opened this issue May 10, 2018 · 7 comments
Closed

Use an automatic code formatter and pre-commit hook? #3464

nicoddemus opened this issue May 10, 2018 · 7 comments
Labels
type: infrastructure improvement to development/releases/CI structure

Comments

@nicoddemus
Copy link
Member

Hi everyone,

I've been thinking about some time now to use an automatic code formatter to our codebase such as black or yapf, together with pre-commit and tox environments to check for compliance on CI.

Pros:

  • Consistent code formatting: currently the format is very mixed and we don't enforce it.
  • Help new contributors: no need to think or follow a style guide, it is done automatically.

Cons:

  • We will pollute the repository and lose some of the blame history.

Opinions?

@nicoddemus nicoddemus added the type: infrastructure improvement to development/releases/CI structure label May 10, 2018
@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #2390 (Use automatic CHANGELOG management), #2832 (exit code 2 when using '-x' flag), #2987 (Feature request: use caplog with custom formatter), #2421 (ModuleNotFoundError when using the tests outside application code layout), and #2124 (fixture hooks use session.ihook instead of a fitting hookproxy).

@RonnyPfannschmidt
Copy link
Member

lets schedule this either right before or right after a major release
also lets take some extra care, since the tools are potentially problematic

i plan to test black on setuptools_scm again in future

@nicoddemus
Copy link
Member Author

nicoddemus commented May 11, 2018

Agree with doing it after a minor release (I take that's what you meant right?) and to take care in using the tools (we need to see how they behave on a day to day basis). I also plan to do it in some plugins myself before committing to do the same in pytest.

I wrote this mostly to start gathering opinions.

@RonnyPfannschmidt
Copy link
Member

whops, yes thats what i meant

@asottile
Copy link
Member

I'm willing to help with this if you'd like :)

@RonnyPfannschmidt
Copy link
Member

@asottile appreciated - basically i want to copy what i did for setuptools_scm/sentaku and you did for tox&others ^^

@asottile
Copy link
Member

asottile commented Jul 1, 2018

I think we're good to call this done 👍

@asottile asottile closed this as completed Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: infrastructure improvement to development/releases/CI structure
Projects
None yet
Development

No branches or pull requests

4 participants