-
Notifications
You must be signed in to change notification settings - Fork 166
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
ci: restrict Python linting runs #3301
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
name: Lint | ||
name: Lint Python | ||
on: | ||
push: | ||
branches-ignore: | ||
- "dependabot/*" | ||
paths: | ||
- '**/*.py' | ||
- '.flake8' | ||
- .github/workflows/lint-python.yml | ||
pull_request: | ||
paths: | ||
- '**/*.py' | ||
- '.flake8' | ||
- .github/workflows/lint-python.yml | ||
jobs: | ||
Python: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.7 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cclauss I didn't think the Python need to be pinned for the linting job, but correct me if i'm wrong There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the warnings that appear under the twisty for this GitHub Action job step:
This ended up with Python 3.8. Explicit is better than implicit (The Zen of Python) Flake8 changes based on the Python that it is run on. https://flake8.pycqa.org
Ruff does not run on Python so it changes in similar ways but only based on |
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
# pip install -r requirements.txt # TODO: Add tap2junit | ||
pip install flake8 | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
flake8 --version | ||
flake8 . |
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.
Node.js has Python files that do not have a .py suffix.
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.
In this repo?