Merge ~twom/launchpad:lint-e713 into launchpad:master

Proposed by Tom Wardill
Status: Merged
Approved by: Tom Wardill
Approved revision: 0fe4849f7a3df3bb0d6b5e010a064a904cc3fb43
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~twom/launchpad:lint-e713
Merge into: launchpad:master
Diff against target: 187 lines (+18/-18)
11 files modified
lib/lp/app/browser/launchpad.py (+1/-1)
lib/lp/app/browser/tales.py (+2/-2)
lib/lp/blueprints/model/specification.py (+1/-1)
lib/lp/code/model/branch.py (+1/-1)
lib/lp/code/model/gitrepository.py (+1/-1)
lib/lp/registry/browser/person.py (+1/-1)
lib/lp/registry/model/product.py (+1/-1)
lib/lp/registry/model/sharingjob.py (+1/-1)
lib/lp/registry/model/sourcepackagename.py (+1/-1)
lib/lp/registry/services/sharingservice.py (+3/-3)
lib/lp/testing/swift/fakeswift.py (+5/-5)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+406631@code.launchpad.net

Commit message

Remove E713 lint violations

To post a comment you must log in.
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

Sorry, for some reason I just top-approved rather than voting there.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/app/browser/launchpad.py b/lib/lp/app/browser/launchpad.py
2index af75881..822f161 100644
3--- a/lib/lp/app/browser/launchpad.py
4+++ b/lib/lp/app/browser/launchpad.py
5@@ -1174,7 +1174,7 @@ def get_launchpad_views(cookies):
6 # The cookie is malformed, possibly hacked.
7 continue
8 key, value = parts
9- if not key in views:
10+ if key not in views:
11 # The cookie may be hacked.
12 continue
13 # 'false' is the value that the browser script sets to disable a
14diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py
15index 37c55de..0ec7220 100644
16--- a/lib/lp/app/browser/tales.py
17+++ b/lib/lp/app/browser/tales.py
18@@ -151,7 +151,7 @@ class MenuLinksDict(dict):
19 self._all_link_names.extend(extras)
20
21 def __getitem__(self, link_name):
22- if not link_name in self._all_link_names:
23+ if link_name not in self._all_link_names:
24 raise KeyError(link_name)
25
26 link = dict.get(self, link_name, None)
27@@ -161,7 +161,7 @@ class MenuLinksDict(dict):
28 else:
29 link = self._menu.initLink(link_name, self._request_url)
30
31- if not link_name in self._extra_link_names:
32+ if link_name not in self._extra_link_names:
33 self._menu.updateLink(link, self._request_url)
34
35 self[link_name] = link
36diff --git a/lib/lp/blueprints/model/specification.py b/lib/lp/blueprints/model/specification.py
37index 404481a..58d57e8 100644
38--- a/lib/lp/blueprints/model/specification.py
39+++ b/lib/lp/blueprints/model/specification.py
40@@ -412,7 +412,7 @@ class Specification(SQLBase, BugLinkTargetMixin, InformationTypeMixin):
41 def _list_to_dict_of_frequency(self, list):
42 dictionary = {}
43 for item in list:
44- if not item in dictionary:
45+ if item not in dictionary:
46 dictionary[item] = 1
47 else:
48 dictionary[item] += 1
49diff --git a/lib/lp/code/model/branch.py b/lib/lp/code/model/branch.py
50index c9a98cd..4e63062 100644
51--- a/lib/lp/code/model/branch.py
52+++ b/lib/lp/code/model/branch.py
53@@ -248,7 +248,7 @@ class Branch(SQLBase, WebhookTargetMixin, BzrIdentityMixin):
54 # For private +junk branches, we calculate the wanted grants.
55 if (not self.product and
56 not self.sourcepackagename and
57- not self.information_type in PUBLIC_INFORMATION_TYPES):
58+ self.information_type not in PUBLIC_INFORMATION_TYPES):
59 aasource = getUtility(IAccessArtifactSource)
60 [abstract_artifact] = aasource.ensure([self])
61 wanted_links = set(
62diff --git a/lib/lp/code/model/gitrepository.py b/lib/lp/code/model/gitrepository.py
63index d5a5b38..d9c351b 100644
64--- a/lib/lp/code/model/gitrepository.py
65+++ b/lib/lp/code/model/gitrepository.py
66@@ -612,7 +612,7 @@ class GitRepository(StormBase, WebhookTargetMixin, GitIdentityMixin):
67 pillars = []
68 # For private personal repositories, we calculate the wanted grants.
69 if (not self.project and not self.distribution and
70- not self.information_type in PUBLIC_INFORMATION_TYPES):
71+ self.information_type not in PUBLIC_INFORMATION_TYPES):
72 aasource = getUtility(IAccessArtifactSource)
73 [abstract_artifact] = aasource.ensure([self])
74 wanted_links = set(
75diff --git a/lib/lp/registry/browser/person.py b/lib/lp/registry/browser/person.py
76index 233113d..28239d7 100644
77--- a/lib/lp/registry/browser/person.py
78+++ b/lib/lp/registry/browser/person.py
79@@ -2862,7 +2862,7 @@ class PersonEditEmailsView(LaunchpadFormView):
80 emailset = set(self.context.unvalidatedemails)
81 emailset = emailset.union(
82 [guessed for guessed in self.context.guessedemails
83- if not guessed.email in emailset])
84+ if guessed.email not in emailset])
85 return emailset
86
87 def validate_action_remove_validated(self, action, data):
88diff --git a/lib/lp/registry/model/product.py b/lib/lp/registry/model/product.py
89index af880bf..9f53c70 100644
90--- a/lib/lp/registry/model/product.py
91+++ b/lib/lp/registry/model/product.py
92@@ -1600,7 +1600,7 @@ def get_precached_products(products, need_licences=False,
93 ProductLicense,
94 ProductLicense.productID.is_in(product_ids)):
95 cache = caches[license.productID]
96- if not license.license in cache._cached_licenses:
97+ if license.license not in cache._cached_licenses:
98 cache._cached_licenses.append(license.license)
99 if need_projectgroups:
100 bulk.load_related(
101diff --git a/lib/lp/registry/model/sharingjob.py b/lib/lp/registry/model/sharingjob.py
102index b123547..2714ed8 100644
103--- a/lib/lp/registry/model/sharingjob.py
104+++ b/lib/lp/registry/model/sharingjob.py
105@@ -354,7 +354,7 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
106
107 @property
108 def information_types(self):
109- if not 'information_types' in self.metadata:
110+ if 'information_types' not in self.metadata:
111 return []
112 return [
113 InformationType.items[value]
114diff --git a/lib/lp/registry/model/sourcepackagename.py b/lib/lp/registry/model/sourcepackagename.py
115index 49e6335..9fe65e1 100644
116--- a/lib/lp/registry/model/sourcepackagename.py
117+++ b/lib/lp/registry/model/sourcepackagename.py
118@@ -144,7 +144,7 @@ def getSourcePackageDescriptions(
119
120 descriptions = {}
121 for binarypackagename, sourcepackagename in cur.fetchall():
122- if not sourcepackagename in descriptions:
123+ if sourcepackagename not in descriptions:
124 descriptions[sourcepackagename] = (
125 "Source of: %s" % binarypackagename)
126 else:
127diff --git a/lib/lp/registry/services/sharingservice.py b/lib/lp/registry/services/sharingservice.py
128index 2e59510..36c89d4 100644
129--- a/lib/lp/registry/services/sharingservice.py
130+++ b/lib/lp/registry/services/sharingservice.py
131@@ -568,7 +568,7 @@ class SharingService:
132 ]
133
134 if (pillar.branch_sharing_policy and
135- not pillar.branch_sharing_policy in allowed_policies):
136+ pillar.branch_sharing_policy not in allowed_policies):
137 allowed_policies.append(pillar.branch_sharing_policy)
138
139 return self._makeEnumData(allowed_policies)
140@@ -596,7 +596,7 @@ class SharingService:
141 ]
142
143 if (pillar.bug_sharing_policy and
144- not pillar.bug_sharing_policy in allowed_policies):
145+ pillar.bug_sharing_policy not in allowed_policies):
146 allowed_policies.append(pillar.bug_sharing_policy)
147
148 return self._makeEnumData(allowed_policies)
149@@ -624,7 +624,7 @@ class SharingService:
150 ]
151
152 if (pillar.specification_sharing_policy and
153- not pillar.specification_sharing_policy in allowed_policies):
154+ pillar.specification_sharing_policy not in allowed_policies):
155 allowed_policies.append(pillar.specification_sharing_policy)
156
157 return self._makeEnumData(allowed_policies)
158diff --git a/lib/lp/testing/swift/fakeswift.py b/lib/lp/testing/swift/fakeswift.py
159index 2039e74..ebd7917 100644
160--- a/lib/lp/testing/swift/fakeswift.py
161+++ b/lib/lp/testing/swift/fakeswift.py
162@@ -124,20 +124,20 @@ class FakeKeystone(resource.Resource):
163 # XXX cjwatson 2020-06-15: Python 3.5 doesn't allow this to be a
164 # binary file; 3.6 does.
165 credentials = json.loads(request.content.read().decode("UTF-8"))
166- if not "auth" in credentials:
167+ if "auth" not in credentials:
168 request.setResponseCode(http.FORBIDDEN)
169 return b""
170- if ((not "tenantName" in credentials["auth"] or
171- not "passwordCredentials" in credentials["auth"])):
172+ if (("tenantName" not in credentials["auth"] or
173+ "passwordCredentials" not in credentials["auth"])):
174 request.setResponseCode(http.FORBIDDEN)
175 return b""
176 tenant_name = credentials["auth"]["tenantName"]
177 pw_creds = credentials["auth"]["passwordCredentials"]
178 username, password = pw_creds.get("username"), pw_creds.get("password")
179- if not tenant_name in self.root.tenants:
180+ if tenant_name not in self.root.tenants:
181 request.setResponseCode(http.FORBIDDEN)
182 return b""
183- if not username in self.users:
184+ if username not in self.users:
185 request.setResponseCode(http.FORBIDDEN)
186 return b""
187 if password != DEFAULT_PASSWORD:

Subscribers

People subscribed via source and target branches

to status/vote changes: