Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 18, 2024
1 parent c1174b3 commit 2c6d286
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 99 deletions.
12 changes: 4 additions & 8 deletions reiz/ir/backends/base.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
class IRObject:
...
class IRObject: ...


class Unit(IRObject):
...
class Unit(IRObject): ...


class Expression(IRObject):
...
class Expression(IRObject): ...


class Statement(IRObject):
...
class Statement(IRObject): ...
6 changes: 2 additions & 4 deletions reiz/ir/backends/edgeql.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ def sequence_view(
self.view(delimiter)


class EQL(base.IRObject):
...
class EQL(base.IRObject): ...


class Unit(EQL, base.Unit):
...
class Unit(EQL, base.Unit): ...


class Statement(EQL, base.Statement):
Expand Down
6 changes: 2 additions & 4 deletions reiz/ir/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
_IR_BUILDERS = {}


class IRError(Exception):
...
class IRError(Exception): ...


class UnsupportedOperation(IRError):
...
class UnsupportedOperation(IRError): ...


class IRBuilder:
Expand Down
21 changes: 7 additions & 14 deletions reiz/reizql/parser/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,28 @@
from reiz.utilities import ReizEnum, singleton


class RQL:
...
class RQL: ...


class Unit(RQL):
...
class Unit(RQL): ...


class Statement(RQL):
...
class Statement(RQL): ...


class Expression(RQL):
...
class Expression(RQL): ...


@singleton
class Ignore(Expression):
...
class Ignore(Expression): ...


@singleton
class Expand(Expression):
...
class Expand(Expression): ...


@singleton
class Cease(Expression):
...
class Cease(Expression): ...


class LogicOperator(Unit, ReizEnum):
Expand Down
3 changes: 1 addition & 2 deletions reiz/schema/builders/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class SchemaError(Exception):
...
class SchemaError(Exception): ...


class BaseSchemaGenerator:
Expand Down
3 changes: 1 addition & 2 deletions reiz/serialization/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ class Insertion(ReizEnum):
INSERTED = auto()


class Statistics(Counter):
...
class Statistics(Counter): ...
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ long_description_content_type = text/markdown
url = https://github.com/isidentical/reizio
author = isidentical
author_email = isidentical@gmail.com
license_file = LICENSE.txt
license_files = LICENSE.txt
classifiers =
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Expand Down
36 changes: 12 additions & 24 deletions tests/dataset/complex/complex_lists.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@foo # reiz: tp
def something():
@bar(baz(quux), foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -12,8 +11,7 @@ def something():
@foo
def something():
@bar(baz(quux), foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -25,8 +23,7 @@ def something():
@foo.bar
def something():
@bar(baz(quux), foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -36,8 +33,7 @@ def something():
@foo
def something():
@bar(baz(quux, quux), foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -47,8 +43,7 @@ def something():
@foo
def something():
@bar(baz(quux), foo, bar)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -58,8 +53,7 @@ def something():
@foo
def something():
@bar(baz(), foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -69,8 +63,7 @@ def something():
@foo
def something():
@bar(foo, foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -80,8 +73,7 @@ def something():
@foo
def something():
@bar
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -91,8 +83,7 @@ def something():
@foo
def something():
@bar(baz(quux), foo)
class something:
...
class something: ...

if foo:
for bar in baz:
Expand All @@ -102,8 +93,7 @@ class something:
@foo
def something():
@bar(baz(quux), foo)
def something():
...
def something(): ...

while True:
for bar in baz:
Expand All @@ -113,8 +103,7 @@ def something():
@foo
def something():
@bar(baz(quux), foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand All @@ -124,8 +113,7 @@ def something():
@foo
def something():
@bar(baz(quux), foo)
def something():
...
def something(): ...

if foo:
for bar in baz:
Expand Down
15 changes: 5 additions & 10 deletions tests/dataset/complex/nested_list.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
class T: # reiz: tp
@classmethod
def _():
...
def _(): ...


class Z: # reiz: tp
@classmethod
def _():
...
def _(): ...


class Q:
def _():
...
def _(): ...

@classmethod
def __():
...
def __(): ...


class Q:
@staticmethod
def _():
...
def _(): ...
6 changes: 2 additions & 4 deletions tests/dataset/simple/annotated_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ def foo():
pass


async def foo() -> List[str]:
...
async def foo() -> List[str]: ...


async def foo():
...
async def foo(): ...
3 changes: 1 addition & 2 deletions tests/dataset/simple/any_number_of_stmts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def baz(): # reiz: tp
pass


class T:
...
class T: ...


a = 1
Expand Down
9 changes: 3 additions & 6 deletions tests/dataset/simple/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@ def quux(something_else, /, bar):
pass


def empty():
...
def empty(): ...


def maybe(*bar, **baz):
...
def maybe(*bar, **baz): ...


def only(bar, /):
print(3)


def only(*, baz):
...
def only(*, baz): ...
9 changes: 3 additions & 6 deletions tests/dataset/simple/caseless_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ def a1FOOxxx(): # reiz: tp
...


def b1foo():
...
def b1foo(): ...


def b1FOO():
...
def b1FOO(): ...


def xaFOO():
...
def xaFOO(): ...
6 changes: 2 additions & 4 deletions tests/dataset/simple/classmethod.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@classmethod # reiz: tp
def foo():
...
def foo(): ...


@classmethod # reiz: tp
Expand All @@ -11,8 +10,7 @@ def foo():


@staticmethod
def foo():
...
def foo(): ...


@staticmethod
Expand Down
9 changes: 3 additions & 6 deletions tests/dataset/simple/simple_formatted_name_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ def a__foo____(): # reiz: tp
...


def aa1_foo():
...
def aa1_foo(): ...


def aa1foo():
...
def aa1foo(): ...


def __afoo_bar():
...
def __afoo_bar(): ...
3 changes: 1 addition & 2 deletions tests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ def setup(
update_db(change_db_schema)


class ExpectationFailed(Exception):
...
class ExpectationFailed(Exception): ...


@dataclass
Expand Down

0 comments on commit 2c6d286

Please sign in to comment.