Skip to content

Commit d877ea9

Browse files
committed
add lint config
1 parent 66f5a81 commit d877ea9

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.flake8

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 100
3+
extend-ignore = E221,E501

pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ dependencies = [
6666
]
6767

6868
[tool.hatch.envs.lint.scripts]
69+
lint = [
70+
"- flake8 src/lambda_repl",
71+
"- pylint src/lambda_repl"
72+
]
6973
typecheck = "mypy -p lambda_repl"
7074
release = [
7175
"typecheck"
@@ -85,6 +89,9 @@ warn_unused_ignores = true
8589
warn_return_any = true
8690
warn_unreachable = true
8791

92+
[tool.pylint]
93+
max-line-length = 100
94+
8895
[tool.coverage.run]
8996
source_pkgs = ["lambda_repl"]
9097
branch = true

src/lambda_repl/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def import_term(self, location: str) -> Term[str] | None:
5757
module, _, name = location.strip().rpartition(".")
5858
try:
5959
term = getattr(import_module(module), name)
60-
except Exception as error:
60+
except Exception as error: # pylint: disable=W0718
6161
self.stdout.write(f"Error while importing: {error}\n")
6262
return None
6363
if not isinstance(term, Term):

src/lambda_repl/parsing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def transform_string(self, string: str) -> Term[str]:
5555
case Token(type="VARIABLE") as name: # type: ignore
5656
return self.VARIABLE(name) # type: ignore
5757
case Token() as token: # type: ignore
58-
raise UnexpectedToken(token, {"VARIABLE",})
58+
raise UnexpectedToken(token, {"VARIABLE", })
5959
case tree:
6060
return self.transform(tree)
6161

0 commit comments

Comments
 (0)