Skip to content

Commit

Permalink
Add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Dec 24, 2023
1 parent 2880158 commit 3a6738a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint mypy[mypyc] coverage
pip install pylint mypy[mypyc] coverage ruff
rustup update
- name: Lint
Expand Down
6 changes: 6 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[lint]
ignore = [
"E741",
"F403",
"F405",
]
2 changes: 1 addition & 1 deletion test/lin_rec.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if TYPE_CHECKING:
from typing import Self

from tm.parse import Color, Shift, State, Slot, GetInstr
from tm.parse import Color, State, Slot, GetInstr
from tm.machine import Undfnd

RecRes = tuple[int, int]
Expand Down
1 change: 1 addition & 0 deletions tm/parse.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: F401
# pylint: disable-next = unused-import, wrong-import-order
from tm.rust_stuff import (
parse,
Expand Down
5 changes: 4 additions & 1 deletion tm/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
if TYPE_CHECKING:
from typing import Self

from tm.parse import Color, Shift, State, Slot, Instr
from tm.parse import Color, State, Slot, Instr

# ruff: noqa: F401
from tm.parse import Shift

ProgStr = str

Expand Down
1 change: 1 addition & 0 deletions tm/rust_stuff.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Index = tuple[int, int]

Rule = dict[Index, Op]

# ruff: noqa: E701
class InfiniteRule(Exception): pass
class RuleLimit(Exception): pass
class UnknownRule(Exception): pass
Expand Down
1 change: 1 addition & 0 deletions tm/show.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: F401
# pylint: disable = unused-import
from tm.num import show_number

Expand Down

0 comments on commit 3a6738a

Please sign in to comment.