Closed Bug 1555263 Opened 6 years ago Closed 2 years ago

Make raptor code black compatible

Categories

(Testing :: Raptor, task, P4)

task

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: Bebe, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: [fxp])

Attachments

(1 obsolete file)

Review and update all raptor code base and make it black code style compatible

https://github.com/python/black

:rwood :davehunt would this be ok?

Flags: needinfo?(rwood)
Flags: needinfo?(dave.hunt)
Priority: -- → P3

(In reply to Florin Strugariu [:Bebe] from comment #1)

:rwood :davehunt would this be ok?

No. We need to keep the same Mozilla wide coding style. Also I don't wish to introduce more complexity at this time, we have several Raptor issues (i.e. intermittent failures) that we need to focus on. :)

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style

Flags: needinfo?(rwood)

I would love to see us adopting black or something like it, but rwood has a good point regarding consistency with the rest of mozilla-central. We should also include a solution to block patches that don't comply, or reformat them in a pre-commit hook. For now, let's block this on bug 1540641, which is experimenting with using black throughout the tree.

Depends on: black
Flags: needinfo?(dave.hunt)
See Also: → 1584478
Assignee: nobody → fstrugariu
Status: NEW → ASSIGNED
Priority: P3 → P1

(In reply to Florin Strugariu [:Bebe] (needinfo me) from comment #5)

As of https://wiki.mozilla.org/TestEngineering/Performance/Raptor#Code_formatting_on_Raptor
let's make raptor black compatible

How are you going to enforce that? This question from comment 3 is still open, and it doesn't make that much sense to land those changes without having such enforcement in place. Also what is different to the internal linter? No other code in mozilla-central (AFAIK) wants to be black formatted.

Flags: needinfo?(fstrugariu)

As black is the recomanded tool I just wanted to make sure we are compatible. No enforcement in mind.

https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_python.html

Flags: needinfo?(fstrugariu)

Enforcement would be taken care of in bug 1540641. I think it's okay to update our code to be compatible, but accept that it may diverge without enforcement.

Oh, good to know that they added black on that page. In that case I assume our linter takes care of it, even if it's only partial (it might ignore " vs ').

:ahal can you share your feedback on https://phabricator.services.mozilla.com/D62574

Flags: needinfo?(ahal)

Looks fine to me, but my feedback isn't needed for formatting changes in modules I'm not involved with :)

Flags: needinfo?(ahal)

:Dave :Henrik can you recommend a resolution on this bug?

Should we continue/make raptor black compatible? or end this effort and resolve with won't fix

Flags: needinfo?(hskupin)
Flags: needinfo?(dave.hunt)

This bug depends on bug 1540641, which is assigned to Sylvestre. I am not against reformatting Raptor to make it black compatible, but if this is done without also enabling some sort of automated linter of formatter then it will quickly become inconsistent again. :Sylvestre do you have any plans to work on bug 1540641? Is there anything we can do to help?

Flags: needinfo?(sledru)
Flags: needinfo?(hskupin)
Flags: needinfo?(dave.hunt)
Assignee: fstrugariu → nobody
Status: ASSIGNED → NEW
Priority: P1 → P2
Attachment #9126077 - Attachment is obsolete: true
Flags: needinfo?(sledru)
Version: Version 3 → Trunk

Yeah, I will have a look to black on the code base

Type: defect → task
Severity: normal → S3
Flags: needinfo?(ahal)
Whiteboard: [fxp]

I believe all our Python code is now black (or ruff). @ahal do you know if there's anything left to do here? I wonder if bug 1540641 and its dependencies can be resolved.

We don't use ruff's formatter yet, it's still black. And I don't see this dir listed in https://searchfox.org/mozilla-central/source/tools/lint/black.yml so it should be running.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(ahal)
Resolution: --- → WORKSFORME
Priority: P3 → P4
Severity: S3 → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: