Skip to content

Commit

Permalink
[lint] resolve warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
apalala committed Mar 10, 2024
1 parent c85fddf commit 4aedb3e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 103 deletions.
13 changes: 8 additions & 5 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
line-length = 88

select = [
lint.select = [
"F", "E", "W", "UP",
"I", "YTT", "S", "B",
"COM", "C4", "SIM",
Expand All @@ -9,7 +9,7 @@ select = [
"PL", "PGH", "RET",
# "ERA", # commented out code
]
ignore = [
lint.ignore = [
# "C408", # unnecessary-collection-call
"E501", # line-too-long
"E741", # ambiguous-variable-name
Expand All @@ -28,10 +28,13 @@ ignore = [
"PLW3201", # bad-dunder-method-name
# "PTH123", # builtin-open
"RET505", # superfluous-else-return
"RUF022", # __all__ sorting
"RUF027", # possible f-string
"S102", # exec-builtin
# "S105", # hardcoded-password-string
"S301", # suspicious-pickle-usage
# "S311", # suspicious-non-cryptographic-random-usage
"S403", # insecure modules
"SIM108", # use ternary instead of if=else
"SIM115", # open-file-with-context-handler
"SIM114", # if-with-same-arms
Expand All @@ -42,11 +45,11 @@ exclude = []

target-version = "py312"

[per-file-ignores]
[lint.per-file-ignores]

[mccabe]
[lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

[pydocstyle]
[lint.pydocstyle]
convention = "numpy"
3 changes: 2 additions & 1 deletion tatsu/ast.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import copy
import operator
from functools import reduce

Expand Down Expand Up @@ -29,7 +30,7 @@ def set_parseinfo(self, value):
super().__setitem__('parseinfo', value)

def copy(self):
return self.__copy__() # pylint: disable=unnecessary-dunder-call
return copy.copy(self)

def asjson(self):
return asjson(self)
Expand Down
Loading

0 comments on commit 4aedb3e

Please sign in to comment.