-
Notifications
You must be signed in to change notification settings - Fork 27
Add a soundness check to lint Python files #14
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
Conversation
In preparation for swiftlang/github-workflows#14
In preparation for swiftlang/github-workflows#14
6460120
to
ac9d4de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@FranzBusch, please feel free to merge it once you’ve reviewed it. |
I just merged your other PR @ahoppen but now that I think about it again we might want to fold this into the Swift format PR after all. The reason why is that each new check here is producing a separate check on the repos. Now most repos don't have all the languages. It might be better to just have one general formatting job that does
|
I don’t have a strong personal opinion here: I think the advantages of having a single job are:
The disadvantages are:
@shahmishal What’s your opinion? |
Having checks for each lang format/lint makes it easier to figure out what failed. Normally people will ignore all of the green check marks and focus on failures. |
OK, sounds like we want to stick with separate jobs for each lint then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay let's proceed with this then. Just some naming nits to stay consistent
.github/workflows/soundness.yml
Outdated
@@ -59,6 +59,10 @@ on: | |||
type: boolean | |||
description: "Boolean to enable the YAML lint job. Defaults to true." | |||
default: true | |||
python_lint_enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python_lint_enabled: | |
python_lint_check_enabled: |
.github/workflows/soundness.yml
Outdated
@@ -59,6 +59,10 @@ on: | |||
type: boolean | |||
description: "Boolean to enable the YAML lint job. Defaults to true." | |||
default: true | |||
python_lint_enabled: | |||
type: boolean | |||
description: "Boolean to enable the Python lint job. Defaults to true." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: "Boolean to enable the Python lint job. Defaults to true." | |
description: "Boolean to enable the Python lint check job. Defaults to true." |
.github/workflows/soundness.yml
Outdated
@@ -200,3 +204,18 @@ jobs: | |||
run: | | |||
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/configs/yamllint.yml > /tmp/yamllint.yml | |||
yamllint --strict --config-file /tmp/yamllint.yml ${GITHUB_WORKSPACE} | |||
python-lint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python-lint: | |
python-lint-check: |
.github/workflows/soundness.yml
Outdated
@@ -200,3 +204,18 @@ jobs: | |||
run: | | |||
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/configs/yamllint.yml > /tmp/yamllint.yml | |||
yamllint --strict --config-file /tmp/yamllint.yml ${GITHUB_WORKSPACE} | |||
python-lint: | |||
name: Python lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: Python lint | |
name: Python lint check |
Should we go the opposite way and remove |
Discussed offline that we want to use |
persist-credentials: false | ||
- name: Run flake8 | ||
run: | | ||
pip3 install flake8 flake8-import-order --break-system-packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you may know, it seems that ubuntu-latest
on GitHub-hosted runners is currently in the process of migrating to Ubuntu 24.04. Until it's completed, Ubuntu 22.04 may be used, and on Ubuntu 22.04, this command will fail because its pip3
is old and does not have --break-system-packages
.
Announcement: actions/runner-images#10636
Failure case: https://github.com/kkebo/swift-format/actions/runs/11299915833/job/31431847497
Since the migration will be completed soon, I think we can ignore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixed it: #28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
No description provided.