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/09 22:39:01 UTC
[allura] 05/05: [#8502] ignoring long lines and updating ruff command with --config and --show-source flags
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 bf8bafff768f7d55de21f8a53063cab2714d7031
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Thu Mar 9 22:34:19 2023 +0000
[#8502] ignoring long lines and updating ruff command with --config and --show-source flags
---
AlluraTest/alluratest/test_syntax.py | 6 +++---
ruff.toml | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/AlluraTest/alluratest/test_syntax.py b/AlluraTest/alluratest/test_syntax.py
index 7272da81f..662f8c692 100644
--- a/AlluraTest/alluratest/test_syntax.py
+++ b/AlluraTest/alluratest/test_syntax.py
@@ -23,7 +23,7 @@ from unittest import SkipTest
from six.moves import zip_longest
toplevel_dir = os.path.abspath(os.path.dirname(__file__) + "/../..")
-
+BASE_PATH = (toplevel_dir,) #freeze main path
def run(cmd):
proc = Popen(cmd, shell=True, cwd=toplevel_dir, stdout=PIPE, stderr=PIPE)
@@ -80,8 +80,8 @@ def run_linter(files):
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) + " --show-source"
- if run(cmd) != 1:
+ cmd = f"ruff check {' '.join(files)} --config {BASE_PATH[0]}/ruff.toml --show-source"
+ if run(cmd) != 0:
# print 'Command was: %s' % cmd
raise Exception('ruff failure, see stdout')
diff --git a/ruff.toml b/ruff.toml
index 7ea3f6a70..1b7a345a0 100644
--- a/ruff.toml
+++ b/ruff.toml
@@ -11,6 +11,7 @@ ignore = [
'E402', # Module level import not at top of file
'E731', # Do not assign a lambda expression, use a def
'E741', # Ambiguous variable name: I,
+ 'E501' # Line too long
]
line-length = 119