Add support for black formatting python code in mozlint
Categories
(Developer Infrastructure :: Lint and Formatting, task, P2)
Tracking
(firefox80 fixed)
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: catlee, Assigned: tomprince)
References
Details
Attachments
(2 files, 1 obsolete file)
Similar to bug 1551078, we should have support for running black
over our python code.
Reporter | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Depends on D33125
Reporter | ||
Comment 3•6 years ago
|
||
Depends on D33126
Updated•6 years ago
|
Comment 4•6 years ago
|
||
I feel like everyone is all aboard the black
train, so don't expect anything to come of this comment.. but I'm going to make it anyway :).
Has anyone looked into yapf
? I like the idea of us being able to tweak knobs in configuration (while still enforcing a consistent mozilla-central
wide style). I worry that:
A) Black will be somewhat annoying as a linter (I have fewer reservations about using it as a formatter that just makes the changes outright).
B) Black is too opinionated. I definitely see the value in consistency, but frankly some of the things it enforces seem pretty esoteric and unhelpful. I sometimes feel like I'm alone in this opinion, but I believe there is a little bit of room for personal freedom of expression in programming. I like yapf
for its configurability, it can give us the best of both worlds.
Anyway, I'm not going to step in the way of progress here or anything. I definitely agree that using black
is better than not using anything at all.
Assignee | ||
Comment 5•6 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #4)
but frankly some of the things it enforces seem pretty esoteric and unhelpful.
I definitely find that a few of the choices that black makes to be poor for readability (but not unbearably so). However, I think not having any knobs outweighs that by a significant margin.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Backed out 2 changesets (Bug 1555560) for causing multiple lint failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/154875e919922646bae9c2089d16b21ed7435065
Failure logs:
Comment 10•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bed3e7c8f5d2
https://hg.mozilla.org/mozilla-central/rev/e59f19cfc123
Updated•2 years ago
|
Description
•