Skip to content

Commit 520918c

Browse files
committed
Добавлен линтер ruff и исправлены недочеты от линтера
1 parent d910523 commit 520918c

File tree

6 files changed

+51
-5
lines changed

6 files changed

+51
-5
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ install:
99

1010
brain-games:
1111
uv run brain-games
12+
13+
lint:
14+
uv run ruff check brain_games

brain_games/cli.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
21
import prompt
3-
42
def welcome_user():
53
name = prompt.string('May I have your name? ')
64
print(f'Hello, {name}')

brain_games/scripts/brain_games.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python3
2-
32
from brain_games.cli import welcome_user
4-
53
def main():
64
print('Welcome to the Brain Games!')
75

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ build-backend = "hatchling.build"
1515
[tool.hatch.build.targets.wheel]
1616
packages = ["brain_games"]
1717

18+
[dependency-groups]
19+
dev = [
20+
"ruff>=0.9.10",
21+
]
22+
1823
[project.scripts]
1924
brain-games = "brain_games.scripts.brain_games:main"

ruff.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
line-length = 80
2+
3+
[lint.per-file-ignores]
4+
# init modules can contain the local imports, logic, unused imports
5+
"__init__.py" = ["F401"]
6+
7+
[lint]
8+
preview = true
9+
select = ["E", "F", "I", "C90"]

uv.lock

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)