Skip to content

Commit

Permalink
add lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
Deric-W committed Feb 7, 2024
1 parent 66f5a81 commit d877ea9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 100
extend-ignore = E221,E501
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ dependencies = [
]

[tool.hatch.envs.lint.scripts]
lint = [
"- flake8 src/lambda_repl",
"- pylint src/lambda_repl"
]
typecheck = "mypy -p lambda_repl"
release = [
"typecheck"
Expand All @@ -85,6 +89,9 @@ warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true

[tool.pylint]
max-line-length = 100

[tool.coverage.run]
source_pkgs = ["lambda_repl"]
branch = true
Expand Down
2 changes: 1 addition & 1 deletion src/lambda_repl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def import_term(self, location: str) -> Term[str] | None:
module, _, name = location.strip().rpartition(".")
try:
term = getattr(import_module(module), name)
except Exception as error:
except Exception as error: # pylint: disable=W0718
self.stdout.write(f"Error while importing: {error}\n")
return None
if not isinstance(term, Term):
Expand Down
2 changes: 1 addition & 1 deletion src/lambda_repl/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def transform_string(self, string: str) -> Term[str]:
case Token(type="VARIABLE") as name: # type: ignore
return self.VARIABLE(name) # type: ignore
case Token() as token: # type: ignore
raise UnexpectedToken(token, {"VARIABLE",})
raise UnexpectedToken(token, {"VARIABLE", })
case tree:
return self.transform(tree)

Expand Down

0 comments on commit d877ea9

Please sign in to comment.