-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
Add pre-commit CI action #4982
Add pre-commit CI action #4982
Conversation
15867b7
to
202f898
Compare
@glenn-jocher mind have look? π° |
@Borda thanks! Is there any way to move the new .yaml and .cfg files from the top level of the repo into a subdirectory? |
I am not aware of it... do you have a reason not to have it in the root? |
@Borda well that's a good question. I'm not a design or UX expert, but my main intention with the repo is to make everything as simple and easy as possible. I'd like to keep the root directory minimal to not scare away first time users (and hopefully to have each file in the root have an easily identifiable purpose at first glance). A minimal root with also increase the chances that the README banner will appear on page load without users having to scroll down too much, which may increase conversions (from viewers to >> cloners). But I want to add linting at the same time! :) In addition to these two PRs maybe we could set up another meeting so we could discuss the high level changes we should be pursuing, and then we can work out the details for these two PRs? |
well yes but if you want to have some settings in other folders instead of default root, you will add extra complexity instead and hope that this re-routing will work for everyone
Check for example sklearn - https://github.com/scikit-learn/scikit-learn how their root looks like
I feel that is a kind of misunderstanding of the repo readme, if you want a landing page from readme GH can give it for you
fine with me, also we can sen some "refactoring" GH project to fill tickets with expected work so also other contributors can help |
@glenn-jocher Anyway, I would merge this one as entry gate if you agree... |
@glenn-jocher can we merge this one? |
@glenn-jocher not updating it anymore until you ask for it just before merging π° |
@Borda hi there! Yes I'd like to get this merged. I see you've kept it up to date with master, thank you!! Is there really no way to tidy up the root directory a bit? Can we shift any of the new files into .github or .github/workflows? |
Oh BTW I implemented some updates to the rebase action (dependabot now updates actions, so dependabot updated to rebase.yml to v1.5, and I also replaced GITHUB_TOKEN with a new ACTIONS_TOKEN personal access token that includes workflows permissions), so it might be possible to rebase using the /rebase command now, but it still doesn't work for many PRs unfortunately. EDIT: nope, seems like still failing with |
not really as pre-commit is an independent tool, not GH util |
@Borda could you add a header to each of the 3 new files that explains what they do in a sentence or two? I think this would help everyone understand them better if users decide to open them and look around. I see that pre-commit requires .pre-commit-config.yaml as they say in https://github.com/marketplace/pre-commit-ci, but they also say that nothing else is required beyond that. I'm guessing setup.cfg is required by Flake8 which is called by pre-commit? Then the last file I'm a bit confused about, code-format.yml. Is this what actually runs pre-commit on PR commits? BTW I think code-format.yml may have a problem, as it has |
yes
exactly
correct or you can activate this bot and then the new action is not needed, https://github.com/marketplace/pre-commit-ci
@glenn-jocher fixing it now |
@Borda PR is merged. Thank you for your contributions to YOLOv5 π and Vision AI β Do you think we should add the bot at https://github.com/marketplace/pre-commit-ci, or should we wait a bit and see how this PR works? |
I would rather use the bot as it pushes fixes to open PRs automatically even to forked PRs, compare to actions that works only with own PRs π° |
* define pre-commit * add CI code * configure * apply pre-commit * fstring * apply MD * pre-commit * Update torch_utils.py * Update print strings * notes * Cleanup code-format.yml * Update setup.cfg * Update .pre-commit-config.yaml Co-authored-by: Glenn Jocher <[email protected]>
this helps to maintain code formatting π°
moreover you may consider add this bot - https://github.com/marketplace/pre-commit-ci
π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Summary
Introduce code formatting workflows and update minor comment syntax.
π Key Changes
flake8
andpre-commit
.π― Purpose & Impact