569 Indicates the use of "is" or "is not" against str, int and bytes. |
569 Indicates the use of "is" or "is not" against str, int and bytes. |
570 """ |
570 """ |
571 message_id = 'F33' |
571 message_id = 'F33' |
572 message = 'use ==/!= to compare str, bytes, and int literals' |
572 message = 'use ==/!= to compare str, bytes, and int literals' |
573 |
573 |
|
574 |
|
575 class FStringMissingPlaceholders(Message): |
|
576 """ |
|
577 Class defining the "Missing Placeholder" message. |
|
578 |
|
579 Indicates that an f-string is missing some placeholders. |
|
580 """ |
|
581 message_id = 'F34' |
|
582 message = 'f-string is missing placeholders' |
|
583 |
|
584 |
|
585 class StringDotFormatExtraPositionalArguments(Message): |
|
586 """ |
|
587 Class defining the "Unused Arguments" message. |
|
588 |
|
589 Indicates that an f-string has unused arguments. |
|
590 """ |
|
591 message_id = 'F35' |
|
592 message = "'...'.format(...) has unused arguments at position(s): %s" |
|
593 |
|
594 def __init__(self, filename, loc, extra_positions): |
|
595 """ |
|
596 Constructor |
|
597 |
|
598 @param filename name of the file (string) |
|
599 @param loc location of the issue |
|
600 @param extra_positions indexes of unused arguments |
|
601 """ |
|
602 Message.__init__(self, filename, loc) |
|
603 self.message_args = (extra_positions,) |
|
604 |
|
605 |
|
606 class StringDotFormatExtraNamedArguments(Message): |
|
607 """ |
|
608 Class defining the "Unused Named Arguments" message. |
|
609 |
|
610 Indicates that an f-string has unused named arguments. |
|
611 """ |
|
612 message_id = 'F36' |
|
613 message = "'...'.format(...) has unused named argument(s): %s" |
|
614 |
|
615 def __init__(self, filename, loc, extra_keywords): |
|
616 """ |
|
617 Constructor |
|
618 |
|
619 @param filename name of the file (string) |
|
620 @param loc location of the issue |
|
621 @param extra_keywords index of unused named arguments |
|
622 """ |
|
623 Message.__init__(self, filename, loc) |
|
624 self.message_args = (extra_keywords,) |
|
625 |
|
626 |
|
627 class StringDotFormatMissingArgument(Message): |
|
628 """ |
|
629 Class defining the "Missing Arguments" message. |
|
630 |
|
631 Indicates that an f-string is missing some arguments. |
|
632 """ |
|
633 message_id = 'F37' |
|
634 message = "'...'.format(...) is missing argument(s) for placeholder(s): %s" |
|
635 |
|
636 def __init__(self, filename, loc, missing_arguments): |
|
637 """ |
|
638 Constructor |
|
639 |
|
640 @param filename name of the file (string) |
|
641 @param loc location of the issue |
|
642 @param missing_arguments missing arguments |
|
643 """ |
|
644 Message.__init__(self, filename, loc) |
|
645 self.message_args = (missing_arguments,) |
|
646 |
|
647 |
|
648 class StringDotFormatMixingAutomatic(Message): |
|
649 """ |
|
650 Class defining the "Mixing Automatic and Manual" message. |
|
651 |
|
652 Indicates that an f-string mixes automatic and manual numbering. |
|
653 """ |
|
654 message_id = 'F38' |
|
655 message = "'...'.format(...) mixes automatic and manual numbering" |
|
656 |
|
657 |
|
658 class StringDotFormatInvalidFormat(Message): |
|
659 """ |
|
660 Class defining the "Invalid Format String" message. |
|
661 |
|
662 Indicates that an f-string contains an invalid format string. |
|
663 """ |
|
664 message_id = 'F39' |
|
665 message = "'...'.format(...) has invalid format string: %s" |
|
666 |
|
667 def __init__(self, filename, loc, error): |
|
668 """ |
|
669 Constructor |
|
670 |
|
671 @param filename name of the file (string) |
|
672 @param loc location of the issue |
|
673 @param error error details |
|
674 """ |
|
675 Message.__init__(self, filename, loc) |
|
676 self.message_args = (error,) |
|
677 |
|
678 |
|
679 class PercentFormatInvalidFormat(Message): |
|
680 """ |
|
681 Class defining the "Invalid Percent Format String" message. |
|
682 |
|
683 Indicates that a percent format has an invalid format string. |
|
684 """ |
|
685 message_id = 'F40' |
|
686 message = "'...' %% ... has invalid format string: %s" |
|
687 |
|
688 def __init__(self, filename, loc, error): |
|
689 """ |
|
690 Constructor |
|
691 |
|
692 @param filename name of the file (string) |
|
693 @param loc location of the issue |
|
694 @param error error details |
|
695 """ |
|
696 Message.__init__(self, filename, loc) |
|
697 self.message_args = (error,) |
|
698 |
|
699 |
|
700 class PercentFormatMixedPositionalAndNamed(Message): |
|
701 """ |
|
702 Class defining the "Mixed Positional and Named" message. |
|
703 |
|
704 Indicates that a percent format has mixed positional and named |
|
705 placeholders. |
|
706 """ |
|
707 message_id = 'F41' |
|
708 message = "'...' %% ... has mixed positional and named placeholders" |
|
709 |
|
710 |
|
711 class PercentFormatUnsupportedFormatCharacter(Message): |
|
712 """ |
|
713 Class defining the "Unsupported Format Character" message. |
|
714 |
|
715 Indicates that a percent format has an unsupported format character. |
|
716 """ |
|
717 message_id = 'F42' |
|
718 message = "'...' %% ... has unsupported format character %r" |
|
719 |
|
720 def __init__(self, filename, loc, c): |
|
721 """ |
|
722 Constructor |
|
723 |
|
724 @param filename name of the file (string) |
|
725 @param loc location of the issue |
|
726 @param c unsupported format character |
|
727 """ |
|
728 Message.__init__(self, filename, loc) |
|
729 self.message_args = (c,) |
|
730 |
|
731 |
|
732 class PercentFormatPositionalCountMismatch(Message): |
|
733 """ |
|
734 Class defining the "Placeholder Substitution Mismatch" message. |
|
735 |
|
736 Indicates that a percent format has a mismatching number of placeholders |
|
737 and substitutions. |
|
738 """ |
|
739 message_id = 'F43' |
|
740 message = "'...' %% ... has %d placeholder(s) but %d substitution(s)" |
|
741 |
|
742 def __init__(self, filename, loc, n_placeholders, n_substitutions): |
|
743 """ |
|
744 Constructor |
|
745 |
|
746 @param filename name of the file (string) |
|
747 @param loc location of the issue |
|
748 @param n_placeholders number of placeholders (integer) |
|
749 @param n_substitutions number of substitutions (integer) |
|
750 """ |
|
751 Message.__init__(self, filename, loc) |
|
752 self.message_args = (n_placeholders, n_substitutions) |
|
753 |
|
754 |
|
755 class PercentFormatExtraNamedArguments(Message): |
|
756 """ |
|
757 Class defining the "Unused Named Arguments" message. |
|
758 |
|
759 Indicates that a percent format has unused named arguments. |
|
760 """ |
|
761 message_id = 'F44' |
|
762 message = "'...' %% ... has unused named argument(s): %s" |
|
763 |
|
764 def __init__(self, filename, loc, extra_keywords): |
|
765 """ |
|
766 Constructor |
|
767 |
|
768 @param filename name of the file (string) |
|
769 @param loc location of the issue |
|
770 @param extra_keywords index of unused named arguments |
|
771 """ |
|
772 Message.__init__(self, filename, loc) |
|
773 self.message_args = (extra_keywords,) |
|
774 |
|
775 |
|
776 class PercentFormatMissingArgument(Message): |
|
777 """ |
|
778 Class defining the "Missing Arguments" message. |
|
779 |
|
780 Indicates that a percent format is missing arguments for some placeholders. |
|
781 """ |
|
782 message_id = 'F45' |
|
783 message = "'...' %% ... is missing argument(s) for placeholder(s): %s" |
|
784 |
|
785 def __init__(self, filename, loc, missing_arguments): |
|
786 """ |
|
787 Constructor |
|
788 |
|
789 @param filename name of the file (string) |
|
790 @param loc location of the issue |
|
791 @param missing_arguments missing arguments |
|
792 """ |
|
793 Message.__init__(self, filename, loc) |
|
794 self.message_args = (missing_arguments,) |
|
795 |
|
796 |
|
797 class PercentFormatExpectedMapping(Message): |
|
798 """ |
|
799 Class defining the "Sequence instead of Mapping" message. |
|
800 |
|
801 Indicates that a percent format expected a mapping but got a sequence. |
|
802 """ |
|
803 message_id = 'F46' |
|
804 message = "'...' %% ... expected mapping but got sequence" |
|
805 |
|
806 |
|
807 class PercentFormatExpectedSequence(Message): |
|
808 """ |
|
809 Class defining the "Mapping instead of Sequence" message. |
|
810 |
|
811 Indicates that a percent format expected a sequence but got a mapping. |
|
812 """ |
|
813 message_id = 'F47' |
|
814 message = "'...' %% ... expected sequence but got mapping" |
|
815 |
|
816 |
|
817 class PercentFormatStarRequiresSequence(Message): |
|
818 """ |
|
819 Class defining the "'*' Requires Sequence" message. |
|
820 |
|
821 Indicates that a percent format expected a sequence. |
|
822 """ |
|
823 message_id = 'F48' |
|
824 message = "'...' %% ... `*` specifier requires sequence" |
|
825 |
574 # |
826 # |
575 # eflag: noqa = M702 |
827 # eflag: noqa = M702 |