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:38:56 UTC

[allura] branch gc/8502 updated (e43eaedd4 -> bf8bafff7)

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

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


 discard e43eaedd4 [#8502] ignoring long lines and updating ruff command with --config and --show-source flags
 discard 8ff25bec8 [#8502] regenerated requirements.txt
 discard 42332fd0f [#8502] updated ruff config and added an extra flag --show-source
 discard e2b9ccc70 fixup! [#8502] added ruff.toml
 discard ece59bdbe [#8502] added ruff.toml
 discard de870b067 [#8502] fixing more code violations
 discard 828c04d7b [#8502] fixed line too long warnings
     new de9c2e0b0 [#8502] fixing more code violations
     new 3d53efe85 [#8502] added ruff.toml
     new a9b99fb1f [#8502] updated ruff config and added an extra flag --show-source
     new 26ae660d0 [#8502] regenerated requirements.txt
     new bf8bafff7 [#8502] ignoring long lines and updating ruff command with --config and --show-source flags

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (e43eaedd4)
            \
             N -- N -- N   refs/heads/gc/8502 (bf8bafff7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Allura/allura/app.py                               |  4 +-
 Allura/allura/command/create_trove_categories.py   | 68 +++++++++++-----------
 Allura/allura/command/set_neighborhood_features.py |  2 +-
 Allura/allura/command/taskd.py                     |  4 +-
 Allura/allura/command/taskd_cleanup.py             |  2 +-
 Allura/allura/config/app_cfg.py                    |  3 +-
 Allura/allura/controllers/auth.py                  |  2 +-
 Allura/allura/controllers/repository.py            |  2 +-
 Allura/allura/controllers/rest.py                  |  2 +-
 Allura/allura/controllers/trovecategories.py       |  2 +-
 Allura/allura/ext/admin/widgets.py                 | 10 ++--
 Allura/allura/ext/user_profile/user_main.py        |  2 +-
 Allura/allura/lib/app_globals.py                   |  5 +-
 Allura/allura/lib/custom_middleware.py             |  2 +-
 Allura/allura/lib/helpers.py                       |  2 +-
 Allura/allura/lib/macro.py                         |  3 +-
 Allura/allura/lib/phone/nexmo.py                   |  4 +-
 Allura/allura/lib/plugin.py                        |  2 +-
 Allura/allura/lib/security.py                      |  2 +-
 Allura/allura/lib/utils.py                         |  2 +-
 Allura/allura/lib/widgets/form_fields.py           |  2 +-
 Allura/allura/lib/widgets/forms.py                 |  8 +--
 Allura/allura/model/__init__.py                    |  2 +-
 Allura/allura/model/neighborhood.py                |  2 +-
 Allura/allura/model/project.py                     |  9 ++-
 Allura/allura/model/repository.py                  |  2 +-
 Allura/allura/model/stats.py                       |  3 +-
 Allura/allura/model/types.py                       |  2 +-
 Allura/allura/scripts/disable_users.py             |  2 +-
 Allura/allura/tests/functional/test_discuss.py     |  2 +-
 .../allura/tests/functional/test_neighborhood.py   |  2 +-
 Allura/allura/tests/functional/test_newforge.py    |  2 +-
 Allura/allura/tests/functional/test_site_admin.py  |  4 +-
 .../allura/tests/functional/test_user_profile.py   |  8 +--
 Allura/allura/tests/model/test_project.py          |  4 +-
 Allura/allura/tests/model/test_repo.py             |  3 +-
 Allura/allura/tests/test_commands.py               |  2 +-
 Allura/allura/tests/test_decorators.py             |  2 +-
 Allura/allura/tests/test_globals.py                |  6 +-
 Allura/allura/tests/test_helpers.py                |  2 +-
 Allura/allura/tests/test_mail_util.py              |  2 +-
 Allura/allura/tests/test_middlewares.py            |  3 +-
 Allura/allura/tests/test_plugin.py                 |  2 +-
 Allura/allura/tests/test_tasks.py                  |  6 +-
 Allura/allura/tests/test_utils.py                  |  6 +-
 Allura/allura/tests/unit/test_session.py           |  2 +-
 Allura/allura/tests/unit/test_solr.py              |  2 +-
 .../forgediscussion/controllers/forum.py           |  5 +-
 .../forgediscussion/controllers/root.py            |  2 +-
 ForgeGit/forgegit/model/git_repo.py                |  4 +-
 .../forgegit/tests/functional/test_controllers.py  | 10 ++--
 ForgeGit/forgegit/tests/model/test_repository.py   |  2 +-
 .../forgeimporters/tests/github/test_extractor.py  |  2 +-
 .../forgeimporters/tests/github/test_tracker.py    |  8 +--
 .../trac/tests/functional/test_trac.py             |  2 +-
 .../forgetracker/tests/functional/test_root.py     |  5 +-
 .../forgetracker/widgets/admin_custom_fields.py    |  2 +-
 ForgeWiki/forgewiki/tests/functional/test_root.py  |  4 +-
 ForgeWiki/forgewiki/wiki_main.py                   |  4 +-
 59 files changed, 131 insertions(+), 136 deletions(-)


[allura] 01/05: [#8502] fixing more code violations

Posted by gc...@apache.org.
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 de9c2e0b03150bd6eeab505e9c8d145821a2fd01
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Mon Mar 6 12:37:59 2023 -0600

    [#8502] fixing more code violations
---
 Allura/allura/config/middleware.py                 | 30 +++++++++++-----------
 Allura/allura/ext/admin/admin_main.py              |  4 +--
 Allura/allura/model/filesystem.py                  |  2 +-
 .../allura/tests/functional/test_neighborhood.py   |  6 ++---
 Allura/allura/tests/model/test_timeline.py         |  2 +-
 Allura/allura/tests/test_multifactor.py            |  4 +--
 Allura/allura/tests/test_plugin.py                 |  6 ++---
 .../allura/tests/unit/spam/test_stopforumspam.py   |  6 ++---
 Allura/setup.py                                    |  2 +-
 AlluraTest/alluratest/test_syntax.py               | 10 ++------
 .../tests/github/functional/test_github.py         |  2 +-
 ForgeTracker/forgetracker/import_support.py        |  4 +--
 12 files changed, 36 insertions(+), 42 deletions(-)

diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
index 99b88645f..043943ef8 100644
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -49,21 +49,21 @@ except ImportError:
 else:
     patches.newrelic()
 
-from allura.config.app_cfg import AlluraJinjaRenderer  # noqa: E402
-from allura.config.app_cfg import ForgeConfig  # noqa: E402
-from allura.lib.custom_middleware import AlluraTimerMiddleware  # noqa: E402
-from allura.lib.custom_middleware import SSLMiddleware  # noqa: E402
-from allura.lib.custom_middleware import StaticFilesMiddleware  # noqa: E402
-from allura.lib.custom_middleware import CSRFMiddleware  # noqa: E402
-from allura.lib.custom_middleware import CORSMiddleware  # noqa: E402
-from allura.lib.custom_middleware import LoginRedirectMiddleware  # noqa: E402
-from allura.lib.custom_middleware import RememberLoginMiddleware  # noqa: E402
-from allura.lib.custom_middleware import SetRequestHostFromConfig  # noqa: E402
-from allura.lib.custom_middleware import MingTaskSessionSetupMiddleware  # noqa: E402
-from allura.lib.custom_middleware import ContentSecurityPolicyMiddleware  # noqa: E402
-from allura.lib.custom_middleware import StatusCodeRedirect  # noqa: E402
-from allura.lib import helpers as h  # noqa: E402
-from allura.lib.utils import configure_ming  # noqa: E402
+from allura.config.app_cfg import AlluraJinjaRenderer
+from allura.config.app_cfg import ForgeConfig
+from allura.lib.custom_middleware import AlluraTimerMiddleware
+from allura.lib.custom_middleware import SSLMiddleware
+from allura.lib.custom_middleware import StaticFilesMiddleware
+from allura.lib.custom_middleware import CSRFMiddleware
+from allura.lib.custom_middleware import CORSMiddleware
+from allura.lib.custom_middleware import LoginRedirectMiddleware
+from allura.lib.custom_middleware import RememberLoginMiddleware
+from allura.lib.custom_middleware import SetRequestHostFromConfig
+from allura.lib.custom_middleware import MingTaskSessionSetupMiddleware
+from allura.lib.custom_middleware import ContentSecurityPolicyMiddleware
+from allura.lib.custom_middleware import StatusCodeRedirect
+from allura.lib import helpers as h
+from allura.lib.utils import configure_ming
 
 __all__ = ['make_app']
 
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 3cf3eba29..9dd17d062 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -666,7 +666,7 @@ class ProjectAdminController(BaseController):
             else:
                 require_access(c.project, 'admin')
                 installable_tools = AdminApp.installable_tools_for(c.project)
-                if not ep_name.lower() in [t['name'].lower() for t in installable_tools]:
+                if ep_name.lower() not in [t['name'].lower() for t in installable_tools]:
                     flash('Installation limit exceeded.', 'error')
                     return
                 mount_point = new['mount_point'] or ep_name
@@ -946,7 +946,7 @@ class ProjectAdminRestController(BaseController):
             }
         installable_tools = AdminApp.installable_tools_for(c.project)
         tools_names = [t['name'] for t in installable_tools]
-        if not (tool in tools_names):
+        if tool not in tools_names:
             return {
                 'success': False,
                 'info': 'Incorrect tool name, or limit is reached.'
diff --git a/Allura/allura/model/filesystem.py b/Allura/allura/model/filesystem.py
index ed0808383..bd5da977b 100644
--- a/Allura/allura/model/filesystem.py
+++ b/Allura/allura/model/filesystem.py
@@ -181,7 +181,7 @@ class File(MappedClass):
                    convert_bmp=False):
         if content_type is None:
             content_type = utils.guess_mime_type(filename)
-        if not content_type.lower() in SUPPORTED_BY_PIL:
+        if content_type.lower() not in SUPPORTED_BY_PIL:
             log.debug('Content type %s from file %s not supported',
                       content_type, filename)
             return None, None
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index d9fd3fc21..13f46dfff 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -769,9 +769,9 @@ class TestNeighborhood(TestController):
         assert "My home text!" in r
         # check tool options
         opts = p.app_config('wiki').options
-        assert False == opts.show_discussion
-        assert False == opts.show_left_bar
-        assert False == opts.show_right_bar
+        assert opts.show_discussion is False
+        assert opts.show_left_bar is False
+        assert opts.show_right_bar is False
         assert "http://foo.com/testtemp/" == opts.some_url
         # check that custom groups/perms/users were setup correctly
         roles = p.named_roles
diff --git a/Allura/allura/tests/model/test_timeline.py b/Allura/allura/tests/model/test_timeline.py
index ad1b252af..264057b68 100644
--- a/Allura/allura/tests/model/test_timeline.py
+++ b/Allura/allura/tests/model/test_timeline.py
@@ -36,5 +36,5 @@ class TestActivityObject_Functional:
         wiki_app = p.app_instance('wiki')
         app_config = wiki_app.config
 
-        assert (bool(app_config.has_activity_access('read', user=M.User.anonymous(), activity=None)) ==
+        assert (bool(app_config.has_activity_access('read', user=M.User.anonymous(), activity=None)) is
                      True)
\ No newline at end of file
diff --git a/Allura/allura/tests/test_multifactor.py b/Allura/allura/tests/test_multifactor.py
index 8ba2454bc..7192e298a 100644
--- a/Allura/allura/tests/test_multifactor.py
+++ b/Allura/allura/tests/test_multifactor.py
@@ -138,7 +138,7 @@ class TestAnyTotpServiceImplementation:
     def test_none(self):
         srv = self.Service()
         user = self.mock_user()
-        assert None == srv.get_secret_key(user)
+        assert srv.get_secret_key(user) is None
 
     def test_set_get(self):
         srv = self.Service()
@@ -152,7 +152,7 @@ class TestAnyTotpServiceImplementation:
         srv.set_secret_key(user, self.sample_key)
         assert self.sample_key == srv.get_secret_key(user)
         srv.set_secret_key(user, None)
-        assert None == srv.get_secret_key(user)
+        assert srv.get_secret_key(user) is None
 
     @patch('allura.lib.multifactor.time')
     def test_rate_limiting(self, time):
diff --git a/Allura/allura/tests/test_plugin.py b/Allura/allura/tests/test_plugin.py
index 5efd39cc1..8248362b6 100644
--- a/Allura/allura/tests/test_plugin.py
+++ b/Allura/allura/tests/test_plugin.py
@@ -224,7 +224,7 @@ class TestProjectRegistrationProviderPhoneVerification:
                 'request-id', '1111')
             assert result == g.phone_service.check.return_value
             assert (
-                self.user.get_tool_data('phone_verification', 'number_hash') ==
+                self.user.get_tool_data('phone_verification', 'number_hash') is
                 None)
             audit.assert_called_once_with(
                 'Phone verification failed. Hash: hash', user=self.user)
@@ -689,7 +689,7 @@ class TestLocalAuthenticationProvider:
     def test_login_details_from_auditlog(self):
         user = M.User(username='asfdasdf')
 
-        assert (self.provider.login_details_from_auditlog(M.AuditLog(message='')) ==
+        assert (self.provider.login_details_from_auditlog(M.AuditLog(message='')) is
                 None)
 
         detail = self.provider.login_details_from_auditlog(M.AuditLog(message='IP Address: 1.2.3.4\nFoo', user=user))
@@ -702,7 +702,7 @@ class TestLocalAuthenticationProvider:
         assert detail.ua is None
 
         assert (self.provider.login_details_from_auditlog(M.AuditLog(
-            message='blah blah IP Address: 1.2.3.4\nFoo', user=user)) ==
+            message='blah blah IP Address: 1.2.3.4\nFoo', user=user)) is
             None)
 
         detail = self.provider.login_details_from_auditlog(M.AuditLog(
diff --git a/Allura/allura/tests/unit/spam/test_stopforumspam.py b/Allura/allura/tests/unit/spam/test_stopforumspam.py
index bb827183e..590bcc049 100644
--- a/Allura/allura/tests/unit/spam/test_stopforumspam.py
+++ b/Allura/allura/tests/unit/spam/test_stopforumspam.py
@@ -42,10 +42,10 @@ class TestStopForumSpam:
     @mock.patch('allura.lib.spam.stopforumspamfilter.request')
     def test_check(self, request):
         request.remote_addr = '1.2.3.4'
-        assert True == self.sfs.check(self.content, artifact=self.artifact)
+        assert self.sfs.check(self.content, artifact=self.artifact) is True
 
         request.remote_addr = '1.1.1.1'
-        assert False == self.sfs.check(self.content, artifact=self.artifact)
+        assert self.sfs.check(self.content, artifact=self.artifact) is False
 
         request.remote_addr = None  # e.g. from background task processing inbound email
-        assert False == self.sfs.check(self.content, artifact=self.artifact)
+        assert self.sfs.check(self.content, artifact=self.artifact) is False
diff --git a/Allura/setup.py b/Allura/setup.py
index aa5f79113..ece157874 100644
--- a/Allura/setup.py
+++ b/Allura/setup.py
@@ -26,7 +26,7 @@ lists, wiki pages, blogs and more for any number of individual projects.
 '''
 setup(
     name='Allura',
-    version=__version__,
+    version=__version__, # noqa
     description='Base distribution of the Allura development platform',
     long_description=PROJECT_DESCRIPTION,
     author='Allura Team',
diff --git a/AlluraTest/alluratest/test_syntax.py b/AlluraTest/alluratest/test_syntax.py
index 21ffd869e..097eeb593 100644
--- a/AlluraTest/alluratest/test_syntax.py
+++ b/AlluraTest/alluratest/test_syntax.py
@@ -79,18 +79,12 @@ def run_linter(files):
 
 def run_pyflakes(files):
     # skip some that aren't critical errors
-    skips = [
-        'imported but unused',
-        'redefinition of unused',
-        'assigned to but never used',
-        '__version__',
-    ]
     files = [f for f in files if '/migrations/' not in f]
-    cmd = "ruff check " + ' '.join(files) + " | grep -v '" + "' | grep -v '".join(skips) + "'"
+    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')
+        raise Exception('ruff failure, see stdout', sys.stderr)
 
 
 class TestLinters:
diff --git a/ForgeImporters/forgeimporters/tests/github/functional/test_github.py b/ForgeImporters/forgeimporters/tests/github/functional/test_github.py
index f6404d758..17b9fb18f 100644
--- a/ForgeImporters/forgeimporters/tests/github/functional/test_github.py
+++ b/ForgeImporters/forgeimporters/tests/github/functional/test_github.py
@@ -95,5 +95,5 @@ class TestGitHubOAuth(TestController):
 
     def test_project_import_login_required(self):
         r = self.app.get('/p/import_project/github/', extra_environ=dict(username='*anonymous'))
-        assert None == r.location
+        assert r.location is None
         r.mustcontain('Login Required')
diff --git a/ForgeTracker/forgetracker/import_support.py b/ForgeTracker/forgetracker/import_support.py
index 31561e0c0..13acf1c0b 100644
--- a/ForgeTracker/forgetracker/import_support.py
+++ b/ForgeTracker/forgetracker/import_support.py
@@ -175,7 +175,7 @@ class ImportSupport:
                     break
             else:
                 milestone = {'due_date': '',
-                             'complete': not ticket_status in c.app.globals.open_status_names,
+                             'complete': ticket_status not in c.app.globals.open_status_names,
                              'description': '',
                              'name': value,
                              'old_name': value}
@@ -289,7 +289,7 @@ class ImportSupport:
     def find_unknown_users(self, users):
         unknown = set()
         for u in users:
-            if u and not u in self.options['user_map'] and not M.User.by_username(u):
+            if u and u not in self.options['user_map'] and not M.User.by_username(u):
                 unknown.add(u)
         return unknown
 


[allura] 02/05: [#8502] added ruff.toml

Posted by gc...@apache.org.
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 <gu...@slashdotmedia.com>
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
+


[allura] 03/05: [#8502] updated ruff config and added an extra flag --show-source

Posted by gc...@apache.org.
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 a9b99fb1fba3fbdeacbfe41e32d93e6e5ba0ff5a
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Thu Mar 9 21:19:48 2023 +0000

    [#8502] updated ruff config and added an extra flag --show-source
---
 AlluraTest/alluratest/test_syntax.py | 2 +-
 requirements.in                      | 3 +--
 ruff.toml                            | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/AlluraTest/alluratest/test_syntax.py b/AlluraTest/alluratest/test_syntax.py
index 82bca77e5..7272da81f 100644
--- a/AlluraTest/alluratest/test_syntax.py
+++ b/AlluraTest/alluratest/test_syntax.py
@@ -80,7 +80,7 @@ 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) + " | grep -v '" + "'"
+    cmd = "ruff check " + ' '.join(files) + " --show-source"
     if run(cmd) != 1:
         # print 'Command was: %s' % cmd
         raise Exception('ruff failure, see stdout')
diff --git a/requirements.in b/requirements.in
index 68685bc65..e209b3487 100644
--- a/requirements.in
+++ b/requirements.in
@@ -49,7 +49,7 @@ werkzeug
 wrapt
 # testing
 mock
-#pyflakes
+ruff
 #pylint -- disabled due to [#8346]  (also requires diff versions on py2 vs 3, including transitive deps which gets tricky with pip-compile)
 testfixtures
 WebTest
@@ -59,4 +59,3 @@ pytest-sugar
 
 # deployment
 gunicorn
-ruff
\ No newline at end of file
diff --git a/ruff.toml b/ruff.toml
index 452bc05b8..7ea3f6a70 100644
--- a/ruff.toml
+++ b/ruff.toml
@@ -3,7 +3,7 @@ exclude = [
     'node_modules',
 ]
 per-file-ignores = {'__init__.py' = ['F403']}
-select = ['E', 'F', 'RUF100']
+select = ['E', 'F', 'RUF100', 'W6', 'ISC001']
 ignore = [
     'F401', # Imported but unused,
     'F811', # Redefinition of unused


[allura] 04/05: [#8502] regenerated requirements.txt

Posted by gc...@apache.org.
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 26ae660d0bd429c86c03077f46c688c4d670989b
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Thu Mar 9 21:41:07 2023 +0000

    [#8502] regenerated requirements.txt
---
 requirements.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index 67d409b0d..3d58b7ddd 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -128,8 +128,6 @@ profanityfilter==2.0.6
     # via -r requirements.in
 pycparser==2.21
     # via cffi
-pyflakes==3.0.1
-    # via -r requirements.in
 pygments==2.14.0
     # via -r requirements.in
 pymongo==3.13.0
@@ -180,6 +178,8 @@ requests==2.28.1
     #   requests-oauthlib
 requests-oauthlib==1.3.1
     # via -r requirements.in
+ruff==0.0.254
+    # via -r requirements.in
 setproctitle==1.3.2
     # via -r requirements.in
 sgmllib3k==1.0.0


[allura] 05/05: [#8502] ignoring long lines and updating ruff command with --config and --show-source flags

Posted by gc...@apache.org.
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