-
-
Notifications
You must be signed in to change notification settings - Fork 403
[skip changelog] Sync "Check Python" CI workflow with template #1393
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
# TODO: move this to pyproject.toml when supported: https://gitlab.com/pycqa/flake8/merge_requests/245 | ||
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python/.flake8 | ||
# See: https://flake8.pycqa.org/en/latest/user/configuration.html | ||
# The code style defined in this file is the official standardized style to be used in all Arduino tooling projects and | ||
# should not be modified. | ||
|
||
[flake8] | ||
max-line-length = 120 | ||
doctests = True | ||
ignore = | ||
E741, | ||
# W503 and W504 are mutually exclusive, so one or the other must be ignored. | ||
# PEP 8 recommends line break before, so we keep W504. | ||
# W503 and W504 are mutually exclusive. PEP 8 recommends line break before. | ||
W503 | ||
max-complexity = 10 | ||
max-line-length = 120 | ||
select = E,W,F,C,N |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-python-task.md | ||
name: Check Python | ||
|
||
env: | ||
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python | ||
PYTHON_VERSION: "3.9" | ||
|
||
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/check-python-task.ya?ml" | ||
- "**/.flake8" | ||
- "**/poetry.lock" | ||
- "**/pyproject.toml" | ||
- "**/setup.cfg" | ||
- "Taskfile.ya?ml" | ||
- "**/tox.ini" | ||
- "**.py" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/check-python-task.ya?ml" | ||
- "**/.flake8" | ||
- "**/poetry.lock" | ||
- "**/pyproject.toml" | ||
- "**/setup.cfg" | ||
- "Taskfile.ya?ml" | ||
- "**/tox.ini" | ||
- "**.py" | ||
workflow_dispatch: | ||
repository_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install Poetry | ||
run: pip install poetry | ||
|
||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
version: 3.x | ||
|
||
- name: Run flake8 | ||
uses: liskin/gh-problem-matcher-wrap@v1 | ||
with: | ||
linters: flake8 | ||
run: task python:lint | ||
|
||
formatting: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install Poetry | ||
run: pip install poetry | ||
|
||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
version: 3.x | ||
|
||
- name: Format Python code | ||
run: task python:format | ||
|
||
- name: Check formatting | ||
run: git diff --color --exit-code |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@per1234 apparently this was left behind, If it's ok for you, I can open a new PR and fix this
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.
Thanks!