lona-web-org/lona

Set up pre-commit for development tools

laundmo opened this issue · 9 comments

pre-commit allows for automatically running certain tools before a commit is made, ensuring that things like autoformatters, linters etc. all pass for the commit. This makes it easier on contributors not having to remember each tool to run, making the pull request process much less of a hassle.

Ideally this would be set up for all the lona-web-org repositories.

Would this be something you're open to @fscherf ?

@laundmo I am not sure about this. I want to be able to commit unclean patches to a private branch. Sometimes to clean them up later, or just for development. With such an mechanism that wouldn't be possible. Also i am perfectly fine with unclean patches if the author agrees to change them or agrees with me changing them.
Also Lona has a mechanism for this: Just run make lint in the top-level

the issue with make is windows compatibility. im not able to run it personally, since i develop on windows.

@laundmo can you run tox? make lint just runs tox -e lint

@fscherf its the dev-env setup thats failing, since make tries to use python3 which only exists as a Windows Store alias and therefore throws a permission error.

in any case, im not trying to troubleshoot make. pre-commit uses a git hook, which can be bypassed with --no-verify in cases where someone might want that.

@laundmo OK. I am open to patches that make linting on windows more easy, but i don't want a solution based on pre-commit hooks.

@laundmo could we setup some kind of docker infrastructure to run testing and linting in a container?

Possibly, but I would go with just using GitHub Actions, its what they're made to do, and you get the checks for open PRs displayed right there.

@laundmo: in the meantime i added docker infrastructure

I will close this issue for now. Feel free to reopen it if you want to discuss this issue further