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

Add Black Formatter #162

Merged
merged 3 commits into from Jan 20, 2020
Merged

Add Black Formatter #162

merged 3 commits into from Jan 20, 2020

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Jan 20, 2020

Changes / Features implemented

  • Add black
  • Configure pre-commit
  • Run on pre-existing files

Side effects of implementing this change

  • n/a

Closes #152

@DavisRayM
Copy link
Contributor Author

DavisRayM commented Jan 20, 2020

I've formatted all files locally with black but there seems to be a false positive for "bad continuation line" error on pylint. This is an ongoing discussion? on both pylint and black.

@DavisRayM DavisRayM changed the title Add Black Formatter [WIP] Add Black Formatter Jan 20, 2020
@moshthepitt
Copy link
Contributor

I've run formatted all files locally with black but there seems to be a false positive for "bad continuation line" error on pylint. This is an ongoing discussion? on both pylint and black.

@DavisRayM lets disable the pylint rule at the affected places in the code.

- Configure flake8 to play nice with black formatter. More info here https://github.com/psf/black#line-length
@DavisRayM DavisRayM changed the title [WIP] Add Black Formatter Add Black Formatter Jan 20, 2020
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
Copy link
Contributor Author

Choose a reason for hiding this comment

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

More details on why i did this here https://github.com/psf/black#line-length

- Silence bad-continuation and duplicate-code pylint errors
@DavisRayM
Copy link
Contributor Author

DavisRayM commented Jan 20, 2020

@moshthepitt Should we let black normalize all strings with double quotes. Or should i disable the string normalization ? The PR as is right now normalizes all strings.

@moshthepitt
Copy link
Contributor

@moshthepitt Should we let black normalize all strings with double quotes.

Yes lets let it

@DavisRayM
Copy link
Contributor Author

@moshthepitt Should we let black normalize all strings with double quotes.

Yes lets let it

Nice, this now contains the formatted files. Please have a look and review.

@DavisRayM DavisRayM merged commit 31f08c6 into master Jan 20, 2020
@DavisRayM DavisRayM deleted the 152-add-black-formatter branch January 20, 2020 13:23
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.

Add black
2 participants