Skip to content

Commit

Permalink
ruff: enable flake8-bugbear except B904
Browse files Browse the repository at this point in the history
Resolve B904 in a later commit.
  • Loading branch information
jelly committed Nov 3, 2023
1 parent a6f5b92 commit e864c90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ def get_object(self, request, arch='', repo=''):
r = Repo.objects.filter(testing=False, staging=False)
qs = qs.filter(repo__in=r)
obj['repos'] = r
setattr(obj['repos'], 'name', 'all stable repositories')
obj['repos'].name = 'all stable repositories'
elif repo == 'testing-repos':
# feed for a single arch AND all testing repos
r = Repo.objects.filter(testing=True, staging=False)
qs = qs.filter(repo__in=r)
obj['repos'] = r
setattr(obj['repos'], 'name', 'all testing repositories')
obj['repos'].name = 'all testing repositories'
else:
# feed for a single arch AND repo
r = Repo.objects.get(name__iexact=repo)
Expand Down Expand Up @@ -210,13 +210,13 @@ def get_object(self, request, operation='', arch='', repo=''):
r = Repo.objects.filter(testing=False, staging=False)
qs = qs.filter(repo__in=r)
obj['repos'] = r
setattr(obj['repos'], 'name', 'all stable repositories')
obj['repos'].name = 'all stable repositories'
elif repo == 'testing-repos':
# feed for a single arch AND all testing repos
r = Repo.objects.filter(testing=True, staging=False)
qs = qs.filter(repo__in=r)
obj['repos'] = r
setattr(obj['repos'], 'name', 'all testing repositories')
obj['repos'].name = 'all testing repositories'
else:
# feed for a single arch AND repo
r = Repo.objects.get(name__iexact=repo)
Expand Down
2 changes: 1 addition & 1 deletion main/tests/test_templatetags_pgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_pgp_key_link(settings):
assert_pgp_key_link('0xA10E234343EA8BDC7FF5E34A12F')

pgp_key = '423423fD9004FB063E2C81117BFB1108D234DAFZ'
server = getattr(settings, 'PGP_SERVER')
server = settings.PGP_SERVER

settings.PGP_SERVER = ''
assert server not in pgp_key_link(pgp_key)
Expand Down
3 changes: 2 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle
"F", # pyflakes
Expand All @@ -16,4 +17,4 @@ select = [
]

# Never enforce `E501` (line length violations).
ignore = ["E501", "E731"]
ignore = ["E501", "E731", "B904"]

0 comments on commit e864c90

Please sign in to comment.