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

Reformat code using Black formatter #432

Merged
merged 7 commits into from
Feb 9, 2021

Conversation

MartinThoma
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Feb 7, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling a09382e on MartinThoma:autoformatter into dc3780b on dbader:master.

Copy link
Collaborator

@SijmenHuizenga SijmenHuizenga left a comment

Choose a reason for hiding this comment

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

Hi! This looks great. I've added black to the requirements.txt file and added a bit in the documentation. Feel free to make changes to this if you think it can be done better @MartinThoma.

For documentation purposes: this pr has breefly been discussed here

I tried running black on this branch and it formatted the code differently from what is proposed here. I guess running black should result in no changes after this pr. Any idea what could cause this?

@SijmenHuizenga
Copy link
Collaborator

And can you add yourself to AUTHORS.rst? Thanks!

@MartinThoma
Copy link
Contributor Author

@SijmenHuizenga The difference is the only thing that you can configure in black - the line length 😄

I ran it with "black --line-length 79 ." which is compatible to PEP8. You might have run just "black ." (as in the docs) which by default is a line length of 88 characters. Which line length would you like to have?

I could also add a pyproject.toml where the line length is set for black. This way "black ." would do the right thing. You just need to decide what "the right thing" is 😄

Copy link
Contributor Author

@MartinThoma MartinThoma left a comment

Choose a reason for hiding this comment

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

Adding it to the requirements-dev looks good; the docs might need --line-length

@SijmenHuizenga
Copy link
Collaborator

Thanks for the explanation!

Since we are changing the formatting anyway we might as well go with the default black settings 😄 The 88 character line width seems more in line with the rest of the world.

Copy link
Collaborator

@SijmenHuizenga SijmenHuizenga left a comment

Choose a reason for hiding this comment

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

LGTM!

@SijmenHuizenga
Copy link
Collaborator

One last thing before we merge, can you please remove the commits that were pulled in from master? Some 'merge' commits are fine but now somehow there are all these commits in here that are unrelated and have you as co-author. If you can't figure out how to fix this git magic, don't worry, just let me know and I will fix it.

@MartinThoma
Copy link
Contributor Author

I'm sorry, I don't know that. I typically squash before I merge (or amend + force-push on feature branches). If it's not a big deal for you, please go ahead and do it :-)

Copy link
Contributor Author

@MartinThoma MartinThoma left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@SijmenHuizenga SijmenHuizenga changed the title Apply black==20.8b1 Reformat code using Black formatter Feb 8, 2021
@SijmenHuizenga SijmenHuizenga merged commit 32a1400 into dbader:master Feb 9, 2021
@MartinThoma MartinThoma deleted the autoformatter branch February 9, 2021 22:10
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

3 participants