falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.51k stars 937 forks source link

chore: switch to the `blue` code formatter 💙 #2064

Closed CaselIT closed 2 years ago

CaselIT commented 2 years ago

just a test to see how would blue work against our code base

codecov[bot] commented 2 years ago

Codecov Report

Merging #2064 (d197e3d) into master (6c30230) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2064   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6722      6722           
  Branches      1244      1244           
=========================================
  Hits          6722      6722           
Impacted Files Coverage Δ
falcon/__init__.py 100.00% <ø> (ø)
falcon/errors.py 100.00% <ø> (ø)
falcon/testing/resource.py 100.00% <ø> (ø)
falcon/util/__init__.py 100.00% <ø> (ø)
falcon/util/misc.py 100.00% <ø> (ø)
falcon/util/structures.py 100.00% <ø> (ø)
falcon/util/time.py 100.00% <ø> (ø)
falcon/util/uri.py 100.00% <ø> (ø)
falcon/response_helpers.py 100.00% <100.00%> (ø)
falcon/testing/helpers.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c30230...d197e3d. Read the comment docs.

kgriffs commented 2 years ago

<3

CaselIT commented 2 years ago

@vytas7 shall we proceed ? at worst we can go back to black without much trouble if blue gets abandoned for any reason.

I think we could keel the black configuration in pyproject, so if someones uses black on it noting much happens

vytas7 commented 2 years ago

I definitely prefer blue to black too, not sure if it is worth switching now though.

Actually, blue defaults to 79-char line length, which is also awesome, IMHO :heart: Maybe we could migrate to blue first, and then consider reducing the maximum line length to simply use blue's default settings? :smiling_imp:

CaselIT commented 2 years ago

I think 88 is a good compromise :)

not sure if it is worth switching now though.

well avoids having to manually handle ' vs ", so I guess why not?

vytas7 commented 2 years ago

We ought to follow blue's suit. If it says 79... (bad poker face)

vytas7 commented 2 years ago

Anyway, I'm all for blue, it seems be either at least equivalent to black, or better/more sensible in some aspects, with the potential to become even better AFAICT looking at their roadmap.

If we want to bring this out of Draft though, we'll need to update CONTRIBUTING.md, Actions gates, etc.

Edit: blue is the new black! :smiling_imp:

CaselIT commented 2 years ago

@kgriffs @vytas7 updated tox + contributing

vytas7 commented 2 years ago

cc @grantjenks @warsaw :100:

warsaw commented 2 years ago

So cool to see Falcon adopt blue. I remember adopting Falcon for Mailman years ago!