File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff line change 88sys .path .insert (0 , os .path .abspath (dir_path + "/_ext" ))
99sys .path .insert (0 , os .path .abspath ("../." ))
1010
11- import nc_py_api
11+ import nc_py_api # noqa
1212
1313now = datetime .now ()
1414
Original file line number Diff line number Diff 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 ()
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ line-length = 120
99target-versions = [" py39" ]
1010preview = 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 ]
1320profile = " black"
1421
You can’t perform that action at this time.
0 commit comments