fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
⌀
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
342
set_option
ref
function
linter.set_option("jobs", 1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
344
_cpu_count
ref
function
linter.config.jobs = _cpu_count()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
350
check
ref
function
linter.check(args)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
351
generate_reports
ref
function
score_value = linter.generate_reports()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
356
check
ref
function
linter.check(args)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
357
generate_reports
ref
function
score_value = linter.generate_reports()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
369
any_fail_on_issues
ref
function
elif linter.any_fail_on_issues():
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
383
version_asked
def
function
def version_asked(self, _, __): """Callback for version (i.e. before option parsing).""" self._version_asked = _True def cb_set_rcfile(self, name, value): """Callback for option preprocessing (i.e. before option parsing).""" self._rcfile = value def cb_set_output(self, name...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
387
cb_set_rcfile
def
function
def cb_set_rcfile(self, name, value): """Callback for option preprocessing (i.e. before option parsing).""" self._rcfile = value def cb_set_output(self, name, value): """Callback for option preprocessing (i.e. before option parsing).""" self._output = value def cb_add_plugi...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
391
cb_set_output
def
function
def cb_set_output(self, name, value): """Callback for option preprocessing (i.e. before option parsing).""" self._output = value def cb_add_plugins(self, name, value): """Callback for option preprocessing (i.e. before option parsing).""" self._plugins.extend(utils._splitstrip(va...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
395
cb_add_plugins
def
function
def cb_add_plugins(self, name, value): """Callback for option preprocessing (i.e. before option parsing).""" self._plugins.extend(utils._splitstrip(value)) def cb_error_mode(self, *args, **kwargs): """Error mode: * disable all but error messages * disable the 'miscellane...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
397
_splitstrip
ref
function
self._plugins.extend(utils._splitstrip(value))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
399
cb_error_mode
def
function
def cb_error_mode(self, *args, **kwargs): """Error mode: * disable all but error messages * disable the 'miscellaneous' checker which can be safely deactivated in debug * disable reports * do not save execution information """ self.linter.error_mode(...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
407
error_mode
ref
function
self.linter.error_mode()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
409
cb_generate_config
def
function
def cb_generate_config(self, *args, **kwargs): """Optik callback for sample config file generation.""" self.linter.generate_config(skipsections=("COMMANDS",)) sys.exit(0) def cb_generate_manpage(self, *args, **kwargs): """Optik callback for sample config file generation.""" ...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
411
generate_config
ref
function
self.linter.generate_config(skipsections=("COMMANDS",))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
414
cb_generate_manpage
def
function
def cb_generate_manpage(self, *args, **kwargs): """Optik callback for sample config file generation.""" self.linter.generate_manpage(__pkginfo__) sys.exit(0) def cb_help_message(self, option, optname, value, parser): """Optik callback for printing some help about a particular me...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
416
generate_manpage
ref
function
self.linter.generate_manpage(__pkginfo__)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
419
cb_help_message
def
function
def cb_help_message(self, option, optname, value, parser): """Optik callback for printing some help about a particular message.""" self.linter.msgs_store.help_message(utils._splitstrip(value)) sys.exit(0) def cb_full_documentation(self, option, optname, value, parser): """Optik ...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
421
help_message
ref
function
self.linter.msgs_store.help_message(utils._splitstrip(value))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
421
_splitstrip
ref
function
self.linter.msgs_store.help_message(utils._splitstrip(value))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
424
cb_full_documentation
def
function
def cb_full_documentation(self, option, optname, value, parser): """Optik callback for printing full documentation.""" print_full_documentation(self.linter) sys.exit(0) def cb_list_messages(self, option, optname, value, parser): """Optik callback for printing available messages....
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
426
print_full_documentation
ref
function
print_full_documentation(self.linter)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
429
cb_list_messages
def
function
def cb_list_messages(self, option, optname, value, parser): """Optik callback for printing available messages.""" self.linter.msgs_store.list_messages() sys.exit(0) def cb_list_messages_enabled(self, option, optname, value, parser): """Optik callback for printing available messa...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
431
list_messages
ref
function
self.linter.msgs_store.list_messages()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
434
cb_list_messages_enabled
def
function
def cb_list_messages_enabled(self, option, optname, value, parser): """Optik callback for printing available messages.""" self.linter.list_messages_enabled() sys.exit(0) def cb_list_groups(self, *args, **kwargs): """List all the check groups that pylint knows about. The...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
436
list_messages_enabled
ref
function
self.linter.list_messages_enabled()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
439
cb_list_groups
def
function
def cb_list_groups(self, *args, **kwargs): """List all the check groups that pylint knows about. These should be useful to know what check groups someone can disable or enable. """ for check in self.linter.get_checker_names(): print(check) sys.exit(0) ...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
445
get_checker_names
ref
function
for check in self.linter.get_checker_names():
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
449
cb_verbose_mode
def
function
def cb_verbose_mode(self, *args, **kwargs): self.verbose = _True def cb_enable_all_extensions(self, option_name: str, value: None) -> None: """Callback to load and enable all available extensions.""" for filename in os.listdir(os.path.dirname(extensions.__file__)): if filena...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
452
cb_enable_all_extensions
def
function
def cb_enable_all_extensions(self, option_name: str, value: None) -> None: """Callback to load and enable all available extensions.""" for filename in os.listdir(os.path.dirname(extensions.__file__)): if filename.endswith(".py") and not filename.startswith("_"): extension...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/run.py
pylint/lint/run.py
454
dirname
ref
function
for filename in os.listdir(os.path.dirname(extensions.__file__)):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
13
ArgumentPreprocessingError
def
class
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
17
prepare_crash_report
def
function
def prepare_crash_report(ex: Exception, filepath: str, crash_file_path: str) -> Path: issue_template_path = ( Path(PYLINT_HOME) / datetime.now().strftime(str(crash_file_path)) ).resolve() with open(filepath, encoding="utf8") as f: file_content = f.read() template = "" if not issue_te...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
22
read
ref
function
file_content = f.read()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
54
write
ref
function
f.write(template)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
56
write
ref
function
f.write("```\n")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
62
get_fatal_error_message
def
function
def get_fatal_error_message(filepath: str, issue_template_path: Path) -> str: return ( f"Fatal error while checking '{filepath}'. " f"Please open an issue in our bug tracker so we address this. " f"There is a pre-filled template that you can use in '{issue_template_path}'." )
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
70
preprocess_options
def
function
def preprocess_options(args, search_for): """Look for some options (keys of <search_for>) which have to be processed before others values of <search_for> are callback functions to call when the option is found """ i = 0 while i < len(args): arg = args[i] if not arg.startswit...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
96
ArgumentPreprocessingError
ref
function
raise ArgumentPreprocessingError(msg)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
101
ArgumentPreprocessingError
ref
function
raise ArgumentPreprocessingError(msg)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
102
cb
ref
function
cb(option, val)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
105
_patch_sys_path
def
function
def _patch_sys_path(args): original = list(sys.path) changes = [] seen = set() for arg in args: path = get_python_path(arg) if path not in seen: changes.append(path) seen.add(path) sys.path[:] = changes + sys.path return original
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
110
get_python_path
ref
function
path = get_python_path(arg)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
120
fix_import_path
def
function
def fix_import_path(args): """Prepare 'sys.path' for running the linter checks. Within this context, each of the given arguments is importable. Paths are added to 'sys.path' in corresponding order to the arguments. We avoid adding duplicate directories to sys.path. `sys.path` is reset to its origin...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/utils.py
pylint/lint/utils.py
128
_patch_sys_path
ref
function
original = _patch_sys_path(args)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message.py
pylint/message/message.py
33
Message
def
class
__new__ __new__ __new__ format
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message.py
pylint/message/message.py
93
_asdict
ref
function
return template.format(**self._asdict())
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
16
MessageDefinition
def
class
__init__ check_msgid __repr__ __str__ may_be_emitted format_help check_message_definition
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
30
check_msgid
ref
function
self.check_msgid(msgid)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
41
check_msgid
ref
function
self.check_msgid(old_msgid)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
47
check_msgid
def
function
def check_msgid(msgid: str) -> None: if len(msgid) != 5: raise InvalidMessageError(f"Invalid message id {msgid!r}") if msgid[0] not in MSG_TYPES: raise InvalidMessageError(f"Bad message type {msgid[0]} in {msgid!r}") def __repr__(self) -> str: return f"MessageDef...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
49
InvalidMessageError
ref
function
raise InvalidMessageError(f"Invalid message id {msgid!r}")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
51
InvalidMessageError
ref
function
raise InvalidMessageError(f"Bad message type {msgid[0]} in {msgid!r}")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
59
may_be_emitted
def
function
def may_be_emitted(self) -> bool: """Return _True if message may be emitted using the current interpreter.""" if self.minversion is not None and self.minversion > sys.version_info: return _False if self.maxversion is not None and self.maxversion <= sys.version_info: r...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
67
format_help
def
function
null
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
86
normalize_text
ref
function
msg_help = normalize_text(" ".join(desc.split()), indent=" ")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
93
check_message_definition
def
function
def check_message_definition( self, line: Optional[int], node: Optional[nodes.NodeNG] ) -> None: """Check MessageDefinition for possible errors.""" if self.msgid[0] not in _SCOPE_EXEMPT: # Fatal messages and reports are special, the node/scope distinction # does n...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
102
InvalidMessageError
ref
function
raise InvalidMessageError(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
106
InvalidMessageError
ref
function
raise InvalidMessageError(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition.py
pylint/message/message_definition.py
113
InvalidMessageError
ref
function
raise InvalidMessageError(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
15
MessageDefinitionStore
def
class
__init__ messages register_messages_from_checker register_message get_message_definitions get_msg_display_string help_message list_messages find_emittable_messages
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
22
MessageIdStore
ref
function
self.message_id_store: MessageIdStore = MessageIdStore()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
31
messages
def
function
def messages(self) -> ValuesView[MessageDefinition]: """The list of all active messages.""" return self._messages_definitions.values() def register_messages_from_checker(self, checker: "BaseChecker") -> None: """Register all messages definitions from a checker.""" checker.check_...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
35
register_messages_from_checker
def
function
def register_messages_from_checker(self, checker: "BaseChecker") -> None: """Register all messages definitions from a checker.""" checker.check_consistency() for message in checker.messages: self.register_message(message) def register_message(self, message: MessageDefinition...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
37
check_consistency
ref
function
checker.check_consistency()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
39
register_message
ref
function
self.register_message(message)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
41
register_message
def
function
def register_message(self, message: MessageDefinition) -> None: """Register a MessageDefinition with consistency in mind.""" self.message_id_store.register_message_definition( message.msgid, message.symbol, message.old_names ) self._messages_definitions[message.msgid] = m...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
43
register_message_definition
ref
function
self.message_id_store.register_message_definition(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
54
get_message_definitions
def
function
def get_message_definitions(self, msgid_or_symbol: str) -> List[MessageDefinition]: """Returns the Message definition for either a numeric or symbolic id. The cache has no limit as its size will likely stay minimal. For each message we store about 1000 characters, so even if we would have 1...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
63
get_active_msgids
ref
function
for m in self.message_id_store.get_active_msgids(msgid_or_symbol)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
66
get_msg_display_string
def
function
def get_msg_display_string(self, msgid_or_symbol: str) -> str: """Generates a user-consumable representation of a message.""" message_definitions = self.get_message_definitions(msgid_or_symbol) if len(message_definitions) == 1: return repr(message_definitions[0].symbol) r...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
68
get_message_definitions
ref
function
message_definitions = self.get_message_definitions(msgid_or_symbol)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
73
help_message
def
function
def help_message(self, msgids_or_symbols: List[str]) -> None: """Display help messages for the given message identifiers.""" for msgids_or_symbol in msgids_or_symbols: try: for message_definition in self.get_message_definitions( msgids_or_symbol ...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
77
get_message_definitions
ref
function
for message_definition in self.get_message_definitions(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
80
format_help
ref
function
print(message_definition.format_help(checkerref=True))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
87
list_messages
def
function
def list_messages(self) -> None: """Output full messages list documentation in ReST format.""" emittable, non_emittable = self.find_emittable_messages() print("Emittable messages with current interpreter:") for msg in emittable: print(msg.format_help(checkerref=_False)) ...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
89
find_emittable_messages
ref
function
emittable, non_emittable = self.find_emittable_messages()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
92
format_help
ref
function
print(msg.format_help(checkerref=False))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
95
format_help
ref
function
print(msg.format_help(checkerref=False))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
98
find_emittable_messages
def
function
def find_emittable_messages( self, ) -> Tuple[List[MessageDefinition], List[MessageDefinition]]: """Finds all emittable and non-emittable messages.""" messages = sorted(self._messages_definitions.values(), key=lambda m: m.msgid) emittable = [] non_emittable = [] f...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_definition_store.py
pylint/message/message_definition_store.py
106
may_be_emitted
ref
function
if message.may_be_emitted():
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
7
MessageIdStore
def
class
__init__ __len__ __repr__ get_symbol get_msgid register_message_definition add_msgid_and_symbol add_legacy_msgid_and_symbol check_msgid_and_symbol _raise_duplicate_symbol _raise_duplicate_msgid get_active_msgids
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
27
get_symbol
def
function
def get_symbol(self, msgid: str) -> str: try: return self.__msgid_to_symbol[msgid.upper()] except KeyError as e: msg = f"'{msgid}' is not stored in the message store." raise UnknownMessageError(msg) from e def get_msgid(self, symbol: str) -> str: try:...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
32
UnknownMessageError
ref
function
raise UnknownMessageError(msg) from e
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
34
get_msgid
def
function
def get_msgid(self, symbol: str) -> str: try: return self.__symbol_to_msgid[symbol] except KeyError as e: msg = f"'{symbol}' is not stored in the message store." raise UnknownMessageError(msg) from e def register_message_definition( self, msgid: str, ...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
39
UnknownMessageError
ref
function
raise UnknownMessageError(msg) from e
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
41
register_message_definition
def
function
def register_message_definition( self, msgid: str, symbol: str, old_names: List[Tuple[str, str]] ) -> None: self.check_msgid_and_symbol(msgid, symbol) self.add_msgid_and_symbol(msgid, symbol) for old_msgid, old_symbol in old_names: self.check_msgid_and_symbol(old_msgi...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
44
check_msgid_and_symbol
ref
function
self.check_msgid_and_symbol(msgid, symbol)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
45
add_msgid_and_symbol
ref
function
self.add_msgid_and_symbol(msgid, symbol)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
47
check_msgid_and_symbol
ref
function
self.check_msgid_and_symbol(old_msgid, old_symbol)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
48
add_legacy_msgid_and_symbol
ref
function
self.add_legacy_msgid_and_symbol(old_msgid, old_symbol, msgid)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
50
add_msgid_and_symbol
def
function
def add_msgid_and_symbol(self, msgid: str, symbol: str) -> None: """Add valid message id. There is a little duplication with add_legacy_msgid_and_symbol to avoid a function call, this is called a lot at initialization. """ self.__msgid_to_symbol[msgid] = symbol self....
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
59
add_legacy_msgid_and_symbol
def
function
def add_legacy_msgid_and_symbol( self, msgid: str, symbol: str, new_msgid: str ) -> None: """Add valid legacy message id. There is a little duplication with add_msgid_and_symbol to avoid a function call, this is called a lot at initialization. """ self.__msgid_to...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
73
check_msgid_and_symbol
def
function
def check_msgid_and_symbol(self, msgid: str, symbol: str) -> None: existing_msgid: Optional[str] = self.__symbol_to_msgid.get(symbol) existing_symbol: Optional[str] = self.__msgid_to_symbol.get(msgid) if existing_symbol is None and existing_msgid is None: return # both symbol an...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
80
_raise_duplicate_msgid
ref
function
self._raise_duplicate_msgid(symbol, msgid, existing_msgid)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
83
_raise_duplicate_symbol
ref
function
self._raise_duplicate_symbol(msgid, symbol, existing_symbol)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
86
_raise_duplicate_symbol
def
function
def _raise_duplicate_symbol(msgid: str, symbol: str, other_symbol: str) -> NoReturn: """Raise an error when a symbol is duplicated.""" symbols = [symbol, other_symbol] symbols.sort() error_message = f"Message id '{msgid}' cannot have both " error_message += f"'{symbols[0]}' a...
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
92
InvalidMessageError
ref
function
raise InvalidMessageError(error_message)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/message/message_id_store.py
pylint/message/message_id_store.py
95
_raise_duplicate_msgid
def
function
def _raise_duplicate_msgid(symbol: str, msgid: str, other_msgid: str) -> NoReturn: """Raise an error when a msgid is duplicated.""" msgids = [msgid, other_msgid] msgids.sort() error_message = ( f"Message symbol '{symbol}' cannot be used for " f"'{msgids[0]}' a...