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

Autoformat code using black #76

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Autoformat code using black #76

wants to merge 3 commits into from

Conversation

hannahbast
Copy link
Member

No description provided.

@Qup42
Copy link
Member

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
Member 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
Member

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.

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