-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
Adopt black code style #485
Conversation
HA! Yeah.... I take your point on lots of diffs! I've skimmed through the suggested changes, and on the whole it looks pretty reasonable.
...well exactly. Given the scale of this we should plan when to merge, but it's going to be painful whenever we do it, so we're just going to have to lean into that.
What are the conflicts? I think they're the things we should hash out now and then the rest is just a case of timing. ... oh and we should totally make sure we've got a markdown badge for this if we're going to the effort of doing it... 🤷 [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) |
This is the recommended configuration settings for using [flake8]
# Recommend matching the black line length (default 88),
# rather than using the flake8 default of 79:
max-line-length = 88
extend-ignore =
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
And you know I want the fancy badge 📛 ✨ 😎
If you want, I can quickly add the plugin, with configuration, and the new badge. Or we can close this for now, and come back to this later. For what it's worth, black only took 2 seconds to run, which was awesome ⚡ |
Let's do it. You only live once 🤘 |
We're good to go! Pinging 🔔 the other maintainers so they're aware of this change |
Codecov Report
@@ Coverage Diff @@
## master #485 +/- ##
=======================================
Coverage 92.91% 92.91%
=======================================
Files 29 29
Lines 4786 4786
=======================================
Hits 4447 4447
Misses 339 339
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
yes! great call @pwildenhain ! |
🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit on the badge. Otherwise I've skimmed though all of the changes and I think they're going to be quite useful. If nothing else it's reminded me how far this project has come!
README.md
Outdated
@@ -12,6 +12,7 @@ | |||
[![Requirements Status](https://img.shields.io/requires/github/sqlfluff/sqlfluff.svg?style=flat-square)](https://requires.io/github/sqlfluff/sqlfluff/requirements/?branch=master) | |||
[![CircleCI](https://img.shields.io/circleci/build/gh/sqlfluff/sqlfluff/master?style=flat-square&logo=CircleCI)](https://circleci.com/gh/sqlfluff/sqlfluff/tree/master) | |||
[![ReadTheDocs](https://img.shields.io/readthedocs/sqlfluff?style=flat-square&logo=Read%20the%20Docs)](https://sqlfluff.readthedocs.io) | |||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a nit, but can we add ?style=flat-square
to the url here? That should give the badge the same square edges as all the others.
🤷♂️ No idea why code coverage suffered, but I believe this is good to go 🚢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go - Merging now 👍
Related toCloses #481While there are a ton of diffs, I'm noticing some patterns:
dialects
package aloneThere are also a few linting CI failures, the
flake8-black
plugin mentions that there are a fewflake8
rules you would want to disable when using alongsideblack
What do you think @alanmcruickshank? Do you think
black
is an improvement?If so, do you think we should go for it now, or wait?
If not, do you have other suggestions for code formatters? I feel like a code linting/formatting library should have something like this 😁 😉