Skip to content

Commit 3fa27ae

Browse files
committed
add C4 and PERF rules
1 parent d46a1e1 commit 3fa27ae

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ line-ending = "lf"
123123

124124
[tool.ruff.lint]
125125
ignore = []
126-
select = ['A', 'B', 'D', 'E', 'F', 'G', 'I', 'LOG', 'NPY', 'PIE', 'PT', 'T20', 'UP', 'W']
126+
select = ['A', 'B', 'C4', 'D', 'E', 'F', 'G', 'I', 'LOG', 'NPY', 'PERF', 'PIE', 'PT', 'T20', 'UP', 'W']
127127

128128
[tool.ruff.lint.per-file-ignores]
129129
'*' = [

template/utils/_checks.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ def ensure_verbose(verbose: Any) -> int:
194194
verbose : int
195195
The verbosity level as an integer.
196196
"""
197-
logging_types = dict(
198-
DEBUG=logging.DEBUG,
199-
INFO=logging.INFO,
200-
WARNING=logging.WARNING,
201-
ERROR=logging.ERROR,
202-
CRITICAL=logging.CRITICAL,
203-
)
197+
logging_types = {
198+
"DEBUG": logging.DEBUG,
199+
"INFO": logging.INFO,
200+
"WARNING": logging.WARNING,
201+
"ERROR": logging.ERROR,
202+
"CRITICAL": logging.CRITICAL,
203+
}
204204

205205
check_type(verbose, (bool, str, "int-like", None), item_name="verbose")
206206

template/utils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _list_dependencies_info(
123123
if unicode:
124124
ljust += 1
125125

126-
not_found: list[Requirement] = list()
126+
not_found: list[Requirement] = []
127127
for dep in dependencies:
128128
if dep.name == package:
129129
continue

template/utils/logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class _LoggerFormatter(logging.Formatter):
105105
"""Format string syntax."""
106106

107107
# Format string syntax for the different Log levels
108-
_formatters = dict()
108+
_formatters = {}
109109
_formatters[logging.DEBUG] = logging.Formatter(
110110
fmt="[%(module)s:%(funcName)s:%(lineno)d] %(levelname)s: %(message)s "
111111
"(%(asctime)s)"

0 commit comments

Comments
 (0)