Skip to content

Commit 71a910e

Browse files
authored
Lint Python: Ignore ruff rule PLC0415 (#3195)
https://docs.astral.sh/ruff/rules/import-outside-top-level There are several valid reasons for conditionally importing Python modules, especially for OS-specific code, so let's intentionally ignore this rule. % `ruff check --select=PLC0415` ``` Error: gyp/pylib/gyp/MSVSVersion.py:222:5: PLC0415 `import` should be at the top-level of a file Error: gyp/pylib/gyp/__init__.py:492:9: PLC0415 `import` should be at the top-level of a file Error: gyp/pylib/gyp/generator/make.py:81:9: PLC0415 `import` should be at the top-level of a file Error: gyp/pylib/gyp/generator/ninja.py:1998:9: PLC0415 `import` should be at the top-level of a file Error: gyp/pylib/gyp/generator/ninja.py:2021:9: PLC0415 `import` should be at the top-level of a file Error: gyp/pylib/gyp/generator/ninja.py:2091:9: PLC0415 `import` should be at the top-level of a file Error: gyp/pylib/gyp/mac_tool.py:145:9: PLC0415 `import` should be at the top-level of a file Error: gyp/test_gyp.py:151:9: PLC0415 `import` should be at the top-level of a file Error: gyp/test_gyp.py:157:9: PLC0415 `import` should be at the top-level of a file ```
1 parent 27f5505 commit 71a910e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v5
2121
- uses: astral-sh/ruff-action@v3
2222
with:
23-
args: "check --select=E,F,PLC,PLE,UP,W,YTT --ignore=E721,PLC0206,PLC1901,S101,UP031 --target-version=py39"
23+
args: "check --select=E,F,PLC,PLE,UP,W,YTT --ignore=E721,PLC0206,PLC0415,PLC1901,S101,UP031 --target-version=py39"
2424

2525
lint-js:
2626
name: Lint JS

0 commit comments

Comments
 (0)