Closed Bug 1870291 Opened 1 year ago Closed 1 year ago

use `ruff` instead of `flake8` in moz-phab

Categories

(Conduit :: moz-phab, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sheehan, Assigned: sheehan)

Details

Attachments

(6 files, 1 obsolete file)

We should switch moz-phab from flake8 to ruff. We can also use some of ruff's linting capabilities to mass fix certain oddities in the codebase, namely switching to dict literals instead of calling the dict builtin.

Switch from flake to ruff for styling. Update test_style.py
to lint the codebase with ruff.

Run ruff across the entire codebase, then run with --unsafe-fixes
and manually vet their correctness.

Add a noqa for rule B019 to uses of lru_cache. Using the
lru cache in this way is a problem as the self value is used
as a cache key, which means a reference to the instance is kept
around by the cache, which can cause a memory leak since the
instance can't be garbage collected.

In our case, there is only ever one instance of a Repository
for the lifetime of the program, so we aren't worried about
an issue with the garbage collector.

Attachment #9369308 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Attachment #9370162 - Attachment description: WIP: Bug 1870291 - requirements: update windows requirements → requirements: update Windows requirements (Bug 1870291)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: