Skip to content

Commit a727f5a

Browse files
committed
Enabled ruff PGH ruleset for pygrep-hooks
In the process removed a lot of file header noqa stuff which was preventing ruff from working properly in those files which dated back to flake8. Then fixed any issues in those files.
1 parent 7f824e2 commit a727f5a

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

plugins/ext_test/tasks.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#
2-
# coding=utf-8
3-
# flake8: noqa E302
41
"""Development related tasks to be run with 'invoke'.
52
63
Make sure you satisfy the following Python module requirements if you are trying to publish a release to PyPI:
@@ -205,7 +202,7 @@ def lint(context):
205202

206203

207204
@invoke.task
208-
def format(context):
205+
def format(context): # noqa: A001
209206
"""Run ruff format --check"""
210207
with context.cd(TASK_ROOT_STR):
211208
context.run("ruff format --check")

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ select = [
193193
"NPY", # NumPy specific rules
194194
"PD", # pandas-vet (Pandas specific rules)
195195
"PERF", # Perflint (warn about performance issues)
196-
# "PGH", # pygrep-hooks (force specific rule codes when ignoring type or linter issues on a line)
196+
"PGH", # pygrep-hooks (force specific rule codes when ignoring type or linter issues on a line)
197197
# "PIE", # flake8-pie (eliminate unnecessary use of pass, range starting at 0, etc.)
198198
"PLC", # Pylint Conventions
199199
"PLE", # Pylint Errors
@@ -274,12 +274,12 @@ per-file-ignores."plugins/*.py" = [
274274
"INP001", # Module is part of an implicit namespace
275275
]
276276

277-
per-file-ignores."tests/pyscript/*.py" = [
278-
"F821", # Undefined name `app`
279-
"INP001", # Module is part of an implicit namespace
277+
per-file-ignores."tests/*.py" = [
278+
"E501", # Line too long
280279
]
281280

282-
per-file-ignores."tests/pyscript/raises_exception.py" = [
281+
per-file-ignores."tests/pyscript/*.py" = [
282+
"F821", # Undefined name `app`
283283
"INP001", # Module is part of an implicit namespace
284284
]
285285

tests/test_utils_defining_class.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def child_function(self):
2525
def lambda1():
2626
return 1
2727

28-
lambda2 = (lambda: lambda: 2)()
28+
def lambda2():
29+
return 2
2930

3031
@classmethod
3132
def class_method(cls):

0 commit comments

Comments
 (0)