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

Format code using the tool black #1039

Merged
merged 1 commit into from
Mar 7, 2019
Merged

Format code using the tool black #1039

merged 1 commit into from
Mar 7, 2019

Conversation

bboe
Copy link
Member

@bboe bboe commented Mar 7, 2019

No description provided.

@jarhill0
Copy link
Contributor

jarhill0 commented Mar 7, 2019

Out of curiosity, is this a one-time format or will it enforce style going forward? Either way, I'm in favor of consistent style!

@bboe
Copy link
Member Author

bboe commented Mar 7, 2019

Out of curiosity, is this a one-time format or will it enforce style going forward? Either way, I'm in favor of consistent style!

This change incorporates it as part of the pre_push.py script. I'm going to see about making it a pre commit hook too.

@bboe bboe force-pushed the black_format branch 8 times, most recently from 269b792 to 89683e1 Compare March 7, 2019 22:24
@bboe bboe merged commit 71f267c into master Mar 7, 2019
@bboe bboe deleted the black_format branch March 7, 2019 22:33
success &= do_process('pydocstyle', 'praw')
success &= do_process('pylint', '--rcfile=.pylintrc', 'praw')
success &= do_process(["black -l 79 *.py docs praw tests"], shell=True)
success &= do_process(["flake8", "--exclude=.eggs,docs,.tox"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Flake8 is spamming loads of “Q000 Remove bad quotes” messages because of black’s formatting. Can we have --ignore=Q000 be added to this command?

Copy link
Member Author

Choose a reason for hiding this comment

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

What version of flake8 do you have? Do you happen to have flake8-quotes installed? Perhaps that's resulting in the issues.

3.7.7 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.7.2 on Darwin

That's what I'm running?

Copy link
Contributor

Choose a reason for hiding this comment

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

I do happen to have flakes8-quotes installed.

3.7.5 (flake8_quotes: 1.0.0, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.0) CPython 3.7.2 on Darwin

success &= do_process(["black -l 79 *.py docs praw tests"], shell=True)
success &= do_process(["flake8", "--exclude=.eggs,docs,.tox"])
success &= do_process(["pydocstyle", "praw"])
# success &= do_process(["pylint", "--rcfile=.pylintrc", "praw"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is pylint commented out?

Copy link
Member Author

@bboe bboe Mar 24, 2019

Choose a reason for hiding this comment

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

I didn't satisfactorily resolve the issues it was complaining about after adding in black for source code formatting. So I've commented it out. Getting pylint to pass has never been terribly important as it's never been part of CI. I like to run it periodically to see if its report has anything useful, however.

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