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 3d53efe85b2f3aea199111f3222b52551cff33ff Author: Guillermo Cruz <[email protected]> AuthorDate: Mon Mar 6 12:41:47 2023 -0600 [#8502] added ruff.toml --- AlluraTest/alluratest/test_syntax.py | 3 +-- ruff.toml | 16 ++++++++++++++++ 2 files changed, 17 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..452bc05b8 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,16 @@ +exclude = [ + '.git', + 'node_modules', +] +per-file-ignores = {'__init__.py' = ['F403']} +select = ['E', 'F', 'RUF100'] +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, +] +line-length = 119 +
