diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..e30e003 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 100 +extend-ignore = E221,E501 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index baa666e..787838f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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 diff --git a/src/lambda_repl/__init__.py b/src/lambda_repl/__init__.py index de6e4ad..8719a70 100644 --- a/src/lambda_repl/__init__.py +++ b/src/lambda_repl/__init__.py @@ -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): diff --git a/src/lambda_repl/parsing.py b/src/lambda_repl/parsing.py index 0b521da..4f8ab12 100644 --- a/src/lambda_repl/parsing.py +++ b/src/lambda_repl/parsing.py @@ -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)