kubeflow / katib

Automated Machine Learning on Kubernetes
https://www.kubeflow.org/docs/components/katib
Apache License 2.0
1.51k stars 443 forks source link

Enhance pre-commit hooks with flake8 and black #2407

Closed Ygnas closed 3 months ago

Ygnas commented 3 months ago

What this PR does / why we need it: This PR implements the flake8 linter and black formatting as a pre-commit hook to ensure code quality and adherence to style guidelines.

Which issue(s) this PR fixes _(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged)_: Fixes #

Checklist:

Not sure if I there is a need to exclude something else in the pre-commit config??. If it should be please let me know

google-oss-prow[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tenzen-y

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubeflow/katib/blob/master/OWNERS)~~ [tenzen-y] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
helenxie-bit commented 3 months ago

@Ygnas Thank you for your contribution! I'm trying to update a PR (https://github.com/kubeflow/katib/pull/2393), and the new pre-commit check is working. However, it looks like there's an issue with the compatibility between the isort and black checks. Specifically, I've run "pre-commit run --all-files" locally, but the isort and black checks keep failing for "katib_client.py". It seems that this is because the pre-commit configuration is using the --profile google argument with isort, which has a different style than black. Could you please take a look into this issue?