-
Notifications
You must be signed in to change notification settings - Fork 1.4k
CI: pre-commit #2843
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
CI: pre-commit #2843
Conversation
7482943 to
76c29fe
Compare
|
thanks, this looks great, perhaps we don't need isort/black/flak8 here, those are enforced by |
there is a certain limitation with using it in GHA, if a bot push to a PR it does not trigger any other actions so the user needs to do e "void" commit to re-start this action... This is the advantage of any external bot, after their edit in PR all GH a are properly triggered 🐰
is nice, but persona I would say that have formatting in pre-commit is more transparent also it can be paired wth git so it is used for each commit automatically |
|
this codebase has been using the in my mind this pre-commit.ci tool could be a complementary tool for us to run manually from time to time, fixing minor issues such as |
yes, in such a case, yes, but still as it is implemented in GHA, it would trigger nay consecutive action, right?
well yes, even though this is rather meant as continuous fixing, you can see how it works for example on TorchMetrics package |
|
@monai-bot is a GitHub user and it will trigger consecutive actions. the only caveat is that the PR author should tick |
ok, so shall I close this PR? 🐰 |
|
no, this one is still useful, if you please
I'll merge this PR. many thanks for the discussions here! cc @Project-MONAI/core-reviewers |
28ee306 to
e812b60
Compare
all you requested have been fixed :] |
Signed-off-by: Jirka <jirka.borovec@seznam.cz>
Signed-off-by: Jirka <jirka.borovec@seznam.cz>
|
/build |
|
The dev CI will use the latest black and flake8, but this pre-commit CI config will update the tool's version quarterly. It may cause some conflicting results at some point. Let's merge this for now and later may need to remove the black and flake8 config in the pre-commit CI. |
you can set it weekly or monthly but I found it more reliable to have some stable version that scratching my head that yesterday all worked fine and this morning it does not pass... to find that some formatting package made release yesterday night which can be eventually buggy (as from experience it happed a few times and you need to ban the particular version)
I have already commented it out so black is not there |
* add pre-commit Signed-off-by: Jirka <jirka.borovec@seznam.cz>
Description
Enforcing the already defined styles such as Isort or pep8
Moreover, I would suggest enabling this nice bot that does the fixes for you within open PR
https://pre-commit.ci/
Status
Ready/Work in progress/Hold
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.