piccolo icon indicating copy to clipboard operation
piccolo copied to clipboard

CI: Add Pre-commit configuration 🐰

Open yezz123 opened this issue 4 years ago • 6 comments

based on this discussion https://github.com/piccolo-orm/piccolo/discussions/343

yezz123 avatar Nov 13 '21 00:11 yezz123

Codecov Report

Merging #346 (e88cabf) into master (925eeca) will increase coverage by 0.00%. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #346   +/-   ##
=======================================
  Coverage   90.58%   90.58%           
=======================================
  Files         127      127           
  Lines        6391     6392    +1     
=======================================
+ Hits         5789     5790    +1     
  Misses        602      602           
Impacted Files Coverage Δ
piccolo/apps/schema/commands/generate.py 91.36% <ø> (-0.04%) :arrow_down:
piccolo/columns/base.py 95.94% <ø> (+0.09%) :arrow_up:
piccolo/columns/column_types.py 92.85% <ø> (-0.05%) :arrow_down:
piccolo/query/base.py 85.27% <ø> (-0.08%) :arrow_down:
piccolo/utils/graphlib/_graphlib.py 87.15% <ø> (-0.12%) :arrow_down:

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 925eeca...e88cabf. Read the comment docs.

codecov-commenter avatar Nov 13 '21 00:11 codecov-commenter

@yezz123 Thanks for adding this.

Black recently added a feature where having a trailing comma forced it onto a new line:

data = (1,2,3,)

# Is formatted to:
data = (
    1,
    2,
    3,
)

Which version of Black are you on? I think if you use the latest version, the formatting will be different.

We encountered this issue in Piccolo API recently, and were confused why Black was giving inconsistent results (it was down to this trailing comma change).

dantownsend avatar Nov 14 '21 11:11 dantownsend

@yezz123 Thanks for adding this.

Black recently added a feature where having a trailing comma forced it onto a new line:

data = (1,2,3,)

# Is formatted to:
data = (
    1,
    2,
    3,
)

Which version of Black are you on? I think if you use the latest version, the formatting will be different.

We encountered this issue in Piccolo API recently and were confused why Black was giving inconsistent results (it was down to this trailing comma change).

I use the 19.10b0 version and the py version was py3.8

yezz123 avatar Nov 14 '21 13:11 yezz123

@yezz123 I think the change was in around version 20. If you use try the latest version, the diff will be smaller.

dantownsend avatar Nov 14 '21 14:11 dantownsend

@yezz123 I think the change was in around version 20. If you use to try the latest version, the diff will be smaller.

okay I will fix it

yezz123 avatar Nov 14 '21 14:11 yezz123

@dantownsend could you check now, I pull to the last version of black

yezz123 avatar Nov 14 '21 18:11 yezz123