Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#41)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)
- [github.com/pycqa/flake8: 6.1.0 → 7.0.0](PyCQA/flake8@6.1.0...7.0.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Bump deps

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: S. Co1 <sco1.git@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and sco1 committed Feb 6, 2024
1 parent 017c1a2 commit c35567f
Show file tree
Hide file tree
Showing 7 changed files with 333 additions and 360 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pycqa/isort
Expand All @@ -12,7 +12,7 @@ repos:
- id: isort
name: isort
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
585 changes: 295 additions & 290 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions pylox/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ def __str__(self) -> str:
return f"{type(self).__name__}: {self.message}"


class LoxPreProcessorError(LoxException):
...
class LoxPreProcessorError(LoxException): ... # noqa: E701


class LoxSyntaxError(LoxException):
...
class LoxSyntaxError(LoxException): ... # noqa: E701


class LoxParseError(LoxException):
Expand Down Expand Up @@ -52,10 +50,8 @@ def __init__(self, value: t.Any) -> None:


class LoxBreakError(LoxRuntimeError):
def __init__(self) -> None:
...
def __init__(self) -> None: ...


class LoxContinueError(LoxRuntimeError):
def __init__(self) -> None:
...
def __init__(self) -> None: ...
12 changes: 4 additions & 8 deletions pylox/protocols/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@


class LoxInterpreterProtocol(t.Protocol): # pragma: no cover
def report_error(self, err: LoxException) -> None:
...
def report_error(self, err: LoxException) -> None: ...

def report_runtime_error(self, err: LoxRuntimeError) -> None:
...
def report_runtime_error(self, err: LoxRuntimeError) -> None: ...


class SourceInterpreterProtocol(t.Protocol): # pragma: no cover
globals: Environment
_interp: LoxInterpreterProtocol

def _execute_block(self, statements: list[grammar.Stmt], environment: Environment) -> None:
...
def _execute_block(self, statements: list[grammar.Stmt], environment: Environment) -> None: ...

def resolve(self, expr: grammar.Expr, depth: int) -> None:
...
def resolve(self, expr: grammar.Expr, depth: int) -> None: ...
3 changes: 1 addition & 2 deletions pylox/protocols/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@


class BoolEq(t.Protocol):
def __eq__(self, other: object) -> bool:
...
def __eq__(self, other: object) -> bool: ...
69 changes: 23 additions & 46 deletions pylox/protocols/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,71 +7,48 @@


class VisitorProtocol(t.Protocol):
def visit_Assign(self, expr: grammar.Assign) -> t.Any:
...
def visit_Assign(self, expr: grammar.Assign) -> t.Any: ...

def visit_Binary(self, expr: grammar.Binary) -> t.Any:
...
def visit_Binary(self, expr: grammar.Binary) -> t.Any: ...

def visit_Call(self, expr: grammar.Call) -> t.Any:
...
def visit_Call(self, expr: grammar.Call) -> t.Any: ...

def visit_Get(self, expr: grammar.Get) -> t.Any:
...
def visit_Get(self, expr: grammar.Get) -> t.Any: ...

def visit_Grouping(self, expr: grammar.Grouping) -> t.Any:
...
def visit_Grouping(self, expr: grammar.Grouping) -> t.Any: ...

def visit_Literal(self, expr: grammar.Literal) -> t.Any:
...
def visit_Literal(self, expr: grammar.Literal) -> t.Any: ...

def visit_Logical(self, expr: grammar.Logical) -> t.Any:
...
def visit_Logical(self, expr: grammar.Logical) -> t.Any: ...

def visit_Set(self, expr: grammar.Set) -> t.Any:
...
def visit_Set(self, expr: grammar.Set) -> t.Any: ...

def visit_Super(self, expr: grammar.Super) -> t.Any:
...
def visit_Super(self, expr: grammar.Super) -> t.Any: ...

def visit_This(self, expr: grammar.This) -> t.Any:
...
def visit_This(self, expr: grammar.This) -> t.Any: ...

def visit_Unary(self, expr: grammar.Unary) -> t.Any:
...
def visit_Unary(self, expr: grammar.Unary) -> t.Any: ...

def visit_Variable(self, expr: grammar.Variable) -> t.Any:
...
def visit_Variable(self, expr: grammar.Variable) -> t.Any: ...

def visit_Block(self, expr: grammar.Block) -> t.Any:
...
def visit_Block(self, expr: grammar.Block) -> t.Any: ...

def visit_Class(self, expr: grammar.Class) -> t.Any:
...
def visit_Class(self, expr: grammar.Class) -> t.Any: ...

def visit_Expression(self, expr: grammar.Expression) -> t.Any:
...
def visit_Expression(self, expr: grammar.Expression) -> t.Any: ...

def visit_Function(self, expr: grammar.Function) -> t.Any:
...
def visit_Function(self, expr: grammar.Function) -> t.Any: ...

def visit_If(self, expr: grammar.If) -> t.Any:
...
def visit_If(self, expr: grammar.If) -> t.Any: ...

def visit_Var(self, expr: grammar.Var) -> t.Any:
...
def visit_Var(self, expr: grammar.Var) -> t.Any: ...

def visit_Return(self, expr: grammar.Return) -> t.Any:
...
def visit_Return(self, expr: grammar.Return) -> t.Any: ...

def visit_Print(self, expr: grammar.Print) -> t.Any:
...
def visit_Print(self, expr: grammar.Print) -> t.Any: ...

def visit_While(self, expr: grammar.While) -> t.Any:
...
def visit_While(self, expr: grammar.While) -> t.Any: ...

def visit_Break(self, expr: grammar.Break) -> t.Any:
...
def visit_Break(self, expr: grammar.Break) -> t.Any: ...

def visit_Continue(self, expr: grammar.Continue) -> t.Any:
...
def visit_Continue(self, expr: grammar.Continue) -> t.Any: ...
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ rich = "^13.0"
typer = "^0.7"

[tool.poetry.dev-dependencies]
black = "^23.1"
black = "^24.1"
bump2version = "^1.0"
flake8 = "^6.0"
flake8 = "^7.0"
flake8-annotations = "^3.0"
flake8-bugbear = "^23.1"
flake8-bugbear = "^24.1"
flake8-docstrings = "^1.7"
flake8-fixme = "^1.1"
isort = "^5.12"
mypy = "^1.0"
pep8-naming = "^0.13"
pre-commit = "^3.0"
pytest = "^7.2"
pytest = "^8.0"
pytest-check = "^2.1"
pytest-cov = "^4.0"
pytest-randomly = "^3.12"
Expand Down

0 comments on commit c35567f

Please sign in to comment.