kubeflow / training-operator

Distributed ML Training and Fine-Tuning on Kubernetes
https://www.kubeflow.org/docs/components/training
Apache License 2.0
1.61k stars 700 forks source link

Add GitHub Actions Workflow for Python Code Formatting and Linting #2191

Closed Ygnas closed 3 months ago

Ygnas commented 3 months ago

What this PR does / why we need it:

This PR adds a GitHub Actions workflow for Python code formatting and linting. It uses black to enforce consistent code formatting and flake8 to check for linting issues. This ensures code quality and consistency in the Python codebase.

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

Fixes #1910

Checklist:

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign jeffwan for approval. For more information see the Kubernetes Code Review Process.

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

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

The new pre-commit hooks run black here. We haven't added a linter hook yet, but plan to. Would you like to implement that, @Ygnas?

droctothorpe commented 3 months ago

For reference: https://github.com/PyCQA/flake8/blob/main/.pre-commit-config.yaml#L33-L36

Ygnas commented 3 months ago

Closing this in favour of #2195 @droctothorpe @andreyvelich