Enable ruff's "comprehensions" rules

This commit is contained in:
Adam Goldsmith 2024-01-18 13:14:00 -05:00
parent 02777265b0
commit de0db9ac5a
3 changed files with 4 additions and 6 deletions

View File

@ -174,7 +174,7 @@ class MembershipWorks:
# get list of member ID matching the search # get list of member ID matching the search
# dedup with set() to work around people with alt uids # dedup with set() to work around people with alt uids
# TODO: figure out why people have alt uids # TODO: figure out why people have alt uids
return set(user["uid"] for user in r.json()["usr"]) return {user["uid"] for user in r.json()["usr"]}
# TODO: has issues with aliasing header names: # TODO: has issues with aliasing header names:
# ex: "Personal Studio Space" Label vs Membership Addon/Field # ex: "Personal Studio Space" Label vs Membership Addon/Field

View File

@ -80,10 +80,8 @@ def scrape_transactions(membershipworks: MembershipWorks):
# this is terrible, but as long as the dates are the same, should be fiiiine # this is terrible, but as long as the dates are the same, should be fiiiine
transactions = [{**j, **v} for j, v in zip(transactions_csv, transactions_json)] transactions = [{**j, **v} for j, v in zip(transactions_csv, transactions_json)]
assert all( assert all(
[
t["Account ID"] == t.get("uid", "") and t["Payment ID"] == t.get("sid", "") t["Account ID"] == t.get("uid", "") and t["Payment ID"] == t.get("sid", "")
for t in transactions for t in transactions
]
) )
for csv_transaction in transactions: for csv_transaction in transactions:

View File

@ -43,7 +43,7 @@ admin_email = "cmsmanage.django_q2_admin_email_reporter:AdminEmailReporter"
[tool.ruff] [tool.ruff]
line-length = 88 line-length = 88
select = ["E4", "E7", "E9", "F", "I"] select = ["E4", "E7", "E9", "F", "I", "C4"]
[tool.ruff.lint.isort] [tool.ruff.lint.isort]
known-first-party = [ known-first-party = [