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

Add rye format and rye lint to the pre-commit configuration #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

georgiy-belyanin
Copy link

Set up a project.
Set up a descent linting/formatting tools.
Configure the CI.
Add modern pre-commit git hooks managers.
Not use them for running formatters and linters.

This patch adds the hooks for checking formatting and linting of the python code to the pre-commit configuration.

> Set up a project.
> Set up a descent linting/formatting tools.
> Configure the CI.
> Add modern pre-commit git hooks managers.
> Not use them for running formatters and linters.

This patch adds the hooks for checking formatting and linting of the
python code to the pre-commit configuration.
@georgiy-belyanin
Copy link
Author

georgiy-belyanin commented Sep 8, 2024

This pre-commit stuff works too smart for me. Everything seems to work though I'd be glad if someone also tested out the patch whether it works as intended.

@WoWaster
Copy link
Collaborator

WoWaster commented Sep 8, 2024

О, крутая штука! Я не добавил ruff в pre-commit, потому что идея содержать отдельные бинарики ruff и в rye, и в pre-commit показалась мне избыточной. Я не знал, что можно просто команды дёргать. Думаю, для тестирования стоит порекламить этот патч в чатике.

@toadharvard
Copy link

toadharvard commented Sep 15, 2024

Надо бы в CI убрать запуск проверки пре-коммит хуков или форматтера, так как не имеет смысла дважды запускать проверку форматирования (и в хуках и отдельной командой)

- name: Run pre-commit
run: |
rye run -- pre-commit run --all-files --color always --verbose --show-diff-on-failure
- name: Run ruff format
run: rye fmt --check
- name: Run ruff linter
run: rye lint -- --output-format=github

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.

3 participants