harshil21 · GitHub

@harshil21

Copy link Copy Markdown

Member

Removes sort-all since ruff now supports sorting __all__. Also adds 2 more ruff rules:

Also forces pre-commit to use python 3.12, to ensure consistency between different hooks and between locally run pre-commit and CI pre-commit

@harshil21

github-actions[bot]

Copy link Copy Markdown

Choose a reason for hiding this comment

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

Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)

@harshil21

Copy link Copy Markdown

Member Author

huh, my pre-commit did not report those errors (differences in python version?).. also it seems like SIM401 was silently being ignored all this time? It's not a preview rule so not sure how ruff didn't catch that before..

Bibo-Joshi

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

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

different python version could certainly be. ruff always wants me to use typing.Self when running on py3.11 …

@harshil21

Copy link Copy Markdown

Member Author

Interesting thing I found about pre-commit - new contributors will not need to run pre-commit install whenever they clone our repo, if we do this. It will automatically install the hooks during cloning and run them on git commit. I can try doing this on another PR.

Also fix satisfy ruff errors

@harshil21

Copy link Copy Markdown

Member Author

Interesting thing I found about pre-commit - new contributors will not need to run pre-commit install whenever they clone our repo, if we do this. It will automatically install the hooks during cloning and run them on git commit. I can try doing this on another PR.

well I misunderstood what that option is for. It's only meant for local setups where you want your git to automatically install the .pre-commit-config.yaml from repositories to .git/hooks. We can't instruct others' git to do that (which makes sense since the INSTALL_PYTHON variable in .git/hooks/pre-commit differs according to where python is installed in your system).

Bibo-Joshi

And tell mypy to be 3.8 compliant

Bibo-Joshi

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

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

LGTM :) Is there anything left from your side or should I merge?

@harshil21

Copy link Copy Markdown

Member Author

@Bibo-Joshi

@Bibo-Joshi

Read the original on github.com ↗