From a617d6488275a58da0627b3fed5f53593b2eb8b2 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 07:43:55 +0300 Subject: add ruff config --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 pyproject.toml (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..9e9662ad --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,8 @@ +[tool.ruff] + +ignore = [ + "E501", + "E731" +] + +exclude = ["extensions"] -- cgit v1.2.3 From 762265eab58cdb8f2d6398769bab43d8b8db0075 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 07:52:45 +0300 Subject: autofixes from ruff --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 9e9662ad..1e164abc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,9 @@ ignore = [ "E501", - "E731" + "E731", + "E402", # Module level import not at top of file + "F401" # Module imported but unused ] exclude = ["extensions"] -- cgit v1.2.3 From f741a98baccae100fcfb40c017b5c35c5cba1b0c Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 08:43:42 +0300 Subject: imports cleanup for ruff --- pyproject.toml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 1e164abc..9caa9ba2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,13 @@ [tool.ruff] +exclude = ["extensions"] + ignore = [ "E501", - "E731", - "E402", # Module level import not at top of file - "F401" # Module imported but unused + + "F401", # Module imported but unused ] -exclude = ["extensions"] + +[tool.ruff.per-file-ignores] +"webui.py" = ["E402"] # Module level import not at top of file \ No newline at end of file -- cgit v1.2.3 From 4b854806d98cf5ccd48e5cd99c172613da7937f0 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 09:02:23 +0300 Subject: F401 fixes for ruff --- pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 9caa9ba2..0883c127 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,14 @@ [tool.ruff] +target-version = "py310" + exclude = ["extensions"] ignore = [ - "E501", - - "F401", # Module imported but unused + "E501", # Line too long + "E731", # Do not assign a `lambda` expression, use a `def` ] [tool.ruff.per-file-ignores] -"webui.py" = ["E402"] # Module level import not at top of file \ No newline at end of file +"webui.py" = ["E402"] # Module level import not at top of file -- cgit v1.2.3 From 57ef617251a5cb118fb5a49c6e7cd2b609323ab0 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 09:09:41 +0300 Subject: integrate the PR's config --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 0883c127..24f5b1ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,10 @@ target-version = "py310" -exclude = ["extensions"] +exclude = [ + "extensions", + "extensions-disabled", +] ignore = [ "E501", # Line too long -- cgit v1.2.3 From e42de4b8a2356c6d286adb07292442d75e5595d3 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 11:00:07 +0300 Subject: update ruff config with more stuff --- pyproject.toml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 24f5b1ae..2f65fd6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,12 @@ [tool.ruff] -target-version = "py310" +target-version = "py39" + +extend-select = [ + "B", + "C", + "I", +] exclude = [ "extensions", @@ -10,6 +16,12 @@ exclude = [ ignore = [ "E501", # Line too long "E731", # Do not assign a `lambda` expression, use a `def` + + "I001", # Import block is un-sorted or un-formatted + "C901", # Function is too complex + "C408", # Rewrite as a literal + "B007", # Loop control variable not used within loop body + ] -- cgit v1.2.3 From 550256db1ce18778a9d56ff343d844c61b9f9b83 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 11:19:16 +0300 Subject: ruff manual fixes --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 2f65fd6c..346a0cde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,9 @@ ignore = [ ] - [tool.ruff.per-file-ignores] "webui.py" = ["E402"] # Module level import not at top of file + +[tool.ruff.flake8-bugbear] +# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`. +extend-immutable-calls = ["fastapi.Depends", "fastapi.security.HTTPBasic"] \ No newline at end of file -- cgit v1.2.3 From a5121e7a0623db328a9462d340d389ed6737374a Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 10 May 2023 11:37:18 +0300 Subject: fixes for B007 --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 346a0cde..c88907be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,6 @@ ignore = [ "I001", # Import block is un-sorted or un-formatted "C901", # Function is too complex "C408", # Rewrite as a literal - "B007", # Loop control variable not used within loop body ] -- cgit v1.2.3 From 49a55b410b66b7dd9be9335d8a2e3a71e4f8b15c Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 11 May 2023 18:28:15 +0300 Subject: Autofix Ruff W (not W605) (mostly whitespace) --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index c88907be..d4a1bbf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ extend-select = [ "B", "C", "I", + "W", ] exclude = [ @@ -20,7 +21,7 @@ ignore = [ "I001", # Import block is un-sorted or un-formatted "C901", # Function is too complex "C408", # Rewrite as a literal - + "W605", # invalid escape sequence, messes with some docstrings ] [tool.ruff.per-file-ignores] @@ -28,4 +29,4 @@ ignore = [ [tool.ruff.flake8-bugbear] # Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`. -extend-immutable-calls = ["fastapi.Depends", "fastapi.security.HTTPBasic"] \ No newline at end of file +extend-immutable-calls = ["fastapi.Depends", "fastapi.security.HTTPBasic"] -- cgit v1.2.3 From 793a491923ba11adbe1024e0eb0402923165dafa Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 11 May 2023 21:57:43 +0300 Subject: Overhaul tests to use py.test --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index d4a1bbf4..80541a8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,3 +30,6 @@ ignore = [ [tool.ruff.flake8-bugbear] # Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`. extend-immutable-calls = ["fastapi.Depends", "fastapi.security.HTTPBasic"] + +[tool.pytest.ini_options] +base_url = "http://127.0.0.1:7860" -- cgit v1.2.3