Skip to content

Commit f1efd11

Browse files
committed
Switch to ruff:ignore
1 parent 699cc5c commit f1efd11

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

pycparserext/ext_c_lexer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
class GnuCLexer(CLexerBase):
5050
"""GNU C lexer that recognizes GNU-specific keywords."""
5151

52-
_extra_keywords = {**_COMMON_EXTRA_KEYWORDS, **_GNU_EXTRA_KEYWORDS} # noqa: RUF012
52+
_extra_keywords = {**_COMMON_EXTRA_KEYWORDS, **_GNU_EXTRA_KEYWORDS} # ruff:ignore[mutable-class-default]
5353

5454
def token(self):
5555
tok = super().token()
@@ -72,7 +72,7 @@ class OpenCLCLexer(CLexerBase):
7272
"""OpenCL C lexer that recognizes OpenCL-specific keywords and line
7373
comments."""
7474

75-
_extra_keywords = {**_COMMON_EXTRA_KEYWORDS, **_OCL_EXTRA_KEYWORDS} # noqa: RUF012
75+
_extra_keywords = {**_COMMON_EXTRA_KEYWORDS, **_OCL_EXTRA_KEYWORDS} # ruff:ignore[mutable-class-default]
7676

7777
def token(self):
7878
tok = super().token()

pycparserext/ext_c_parser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,9 @@ def _parse_struct_declaration(self):
710710

711711

712712
class GnuCParser(_AsmAndAttributesMixin, CParserBase):
713-
from pycparserext.ext_c_lexer import GnuCLexer as lexer_class # noqa
713+
from pycparserext.ext_c_lexer import (
714+
GnuCLexer as lexer_class, # ruff:ignore[camelcase-imported-as-lowercase]
715+
)
714716

715717
initial_type_symbols = frozenset({"__builtin_va_list"})
716718

@@ -1124,7 +1126,9 @@ def _parse_designator(self):
11241126

11251127

11261128
class OpenCLCParser(_AsmAndAttributesMixin, CParserBase):
1127-
from pycparserext.ext_c_lexer import OpenCLCLexer as lexer_class # noqa
1129+
from pycparserext.ext_c_lexer import (
1130+
OpenCLCLexer as lexer_class, # ruff:ignore[camelcase-imported-as-lowercase]
1131+
)
11281132

11291133
INT_BIT_COUNTS = (8, 16, 32, 64)
11301134
initial_type_symbols = (

pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ include = [
3737
preview = true
3838

3939
[tool.ruff.lint.per-file-ignores]
40-
"test/*.py" = ["S102"]
41-
"doc/conf.py" = ["S102"]
40+
"test/*.py" = ["exec-builtin"]
41+
"doc/conf.py" = ["exec-builtin"]
4242

4343
[tool.ruff.lint]
4444
extend-select = [
@@ -57,13 +57,13 @@ extend-select = [
5757
]
5858
extend-ignore = [
5959
"C90", # McCabe complexity
60-
"E221", # multiple spaces before operator
61-
"E226", # missing whitespace around arithmetic operator
62-
"E402", # module-level import not at top of file
63-
"UP006", # updated annotations due to __future__ import
64-
"UP007", # updated annotations due to __future__ import
65-
"UP031", # use f-strings instead of %
66-
"UP032", # use f-strings instead of .format
60+
"multiple-spaces-before-operator",
61+
"missing-whitespace-around-arithmetic-operator",
62+
"module-import-not-at-top-of-file",
63+
"non-pep585-annotation",
64+
"non-pep604-annotation-union",
65+
"printf-string-formatting",
66+
"f-string",
6767
]
6868
[tool.ruff.lint.flake8-quotes]
6969
docstring-quotes = "double"

0 commit comments

Comments
 (0)