openedx / edx-django-utils

edX utilities for Django Application development.
https://edx.readthedocs.io/projects/edx-django-utils/en/latest/
Apache License 2.0
26 stars 20 forks source link

Replace isort quality check #423

Open jesperhodge opened 3 months ago

jesperhodge commented 3 months ago

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.

timmc-edx commented 1 month ago

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.