edx-django-utils icon indicating copy to clipboard operation
edx-django-utils copied to clipboard

Replace isort quality check

Open jesperhodge opened this issue 1 year ago • 1 comments

Problem Description

Spending two hours to figure out why the CI quality pipeline fails due to how isort wants me to sort my inputs is a waste of time.

isort is not documented in the readme so there's no way to know that you can locally run the command to automatically sort the imports correctly.

The rules are also not clear.

This costs development time.

Solution

Ideally, just run isort in the pipeline automatically and autofix instead of checking, then include the change in the commit. Or just remove isort from the quality check. Import sorting is not worth the amount of time it costs to fix problems.

jesperhodge avatar Jun 13 '24 15:06 jesperhodge

Auto-fixing as a GHA sounds nice, but we're probably going to approach this as a docs issue rather than a tooling issue—there's a broader issue of our tools varying somewhat from repo to repo.

In this case, you can run isort locally by using make quality from a virtualenv. More generally, you can run isort directly on a given file (again from a virtualenv) to have it autofix the file locally for you.

timmc-edx avatar Jul 29 '24 14:07 timmc-edx

https://2u-internal.atlassian.net/browse/BOMS-160

jristau1984 avatar Aug 07 '25 02:08 jristau1984