Method: pylint.lint.pylinter.PyLinter.enable_fail_on_messages
Calls: 1061, Exceptions: 0, Paths: 4Back
Path 1: 1023 calls (0.96)
None (1023)
1def enable_fail_on_messages(self) -> None:
2 """Enable 'fail on' msgs.
3
4 Convert values in config.fail_on (which might be msg category, msg id,
5 or symbol) to specific msgs, then enable and flag them for later.
6 """
7 fail_on_vals = self.config.fail_on
8 if not fail_on_vals:
9 return
10
11 fail_on_cats = set()
12 fail_on_msgs = set()
13 for val in fail_on_vals:
14 # If value is a category, add category, else add message
15 if val in MSG_TYPES:
16 fail_on_cats.add(val)
17 else:
18 fail_on_msgs.add(val)
19
20 # For every message in every checker, if cat or msg flagged, enable check
21 for all_checkers in self._checkers.values():
22 for checker in all_checkers:
23 for msg in checker.messages:
24 if msg.msgid in fail_on_msgs or msg.symbol in fail_on_msgs:
25 # message id/symbol matched, enable and flag it
26 self.enable(msg.msgid)
27 self.fail_on_symbols.append(msg.symbol)
28 elif msg.msgid[0] in fail_on_cats:
29 # message starts with a category value, flag (but do not enable) it
30 self.fail_on_symbols.append(msg.symbol)
Path 2: 34 calls (0.03)
1def enable_fail_on_messages(self) -> None:
2 """Enable 'fail on' msgs.
3
4 Convert values in config.fail_on (which might be msg category, msg id,
5 or symbol) to specific msgs, then enable and flag them for later.
6 """
7 fail_on_vals = self.config.fail_on
8 if not fail_on_vals:
9 return
10
11 fail_on_cats = set()
12 fail_on_msgs = set()
13 for val in fail_on_vals:
14 # If value is a category, add category, else add message
15 if val in MSG_TYPES:
16 fail_on_cats.add(val)
17 else:
18 fail_on_msgs.add(val)
19
20 # For every message in every checker, if cat or msg flagged, enable check
21 for all_checkers in self._checkers.values():
22 for checker in all_checkers:
23 for msg in checker.messages:
24 if msg.msgid in fail_on_msgs or msg.symbol in fail_on_msgs:
25 # message id/symbol matched, enable and flag it
26 self.enable(msg.msgid)
27 self.fail_on_symbols.append(msg.symbol)
28 elif msg.msgid[0] in fail_on_cats:
29 # message starts with a category value, flag (but do not enable) it
30 self.fail_on_symbols.append(msg.symbol)
Path 3: 3 calls (0.0)
1def enable_fail_on_messages(self) -> None:
2 """Enable 'fail on' msgs.
3
4 Convert values in config.fail_on (which might be msg category, msg id,
5 or symbol) to specific msgs, then enable and flag them for later.
6 """
7 fail_on_vals = self.config.fail_on
8 if not fail_on_vals:
9 return
10
11 fail_on_cats = set()
12 fail_on_msgs = set()
13 for val in fail_on_vals:
14 # If value is a category, add category, else add message
15 if val in MSG_TYPES:
16 fail_on_cats.add(val)
17 else:
18 fail_on_msgs.add(val)
19
20 # For every message in every checker, if cat or msg flagged, enable check
21 for all_checkers in self._checkers.values():
22 for checker in all_checkers:
23 for msg in checker.messages:
24 if msg.msgid in fail_on_msgs or msg.symbol in fail_on_msgs:
25 # message id/symbol matched, enable and flag it
26 self.enable(msg.msgid)
27 self.fail_on_symbols.append(msg.symbol)
28 elif msg.msgid[0] in fail_on_cats:
29 # message starts with a category value, flag (but do not enable) it
30 self.fail_on_symbols.append(msg.symbol)
Path 4: 1 calls (0.0)
1def enable_fail_on_messages(self) -> None:
2 """Enable 'fail on' msgs.
3
4 Convert values in config.fail_on (which might be msg category, msg id,
5 or symbol) to specific msgs, then enable and flag them for later.
6 """
7 fail_on_vals = self.config.fail_on
8 if not fail_on_vals:
9 return
10
11 fail_on_cats = set()
12 fail_on_msgs = set()
13 for val in fail_on_vals:
14 # If value is a category, add category, else add message
15 if val in MSG_TYPES:
16 fail_on_cats.add(val)
17 else:
18 fail_on_msgs.add(val)
19
20 # For every message in every checker, if cat or msg flagged, enable check
21 for all_checkers in self._checkers.values():
22 for checker in all_checkers:
23 for msg in checker.messages:
24 if msg.msgid in fail_on_msgs or msg.symbol in fail_on_msgs:
25 # message id/symbol matched, enable and flag it
26 self.enable(msg.msgid)
27 self.fail_on_symbols.append(msg.symbol)
28 elif msg.msgid[0] in fail_on_cats:
29 # message starts with a category value, flag (but do not enable) it
30 self.fail_on_symbols.append(msg.symbol)