diff --git a/make.ps1 b/make.ps1 index 2cbed8e..cde9f53 100644 --- a/make.ps1 +++ b/make.ps1 @@ -46,9 +46,9 @@ function Invoke-Upgrade-Deps function Invoke-Lint { pre-commit run --all-files - python -m ruff --fix . + python -m ruff check --fix . python -m ruff format . - python -m mypy src/ + python -m mypy --strict src/ } function Invoke-Test diff --git a/pyproject.toml b/pyproject.toml index 704b23f..6f7ae91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ license = { text = "MIT" } readme = "README.md" requires-python = ">=3.12,<3.13" dependencies = [ - "typer==0.9.0" + "typer==0.12.3" ] [project.urls] @@ -21,18 +21,18 @@ bpp = "bpp.cli:app" [project.optional-dependencies] dev = [ - "pre-commit==3.6.1", - "ruff==0.2.1", - "mypy==1.8.0", + "pre-commit==3.7.1", + "ruff==0.4.10", + "mypy==1.10.0", ] tests = [ - "pytest==8.0.0", + "pytest==8.2.1", "pytest-randomly==3.15.0", ] docs = [ - "sphinx==7.2.6", - "furo==2024.1.29", - "sphinx-autoapi==3.0.0", + "sphinx==7.3.7", + "furo==2024.5.6", + "sphinx-autoapi==3.1.1", "releases==2.1.1", ] @@ -47,7 +47,9 @@ target-version = "py312" line-length = 120 [tool.ruff.lint] -select = ["ALL"] +select = [ + "ALL", +] ignore = [ "CPY001", # (Missing copyright notice at top of file) - No license ] diff --git a/src/bpp/interpreter.py b/src/bpp/interpreter.py index b69045e..a0299e5 100644 --- a/src/bpp/interpreter.py +++ b/src/bpp/interpreter.py @@ -91,7 +91,7 @@ def get_input(self: Self) -> None: """Output the ASCII value of the byte at the current position.""" self.memory[self.current_position] = ord(sys.stdin.read(1)) - def handle_token(self: Self, token: Token) -> ResultState: + def handle_token(self: Self, token: Token) -> ResultState: # noqa: C901 """Handle a single token.""" match token: case Token.INCREMENT_POINTER: diff --git a/tests/test_example_files.py b/tests/test_example_files.py index 09a02ef..bee1eb8 100644 --- a/tests/test_example_files.py +++ b/tests/test_example_files.py @@ -24,7 +24,7 @@ def test_example_files(example_file: Path, expected_result: str) -> None: def test_example_files_with_input(monkeypatch) -> None: # noqa: ANN001 -- pytest builtin fixture """Test example files with input.""" - source = Path("./examples/echo.bf").read_text() + source = Path("./examples/echo.bf").read_text(encoding="locale") monkeypatch.setattr("sys.stdin", StringIO("a")) interpreter = Interpreter() assert interpreter.run(source) == "a"