Skip to content

Commit 4d8c3db

Browse files
Merge pull request #31 from GitHubSecurityLab/copilot/suppress-linter-errors
Suppress linter errors and re-enable linter check in CI
2 parents 896d3dd + cdcd22f commit 4d8c3db

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ jobs:
3434
run: pip install --upgrade hatch
3535

3636
- name: Run static analysis
37-
run: |
38-
# hatch fmt --check
39-
echo linter errors will be fixed in a separate PR
37+
run: hatch fmt --linter --check
4038

4139
- name: Run tests
4240
run: hatch test --python ${{ matrix.python-version }} --cover --randomize --parallel --retries 2 --retry-delay 1

pyproject.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,56 @@ exclude_lines = [
6060
"if __name__ == .__main__.:",
6161
"if TYPE_CHECKING:",
6262
]
63+
64+
[tool.ruff.lint]
65+
ignore = [
66+
"A001", # Variable name shadows a builtin
67+
"A002", # Argument name shadows a builtin
68+
"ARG001", # Unused function argument
69+
"B007", # Loop control variable not used within loop body
70+
"B008", # Do not perform function calls in argument defaults
71+
"BLE001", # Do not catch blind exception
72+
"C403", # Unnecessary list comprehension - rewrite as a set comprehension
73+
"C405", # Unnecessary list literal - rewrite as a set literal
74+
"E713", # Test for membership should be `not in`
75+
"EM102", # Exception must not use an f-string literal
76+
"F401", # Imported but unused
77+
"F541", # f-string without any placeholders
78+
"F841", # Local variable assigned but never used
79+
"FA100", # Missing `from __future__ import annotations`
80+
"FA102", # Missing `from __future__ import annotations` for `typing.Optional`
81+
"FBT001", # Boolean-typed positional argument in function definition
82+
"FBT002", # Boolean default positional argument in function definition
83+
"G004", # Logging statement uses f-string
84+
"I001", # Import block is un-sorted or un-formatted
85+
"INP001", # File is part of an implicit namespace package
86+
"LOG015", # `root` should be used instead of logger
87+
"N802", # Function name should be lowercase
88+
"PERF102", # Incorrect `dict` comprehension for combining two dicts
89+
"PERF401", # Use a list comprehension to create a transformed list
90+
"PIE810", # Call `startswith` once with a tuple
91+
"PLC0206", # Dict should be used instead of tuple
92+
"PLR1730", # Replace `if` statement with `min()`
93+
"PLR2004", # Magic value used in comparison
94+
"PLW0602", # Using global for variable but no assignment is done
95+
"PLW1508", # Invalid type for environment variable default
96+
"PLW1510", # `subprocess.run` without explicit `check` argument
97+
"RET504", # Unnecessary assignment before `return` statement
98+
"RET505", # Unnecessary `else` after `return` statement
99+
"RUF003", # Comment contains ambiguous character
100+
"RUF013", # PEP 484 prohibits implicit `Optional`
101+
"RUF015", # Prefer `next(iter())` over single element slice
102+
"S607", # Starting a process with a partial executable path
103+
"SIM101", # Use a ternary expression instead of if-else-block
104+
"SIM114", # Combine `if` branches using logical `or` operator
105+
"SIM117", # Use a single `with` statement with multiple contexts
106+
"SIM118", # Use `key in dict` instead of `key in dict.keys()`
107+
"SIM300", # Yoda condition detected
108+
"T201", # `print` found
109+
"TID252", # Prefer absolute imports over relative imports
110+
"TRY003", # Avoid specifying long messages outside the exception class
111+
"TRY300", # Consider moving this statement to an `else` block
112+
"UP032", # Use f-string instead of `format` call
113+
"W291", # Trailing whitespace
114+
"W293", # Blank line contains whitespace
115+
]

0 commit comments

Comments
 (0)