LSP icon indicating copy to clipboard operation
LSP copied to clipboard

Enable linting on commit

Open rchl opened this issue 1 month ago • 2 comments

Is your feature request related to a problem? Please describe.

It's annoying to realize that there are lint errors only after pushing changes to review.

Describe the solution you'd like

We should set up a git commit hook to quickly check changes on commit.

While I could just do it locally, we should have a setup that does that automatically for everyone. I'm familiar with how to set up something like that in Node ecosystem but not sure what are the best practices with python ecosystem. Maybe someone has an idea?

rchl avatar Dec 06 '25 11:12 rchl

I don't know how exactly the commit hooks work, but when I want to run the CI checks locally, I just run tox from the command line. That does linting with the same Pyright & flake8 versions that we have here in the GitHub CI.

jwortmann avatar Dec 06 '25 11:12 jwortmann

Yes but the point is that git should do it for me and fail the commit if there are errors.

AI told me about https://pre-commit.com/. It wouldn't be as automatic as I imagined (in NPM projects all this can be set up on running npm install) but it would require one to install that package manually and then run a command to install the hooks. So it's more of a documentation type of change.

rchl avatar Dec 06 '25 11:12 rchl