On Tue, 28 Mar 2023 at 17:13, Tirthankar Mazumder <[email protected]> wrote: > > Adding a bit to this, the Rust repository does something similar to the > pre-commit hook thing: When you set up your dev environment, you can > optionally run ./x.py setup which optionally installs a pre-commit hook (with > the user's permission, of course) for running tidy, their internal tool for > ensuring code quality.
Yes, lots of different repos do something similar. I don't like the idea of actually using a git hook myself that prevents git commit from working if the checks don't pass. Being able to manually run some quick checks is useful though and providing that in a preconfigured way makes it easier for new contributors to get started. With https://github.com/sympy/sympy/pull/24908 you can pip install pre-commit and then any time you want to run the precommit checks you just run: $ pre-commit flake8...................................................................Passed ruff.....................................................................Passed Here that runs in under a second. A few other checks could also be added without slowing it down too much. > On Tuesday, March 28, 2023 at 9:20:25 PM UTC+5:30 [email protected] wrote: >> >> I personally would find a bot adding commits to my work a bit intrusive. If >> the bot posted a comment to the issue telling me what to fix, that would be >> preferable. Right now we have to make a few clicks to see why the linter >> failed. >> >> Conda forge has a bot that will add commits to your branch, but only if you >> explicitly ask it to. If we had some bot commands like '@sympy/bot please >> fix flake8 issues' then that would run the fix and add the commit, but it is >> the author's choice to do so. I don't think anything exists that works like that. Of course if the fixes can be applied automatically then you could just run pre-commit to apply them locally. -- Oscar -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxQDPmQ1MhmJxPL7nxORKox0s%3DFnQGm3c-CACXHiaCVpoA%40mail.gmail.com.
