Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pycparserext/ext_c_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
class GnuCLexer(CLexerBase):
"""GNU C lexer that recognizes GNU-specific keywords."""

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

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

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

def token(self):
tok = super().token()
Expand Down
8 changes: 6 additions & 2 deletions pycparserext/ext_c_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,9 @@ def _parse_struct_declaration(self):


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

initial_type_symbols = frozenset({"__builtin_va_list"})

Expand Down Expand Up @@ -1124,7 +1126,9 @@ def _parse_designator(self):


class OpenCLCParser(_AsmAndAttributesMixin, CParserBase):
from pycparserext.ext_c_lexer import OpenCLCLexer as lexer_class # noqa
from pycparserext.ext_c_lexer import (
OpenCLCLexer as lexer_class, # ruff:ignore[camelcase-imported-as-lowercase]
)

INT_BIT_COUNTS = (8, 16, 32, 64)
initial_type_symbols = (
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ include = [
preview = true

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

[tool.ruff.lint]
extend-select = [
Expand All @@ -57,13 +57,13 @@ extend-select = [
]
extend-ignore = [
"C90", # McCabe complexity
"E221", # multiple spaces before operator
"E226", # missing whitespace around arithmetic operator
"E402", # module-level import not at top of file
"UP006", # updated annotations due to __future__ import
"UP007", # updated annotations due to __future__ import
"UP031", # use f-strings instead of %
"UP032", # use f-strings instead of .format
"multiple-spaces-before-operator",
"missing-whitespace-around-arithmetic-operator",
"module-import-not-at-top-of-file",
"non-pep585-annotation",
"non-pep604-annotation-union",
"printf-string-formatting",
"f-string",
]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
Expand Down
Loading