Skip to content
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

feat: Upgrade Python linting from flake8 to ruff #2815

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
pull_request:
branches: [ main ]
jobs:
Lint_Python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install --user ruff
- run: ruff --format=github --select="E,F,PLC,PLE,UP,W,YTT" --ignore="S101,UP031" --target-version=py37 .
Tests:
strategy:
fail-fast: false
Expand All @@ -33,15 +39,12 @@ jobs:
- name: Install Dependencies
run: |
npm install --no-progress
pip install flake8 pytest
pip install pytest
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Lint Python
if: startsWith(matrix.os, 'ubuntu')
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Run Python tests
run: python -m pytest
# - name: Run doctests with pytest
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/generator/eclipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import gyp.common
import gyp.msvs_emulation
import shlex
import xml.etree.cElementTree as ET
import xml.etree.ElementTree as ET

generator_wants_static_library_dependencies_adjusted = False

Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/xcodeproj_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,7 @@ def __init__(self, properties=None, id=None, parent=None, path=None):
self.path = path
self._other_pbxprojects = {}
# super
return XCContainerPortal.__init__(self, properties, id, parent)
XCContainerPortal.__init__(self, properties, id, parent)

def Name(self):
name = self.path
Expand Down