Skip to content

Autoformat code using black#76

Closed
hannahbast wants to merge 3 commits intomainfrom
autoformat-code
Closed

Autoformat code using black#76
hannahbast wants to merge 3 commits intomainfrom
autoformat-code

Conversation

@hannahbast
Copy link
Copy Markdown
Collaborator

No description provided.

@Qup42
Copy link
Copy Markdown
Collaborator

Qup42 commented Oct 17, 2024

ruff is an up-and-coming linter and quite hot at the moment. Its claim to fame is being extremely fast and unifying many tools in one. It supports the functionality of flake8, isort and black. Might be worth a look, while we are working on this topic.

@hannahbast
Copy link
Copy Markdown
Collaborator Author

@Qup42 Thanks a lot for the hint. I read a bit about ruff and I am in favor of using it. Our current format check does:

for PY in $(find src test -name "*.py"); do printf "$PY ... "; black --check $PY && flake8 $PY && python3 -m py_compile $PY && isort -c $PY && echo "OK"; done

How would you replace that?

@Qup42
Copy link
Copy Markdown
Collaborator

Qup42 commented Oct 18, 2024

The command to check would then be ruff format --check && ruff check && python -m compileall src. I've also taken the liberty to add a commit with a ruff config file and a pre-commit hook config.

@Qup42
Copy link
Copy Markdown
Collaborator

Qup42 commented May 6, 2026

No longer needed after #288

@Qup42 Qup42 closed this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants