-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[cleanup] Lint the project, add pre-commit
hooks
#31350
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
base: master
Are you sure you want to change the base?
Conversation
This was run with `--aggressive --aggressive` and then false positives were discarded
`devscripts/buildserver.py` is too broken for me to bother with
3abaaef
to
482ca2b
Compare
Dealing with the easy one first, agreed. |
@dirkf Assuming you have no specific opinions on the TODOs posted, this PR should be fine as-is. Would it be possible to get this merged soon. (I have a similar patch ready for yt-dlp, but would prefer to merge it only after this one) |
Sorry, I've been lax in coming to views on your points, but am now a bit more up to speed.
+1
No, doing it afterwards sounds good.
If, as I infer from the next point, the style enforcement wouldn't automatically apply to a PR until merging, I'm inclined to say that we should just take that route instead (ie do whatever is necessary to apply the rules to commits in PRs). But if enforcement applies globally when a commit is made in a PR after the PR has been created, that should be enough. Either way, it would be good to warn potential devs as to what will happen to their precious code, and perhaps that they can avoid surprises by configuring their forks in the same way.
Well, actually this sounds good: I guess it's between that and the https://pre-commit.ci/lite.html version?
If the effect is possibly to update some of the checks that are being applied, shouldn't it be a separate step before triggering the release? |
If using current implementation:
If using pre-commit.ci
Alright. I'll add something to docs
I was not aware of this and was thinking we'd have to build the necessary workflow from scratch 😅. But it looks good
Fair. My thought was that adding to build workflow would be easiest and predictable. But we could also add it as a new timed workflow (per week?). Or, if the automatic push to master is a concern, we could also let it create a PR, like dependabot. Ofc, this is not relevant if using precommit.ci, since they already have a dependabot-like mechanism built in |
3555671
to
29e7494
Compare
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
Read adding new extractor tutorialN/ACovered the code with tests (note that PRs without tests will be REJECTED)N/AIn order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
Followed from #31327 (comment)
If you plan to squash this during merge, I would recommend making atleast 2 commits, one with 9201e8a, a90ebc0, 3abaaef and another with the rest
TODO
Should I add the commit(s) to a newOr, you could always add it in a new commit after merging thisgit-blame-ignore-revs
file? Depending on your merge workflow, the commit ids may change - so I want to confirm first.Should changes be made to the contribution guide and PR template? In other words, do we want to instruct devs to use pre-commit, or is it sufficient to rely on the CI?
If you wish for the changes to be applied automatically on PRs, you can revert the workflow and use https://pre-commit.ci instead. There are ways to do this with GH workflow too, but pre-commit.ci is a better solution
When creating a release workflow (e.g. Add build workflow #30644), I suggest adding a step with
pre-commit autoupdate
to itThe CI is expected to fail when there are new changes in master. Merging and committing with a
pre-commit run --all-files
will fix it.I'm not doing it rn sinceit'll have to be re-done after each commit to the master. Instead it makes sense to do it just once, before actually merging this