Skip to content
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

migrate style check to precommit #3111

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from

Conversation

Borda
Copy link
Contributor

@Borda Borda commented Jan 29, 2024

Issue #, if available: #2637 partially

Description of changes: moving some style checks to common pre-commit, which can be efficiently run by the developer locally and also for PR runs only on the diff, not the full project, so the iteration shall be much faster... In addition, a bot can be installed to this repository that may send some automated fixes related to the open PR so a developer will not think about styles too much 🦩

BTW, it would be good to migrate also the just license so the whole workflow can be dropped

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

cc: @jaheba @kashif @lostella kind ling as it seems there are no revivers by default 🐿️

Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

@lostella
Copy link
Contributor

lostella commented Feb 1, 2024

@Borda the style check workflow is pretty quick compared to tests, I think?

@Borda
Copy link
Contributor Author

Borda commented Feb 1, 2024

the style check workflow is pretty quick compared to tests, I think?

@lostella, that is true, but with pre-commit, you can run it locally and only on changed files compared to relying on validation after pushing or calling several commands as it is in the job on whole codebase

@lostella lostella added the CI This item concerns continuous integration label Feb 2, 2024
@kashif
Copy link
Contributor

kashif commented Feb 17, 2024

@Borda lets move to ruff instead of black? for fix and format

@Borda
Copy link
Contributor Author

Borda commented Feb 17, 2024

@Borda lets move to ruff instead of black? for fix and format

Sure, happy to do it.
Just thought to make this 1:1 chance and additional improvement in next PR, what do you think @kashif?

@kashif
Copy link
Contributor

kashif commented Feb 17, 2024

sounds good!

@Borda
Copy link
Contributor Author

Borda commented Feb 19, 2024

@jaheba @lostella is there anything else I could do for this PR? 🐿️

This merge would also mean updating required checks for future PR...

@lostella
Copy link
Contributor

@Borda I think it's fine to have pre-commit hooks, but maybe we leave the github workflows untouched for now? We can always remove them later if we believe it's the way to go. But I think having the workflow active in the repo is a clear reference on what checks the code is expected to pass.

@Borda
Copy link
Contributor Author

Borda commented Feb 20, 2024

maybe we leave the github workflows untouched for now?

Sure, we'll put them back, just if I may suggest, lest mark them as not required and make the pre-commit bot required; what do you think?

well we can also have the commit running locally so if any outage it will hold
https://github.com/marketplace/actions/pre-commit

@Borda
Copy link
Contributor Author

Borda commented Feb 20, 2024

@lostella noticed that probably lints did not have a fixed version, so it could run anytime in the future with different changes... so the precommit config fixes that and guarantees reproducibility...

anyway is it fine if I run the formating and fix issues as part of this PR? #3130 and #3131

lostella pushed a commit that referenced this pull request Apr 5, 2024
*Issue #, if available:*
set a single black version to ensure reproducibility
UPDATE: seem that the latest Black would need to be applied

*Description of changes:*
freeze Black version, but the better way is in #3111


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.


**Please tag this pr with at least one of these labels to make our
release process faster:** BREAKING, new feature, bug fix, other change,
dev setup

cc: @jaheba @kashif @lostella
.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
lostella added a commit that referenced this pull request May 7, 2024
*Issue #, if available:*
`dofformatter` gave a false positive signal; it has lots of issues, but
as `--check` was missing, it just fixed without any real code change and
so passed green even if it failed, see for example
https://github.com/awslabs/gluonts/actions/runs/7975893111/job/21775154024?pr=3130

*Description of changes:*

validation of the actual Ruff & Docfroatter on the latest codebase


**Please tag this pr with at least one of these labels to make our
release process faster:**
this is just fixing the actual linting issue, but the better and ext
step shall be #3111

cc: @jaheba @kashif @lostella

---------

Co-authored-by: Lorenzo Stella <lorenzostella@gmail.com>
.pre-commit-config.yaml Outdated Show resolved Hide resolved
@Borda
Copy link
Contributor Author

Borda commented May 7, 2024

@lostella, this is one now ready for review too 🎏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI This item concerns continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants