Skip to content

Fix #201: Reformat source code with black #202

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

Merged

Conversation

tomschr
Copy link
Member

@tomschr tomschr commented Nov 24, 2019

This PR contains the following changes:

  • Add pyproject.toml containing black configuration
  • Add batch image in README.rst
  • Reformat source code with black (version 19.3b0)

Keep in mind, black reformats the code quite drastically. That means, all open pull requests will fail to merge. Maybe we should finish and merge pr #138?


You will notice, due to #200, the "Check" tab contains now two checks: one for Travis and another one with the GitHub Action for Black. Currently, the black formatting has zero diffs. 👍

@tomschr tomschr requested review from s-celles and ppkt November 24, 2019 19:10
@tomschr
Copy link
Member Author

tomschr commented Nov 24, 2019

Ahh, the Travis job fails due to "flake8 issues". What should we do with that target? I guess, we should replace it with some "black magic"? 😄

@tomschr tomschr added the Enhancement Not a bug, but increases or improves in value, quality, desirability, or attractiveness label Nov 24, 2019
@tomschr
Copy link
Member Author

tomschr commented Nov 24, 2019

Actually, seems we don't need "black magic", it can be solved with this addition in setup.cfg:

[flake8]
max-line-length = 88
exclude =
    .env,
    .eggs,
    .tox,
    .git,
    __pycache__,
    build,
    dist

Copy link
Member

@s-celles s-celles left a comment

Choose a reason for hiding this comment

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

LGTM except that CHANGELOG is missing

* Add `pyproject.toml` containing black configuration
* Add batch image in `README.rst`
* Reformat source code with `black`
Use max-line-length of 88 (default for black)
@tomschr tomschr force-pushed the feature/201-code-reformat-black branch from f37e9a1 to 437bcd2 Compare November 25, 2019 07:26
@tomschr
Copy link
Member Author

tomschr commented Nov 25, 2019

CHANGELOG is missing

@scls19fr Right, sorry. I've added it in commit 1dc8f9c.

@tomschr
Copy link
Member Author

tomschr commented Nov 25, 2019

Another question: Should we finish and merge pr #138 first before merging this? I've found an optimized version and posted it in #138 (comment)

Copy link
Member

@ppkt ppkt left a comment

Choose a reason for hiding this comment

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

LGTM :)

@s-celles
Copy link
Member

Not sure we reached consensus with #138
So maybe we should first merge this one...
especially because fixing merge issue in #138 shouldn't be difficult.

@s-celles s-celles merged commit dfc2270 into python-semver:master Nov 25, 2019
@tomschr tomschr deleted the feature/201-code-reformat-black branch November 25, 2019 08:48
@tomschr
Copy link
Member Author

tomschr commented Nov 25, 2019

I'm fine with either one. 😉 Actually, I was also thinking about the other open pull requests and if we make live of our contributors a bit more difficult. On the other side, some of them are quite old and need to be reviewed (closed, delegated, etc) anyway.

@tomschr tomschr self-assigned this Nov 25, 2019
@ppkt
Copy link
Member

ppkt commented Nov 25, 2019

I guess if everyone will run black there should be no conflicts :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Not a bug, but increases or improves in value, quality, desirability, or attractiveness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants