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

chore: add pre-commit configuration file, run ruff-isort #634

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

agriyakhetarpal
Copy link
Collaborator

Description

Continuing from #633, this PR adds support for the pre-commit via its configuration file, which works with https://pre-commit.ci. More information to help make review(s) for this PR easier:

  • I have suppressed all failing rules to get pre-commit passing in 68e3dda, so that we can fix them all later.
  • At most, the style changes in this PR come from 0f7bce4, where the imports have been tidied up and sorted using the ruff check . --select I --fix && ruff format . command.
  • The pre-commit config configuration file was added in 5da6308. Please let me know if we need to add any more hooks! This is the only relevant commit, the other commits are just for stylistic changes because I didn't want to let CI fail here.

Additionally, to automatically enable pre-commit as a Git hook locally, type:

pip install pre-commit
pre-commit install

and subsequently, it would not allow creating commits that fail the style rules we have set in pyproject.toml or those in .pre-commit-config.yaml.

Copy link
Collaborator

@fjosw fjosw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @agriyakhetarpal , looks good to me, thanks for tidying the code base up! For now, the pre-commit hooks are only locally executed (if configured by the user) and not validated in a GitHub actions workflow, correct?

@agriyakhetarpal
Copy link
Collaborator Author

agriyakhetarpal commented Aug 30, 2024

Yes, you are correct. They are just locally executed for now. I opened an issue as a reminder for us to do that: #637. We could add it here, but my thoughts were that having a smaller diff would be nicer. Thanks for the review!

@agriyakhetarpal agriyakhetarpal merged commit f35fcca into master Aug 30, 2024
19 checks passed
@agriyakhetarpal agriyakhetarpal deleted the chore/pre-commit branch August 30, 2024 17:59
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