Skip to content

Commit 901a2fe

Browse files
authored
added ruff linter (#38)
how could i forget to add it from the beginning... Signed-off-by: Alexander Piskun <[email protected]>
1 parent c65a9f7 commit 901a2fe

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ repos:
4343
types: [file, python]
4444
files: nc_py_api/
4545

46+
- repo: https://github.com/astral-sh/ruff-pre-commit
47+
rev: v0.0.277
48+
hooks:
49+
- id: ruff
50+
4651
- repo: https://github.com/pre-commit/mirrors-mypy
4752
rev: v1.4.1
4853
hooks:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sys.path.insert(0, os.path.abspath(dir_path + "/_ext"))
99
sys.path.insert(0, os.path.abspath("../."))
1010

11-
import nc_py_api
11+
import nc_py_api # noqa
1212

1313
now = datetime.now()
1414

examples/to_gif/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def video_to_gif(
3030
save_path = path.splitext(source_path)[0] + ".gif"
3131
nc.log(LogLvl.WARNING, f"Processing:{source_path} -> {save_path}")
3232
source_file = nc.files.download(source_path)
33-
nc.log(LogLvl.WARNING, f"File downloaded")
33+
nc.log(LogLvl.WARNING, "File downloaded")
3434
try:
3535
with tempfile.NamedTemporaryFile(mode="w+b") as tmp_in:
3636
tmp_in.write(source_file)
@@ -53,9 +53,9 @@ async def video_to_gif(
5353
cap.release()
5454
imageio.mimsave(tmp_out.name, image_lst)
5555
optimize(tmp_out.name)
56-
nc.log(LogLvl.WARNING, f"GIF is ready")
56+
nc.log(LogLvl.WARNING, "GIF is ready")
5757
nc.files.upload(save_path, content=tmp_out.read())
58-
nc.log(LogLvl.WARNING, f"Result uploaded")
58+
nc.log(LogLvl.WARNING, "Result uploaded")
5959
except Exception as e:
6060
nc.log(LogLvl.ERROR, str(e))
6161
return Response()

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ line-length = 120
99
target-versions = ["py39"]
1010
preview = true
1111

12+
[tool.ruff]
13+
line-length = 120
14+
target-version = "py39"
15+
16+
[tool.ruff.per-file-ignores]
17+
"nc_py_api/__init__.py" = ["F401"]
18+
1219
[tool.isort]
1320
profile = "black"
1421

0 commit comments

Comments
 (0)