Skip to content

Commit 601cacf

Browse files
committed
BadCommandsCheck: pull regexes outside file line loop
1 parent c377c48 commit 601cacf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pkgcheck/checks/codingstyle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ def regexes(self):
181181

182182
def feed(self, entry):
183183
pkg, lines = entry
184+
regexes = self.regexes[str(pkg.eapi)]
184185
for lineno, line in enumerate(lines, 1):
185186
line = line.strip()
186187
if not line:
187188
continue
188189
if line[0] != '#':
189-
eapi_str = str(pkg.eapi)
190-
for regex, result_cls, kwargs in self.regexes[eapi_str]:
190+
for regex, result_cls, kwargs in regexes:
191191
match = regex.match(line)
192192
if match is not None:
193193
yield result_cls(match.group('cmd'), line, lineno, pkg=pkg, **kwargs)

0 commit comments

Comments
 (0)