Open Bug 1973586 Opened 8 months ago Updated 4 days ago

Add a Python linter rule to flag imports of the standard library `json` module instead of our `mozfile.json` compatibility shim

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement, P3)

enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: ahochheiden, Assigned: ahochheiden)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

We can only land this once all migrations in bug 1970521 are completed.

Since it's not possible to use orjson in all cases, we'll also need to add a way to suppress this lint via pragma so that in cases where it's necessary to use the standard library json the linter won't complain.

# noqa: TID251

Or something similar to the above (I'm not sure what the standard is for noqa).

The linter output should also communicate the existence of this pragma and when to use it, since most people getting this linter error will have none of this context.

Adding the linter should be one patch, then adding the pragmas to all the imports that could not be migrated to orson should be another.

Component: Mach Core → Lint and Formatting
Product: Firefox Build System → Developer Infrastructure
Duplicate of this bug: 2016980
Assignee: nobody → ahochheiden
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: