Skip to content

Commit a328ff9

Browse files
committed
Rename variable match to m
1 parent fce272d commit a328ff9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

weechat_script_lint/script.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ def search_regex(
204204
"""
205205
pattern = re.compile(regex, flags=flags)
206206
occur = []
207-
for match in pattern.finditer(self.script):
208-
match_lines = match.group().count("\n") + 1
207+
for m in pattern.finditer(self.script):
208+
match_lines = m.group().count("\n") + 1
209209
if match_lines <= max_lines:
210-
line = match.string[: match.start()].count("\n") + 1
211-
occur.append((line, match))
210+
line = m.string[: m.start()].count("\n") + 1
211+
occur.append((line, m))
212212
return occur
213213

214214
def search_func(
@@ -305,35 +305,35 @@ def _check_modifier_irc_in(self) -> None:
305305
func = self.search_func(
306306
"hook_modifier", r"[\"']irc_in_([^\"']+)[\"']"
307307
)
308-
for line_no, match in func:
308+
for line_no, m in func:
309309
self.message(
310310
"warning",
311311
"modifier_irc_in",
312312
line=line_no,
313-
message=match.group(1),
313+
message=m.group(1),
314314
)
315315

316316
def _check_signals_irc_out(self) -> None:
317317
"""Check if signals irc_out_xxx or irc_outtags_xxx are used."""
318318
func = self.search_func(
319319
"hook_signal", r"[\"'][^\"']+,irc_out_([^\"']+)[\"']"
320320
)
321-
for line_no, match in func:
321+
for line_no, m in func:
322322
self.message(
323323
"warning",
324324
"signal_irc_out",
325325
line=line_no,
326-
message=match.group(1),
326+
message=m.group(1),
327327
)
328328
func = self.search_func(
329329
"hook_signal", r"[\"'][^\"']+,irc_outtags_([^\"']+)[\"']"
330330
)
331-
for line_no, match in func:
331+
for line_no, m in func:
332332
self.message(
333333
"warning",
334334
"signal_irc_outtags",
335335
line=line_no,
336-
message=match.group(1),
336+
message=m.group(1),
337337
)
338338

339339
# === info ===
@@ -350,9 +350,9 @@ def _check_weechat_site(self) -> None:
350350
r"(?:http://[w.]+weechat|https?://www.weechat)(?:\.org|\.net)",
351351
flags=re.IGNORECASE,
352352
)
353-
for line_no, match in links:
353+
for line_no, m in links:
354354
self.message(
355-
"info", "url_weechat", line=line_no, link=match.group()
355+
"info", "url_weechat", line=line_no, link=m.group()
356356
)
357357

358358
# run all checks, display report

0 commit comments

Comments
 (0)