You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by gc...@apache.org on 2023/03/06 18:47:08 UTC

[allura] 04/04: [#8502] added ruff.toml

This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8502
in repository https://gitbox.apache.org/repos/asf/allura.git

commit ece59bdbe02fb96f86222d0fec967a6ea9408ea5
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Mon Mar 6 12:41:47 2023 -0600

    [#8502] added ruff.toml
---
 AlluraTest/alluratest/test_syntax.py |  3 +--
 ruff.toml                            | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/AlluraTest/alluratest/test_syntax.py b/AlluraTest/alluratest/test_syntax.py
index 097eeb593..82bca77e5 100644
--- a/AlluraTest/alluratest/test_syntax.py
+++ b/AlluraTest/alluratest/test_syntax.py
@@ -81,10 +81,9 @@ def run_pyflakes(files):
     # skip some that aren't critical errors
     files = [f for f in files if '/migrations/' not in f]
     cmd = "ruff check " + ' '.join(files) + " | grep -v '" + "'"
-    #print("CMD", cmd)
     if run(cmd) != 1:
         # print 'Command was: %s' % cmd
-        raise Exception('ruff failure, see stdout', sys.stderr)
+        raise Exception('ruff failure, see stdout')
 
 
 class TestLinters:
diff --git a/ruff.toml b/ruff.toml
new file mode 100644
index 000000000..dc1878dc5
--- /dev/null
+++ b/ruff.toml
@@ -0,0 +1,17 @@
+exclude = [
+    ".git",
+    'node_modules',
+]
+per-file-ignores = {"__init__.py" = ["F403"]}
+select = ["E", "F"]
+ignore = [
+    'F401', # Imported but unused,
+    'F811', # Redefinition of unused
+    'F841', # Assigned to but never used
+    'E402', # Module level import not at top of file
+    'E731', # Do not assign a lambda expression, use a def
+    'E741', # Ambiguous variable name: I,
+]
+extend-select = ["RUF100"]
+line-length = 119
+