Skip to content

Commit

Permalink
[#8539] add some pylint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
brondsem authored and webjunkie01 committed Mar 26, 2024
1 parent 0d48081 commit 468ed46
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Allura/allura/command/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def config(self):
return tg.config

def basic_setup(self):
global log, M
global log, M # noqa: PLW0603
if self.args[0]:
# Probably being called from the command line - load the config
# file
Expand Down
2 changes: 1 addition & 1 deletion Allura/allura/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import logging
import string
import random
import pickle as pickle
import pickle
from hashlib import sha1
from datetime import datetime, timedelta
from collections import defaultdict, OrderedDict
Expand Down
2 changes: 1 addition & 1 deletion Allura/allura/lib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

_patched = False
def apply():
global _patched
global _patched # noqa: PLW0603
if _patched:
return
_patched = True
Expand Down
3 changes: 1 addition & 2 deletions Allura/allura/tests/functional/test_discuss.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ def attach_link(self):
if 'attachment' in alink['href']:
alink = str(alink['href'])
return alink
else:
assert False, 'attachment link not found'
assert False, 'attachment link not found'

def test_attach(self):
r = self.app.post(self.post_link + 'attach',
Expand Down
2 changes: 1 addition & 1 deletion Allura/allura/websetup/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def bootstrap(command, conf, vars):
REGISTRY.register(ew.widget_context,
ew.core.WidgetContext('http', ew.ResourceManager()))

create_test_data = asbool(os.getenv('ALLURA_TEST_DATA', True))
create_test_data = asbool(os.getenv('ALLURA_TEST_DATA', 'true'))

# if this is a test_run, skip user project creation to save time
make_user_projects = not test_run
Expand Down
4 changes: 4 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ lint.select = [
"G010", # logging.warn
"T10", # debugger breakpoints
"T20", # print()
"PLC",
"PLE",
"PLW",
"FA", # future annotations (to ensure compatibility with `target-version`)
]

Expand All @@ -57,6 +60,7 @@ lint.ignore = [
'S324', # md5 & sha1
'S603', # subprocess
'S607', # partial path
'PLW2901', # loop var overwritten
]

[lint.per-file-ignores]
Expand Down
2 changes: 1 addition & 1 deletion scripts/ApacheAccessHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def load_requests_lib(req):
exec(compile(open(activate_this, "rb").read(), activate_this, 'exec'), {'__file__': activate_this}) # noqa: S102
except Exception as e:
log(req, "Couldn't activate venv via {}: {}".format(activate_this, repr(e)))
global requests
global requests # noqa: PLW0603
import requests as requests_lib
requests = requests_lib

Expand Down

0 comments on commit 468ed46

Please sign in to comment.