Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: isort GitHub action doesn't report expected issues #115

Open
elliot-100 opened this issue May 21, 2024 · 3 comments
Open

CI: isort GitHub action doesn't report expected issues #115

elliot-100 opened this issue May 21, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@elliot-100
Copy link
Collaborator

PR #107 passed all CI checks including isort linting: https://github.com/Olen/Spond/actions/runs/9096951441

Expected behaviour: flag unsorted imports, fail all builds and thus all required checks.

If I run isort on it locally, I get a number of issues:

(spond-LnXcNOlD-py3.8) ~\code\elliot-100_Spond git:[feat/club]
isort . --check-only
ERROR: C:\Users\bb\code\elliot-100_Spond\manual_test_functions.py Imports are incorrectly sorted and/or formatted.
ERROR: C:\Users\bb\code\elliot-100_Spond\transactions.py Imports are incorrectly sorted and/or formatted.
ERROR: C:\Users\bb\code\elliot-100_Spond\spond\club.py Imports are incorrectly sorted and/or formatted.
ERROR: C:\Users\bb\code\elliot-100_Spond\spond\spond.py Imports are incorrectly sorted and/or formatted.
ERROR: C:\Users\bb\code\elliot-100_Spond\tests\test_spond.py Imports are incorrectly sorted and/or formatted.
Skipped 2 files

Should investigate and verify other checks are working OK.

@elliot-100 elliot-100 added the bug Something isn't working label May 21, 2024
@elliot-100 elliot-100 self-assigned this May 21, 2024
@elliot-100
Copy link
Collaborator Author

Looks like I misconfigured isort in GitHub actions. Will submit PR to fix.

@elliot-100 elliot-100 changed the title CI: isort GitHub action doesn't seem to report expected issues CI: isort GitHub action doesn't report expected issues May 21, 2024
@elliot-100
Copy link
Collaborator Author

Partially fixed by #116.

  • For files in spond and tests, CI isort run should now flag unsorted imports using black compatible profile, report the diffs, (which is key to troubleshooting), fail all builds and thus all required checks.
  • It should also match behaviour of isort . run locally for files in these folders.

However CI isort run does not look at files outside these folders (it's not clear whether it did before as config was broken), as I could not seem to get the same results as running isort . locally after several attempts - which would make it pretty difficult to write compatible code.

This may not be feasible to fully fix. I think the time is better spent on moving to ruff (https://docs.astral.sh/ruff/) which can replace isort and black (and is compatible with some caveats), and is well documented and supported.

@elliot-100
Copy link
Collaborator Author

To get CI isort to run OK on files outside spond and tests, would need to deal with 'missing imports' issues for example scripts, e.g. ics package not specified in requirements. See very old #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant