--- a/eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py Tue Feb 04 18:34:37 2020 +0100 +++ b/eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py Tue Feb 04 19:41:50 2020 +0100 @@ -571,5 +571,257 @@ message_id = 'F33' message = 'use ==/!= to compare str, bytes, and int literals' + +class FStringMissingPlaceholders(Message): + """ + Class defining the "Missing Placeholder" message. + + Indicates that an f-string is missing some placeholders. + """ + message_id = 'F34' + message = 'f-string is missing placeholders' + + +class StringDotFormatExtraPositionalArguments(Message): + """ + Class defining the "Unused Arguments" message. + + Indicates that an f-string has unused arguments. + """ + message_id = 'F35' + message = "'...'.format(...) has unused arguments at position(s): %s" + + def __init__(self, filename, loc, extra_positions): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param extra_positions indexes of unused arguments + """ + Message.__init__(self, filename, loc) + self.message_args = (extra_positions,) + + +class StringDotFormatExtraNamedArguments(Message): + """ + Class defining the "Unused Named Arguments" message. + + Indicates that an f-string has unused named arguments. + """ + message_id = 'F36' + message = "'...'.format(...) has unused named argument(s): %s" + + def __init__(self, filename, loc, extra_keywords): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param extra_keywords index of unused named arguments + """ + Message.__init__(self, filename, loc) + self.message_args = (extra_keywords,) + + +class StringDotFormatMissingArgument(Message): + """ + Class defining the "Missing Arguments" message. + + Indicates that an f-string is missing some arguments. + """ + message_id = 'F37' + message = "'...'.format(...) is missing argument(s) for placeholder(s): %s" + + def __init__(self, filename, loc, missing_arguments): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param missing_arguments missing arguments + """ + Message.__init__(self, filename, loc) + self.message_args = (missing_arguments,) + + +class StringDotFormatMixingAutomatic(Message): + """ + Class defining the "Mixing Automatic and Manual" message. + + Indicates that an f-string mixes automatic and manual numbering. + """ + message_id = 'F38' + message = "'...'.format(...) mixes automatic and manual numbering" + + +class StringDotFormatInvalidFormat(Message): + """ + Class defining the "Invalid Format String" message. + + Indicates that an f-string contains an invalid format string. + """ + message_id = 'F39' + message = "'...'.format(...) has invalid format string: %s" + + def __init__(self, filename, loc, error): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param error error details + """ + Message.__init__(self, filename, loc) + self.message_args = (error,) + + +class PercentFormatInvalidFormat(Message): + """ + Class defining the "Invalid Percent Format String" message. + + Indicates that a percent format has an invalid format string. + """ + message_id = 'F40' + message = "'...' %% ... has invalid format string: %s" + + def __init__(self, filename, loc, error): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param error error details + """ + Message.__init__(self, filename, loc) + self.message_args = (error,) + + +class PercentFormatMixedPositionalAndNamed(Message): + """ + Class defining the "Mixed Positional and Named" message. + + Indicates that a percent format has mixed positional and named + placeholders. + """ + message_id = 'F41' + message = "'...' %% ... has mixed positional and named placeholders" + + +class PercentFormatUnsupportedFormatCharacter(Message): + """ + Class defining the "Unsupported Format Character" message. + + Indicates that a percent format has an unsupported format character. + """ + message_id = 'F42' + message = "'...' %% ... has unsupported format character %r" + + def __init__(self, filename, loc, c): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param c unsupported format character + """ + Message.__init__(self, filename, loc) + self.message_args = (c,) + + +class PercentFormatPositionalCountMismatch(Message): + """ + Class defining the "Placeholder Substitution Mismatch" message. + + Indicates that a percent format has a mismatching number of placeholders + and substitutions. + """ + message_id = 'F43' + message = "'...' %% ... has %d placeholder(s) but %d substitution(s)" + + def __init__(self, filename, loc, n_placeholders, n_substitutions): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param n_placeholders number of placeholders (integer) + @param n_substitutions number of substitutions (integer) + """ + Message.__init__(self, filename, loc) + self.message_args = (n_placeholders, n_substitutions) + + +class PercentFormatExtraNamedArguments(Message): + """ + Class defining the "Unused Named Arguments" message. + + Indicates that a percent format has unused named arguments. + """ + message_id = 'F44' + message = "'...' %% ... has unused named argument(s): %s" + + def __init__(self, filename, loc, extra_keywords): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param extra_keywords index of unused named arguments + """ + Message.__init__(self, filename, loc) + self.message_args = (extra_keywords,) + + +class PercentFormatMissingArgument(Message): + """ + Class defining the "Missing Arguments" message. + + Indicates that a percent format is missing arguments for some placeholders. + """ + message_id = 'F45' + message = "'...' %% ... is missing argument(s) for placeholder(s): %s" + + def __init__(self, filename, loc, missing_arguments): + """ + Constructor + + @param filename name of the file (string) + @param loc location of the issue + @param missing_arguments missing arguments + """ + Message.__init__(self, filename, loc) + self.message_args = (missing_arguments,) + + +class PercentFormatExpectedMapping(Message): + """ + Class defining the "Sequence instead of Mapping" message. + + Indicates that a percent format expected a mapping but got a sequence. + """ + message_id = 'F46' + message = "'...' %% ... expected mapping but got sequence" + + +class PercentFormatExpectedSequence(Message): + """ + Class defining the "Mapping instead of Sequence" message. + + Indicates that a percent format expected a sequence but got a mapping. + """ + message_id = 'F47' + message = "'...' %% ... expected sequence but got mapping" + + +class PercentFormatStarRequiresSequence(Message): + """ + Class defining the "'*' Requires Sequence" message. + + Indicates that a percent format expected a sequence. + """ + message_id = 'F48' + message = "'...' %% ... `*` specifier requires sequence" + # # eflag: noqa = M702