Exemple #1
0
def check_pyflakes(files, options):
    # type: (List[str], argparse.Namespace) -> bool
    suppress_patterns = [
        ("scripts/lib/pythonrc.py", "imported but unused"),
        # Intentionally imported by zerver/lib/webhooks/common.py
        ('',
         "'zerver.lib.exceptions.UnexpectedWebhookEventType' imported but unused"
         ),

        # Our ipython startup pythonrc file intentionally imports *
        ("scripts/lib/pythonrc.py",
         " import *' used; unable to detect undefined names"),

        # Special dev_settings.py import
        ('', "from .prod_settings_template import *"),
        ("settings.py",
         "settings import *' used; unable to detect undefined names"),
        ("settings.py", "may be undefined, or defined from star imports"),

        # Sphinx adds `tags` specially to the environment when running conf.py.
        ("docs/conf.py", "undefined name 'tags'"),
    ]
    if options.full:
        suppress_patterns = []
    return run_pyflakes(files, options, suppress_patterns)
Exemple #2
0
def check_pyflakes(files: List[str], options: argparse.Namespace) -> bool:
    suppress_patterns = [
        ("scripts/lib/pythonrc.py", "imported but unused"),
        # Intentionally imported by zerver/lib/webhooks/common.py
        ('',
         "'zerver.lib.exceptions.UnexpectedWebhookEventType' imported but unused"
         ),

        # Our ipython startup pythonrc file intentionally imports *
        ("scripts/lib/pythonrc.py",
         " import *' used; unable to detect undefined names"),
        ("zerver/views/realm.py",
         "local variable 'message_retention_days' is assigned to but never used"
         ),
        ("settings.py",
         "settings import *' used; unable to detect undefined names"),
        ("settings.py",
         "'from .prod_settings_template import *' used; unable to detect undefined names"
         ),
        ("settings.py", "settings.*' imported but unused"),
        ("settings.py", "'.prod_settings_template.*' imported but unused"),

        # Sphinx adds `tags` specially to the environment when running conf.py.
        ("docs/conf.py", "undefined name 'tags'"),
    ]
    if options.full:
        suppress_patterns = []
    return run_pyflakes(files, options, suppress_patterns)
Exemple #3
0
def check_pyflakes(files: List[str], options: argparse.Namespace) -> bool:
    suppress_patterns = [
        ("scripts/lib/pythonrc.py", "imported but unused"),
        # LDAP imports are necessary for docker-zulip.
        ("zproject/prod_settings_template.py", "imported but unused"),
        # Our ipython startup pythonrc file intentionally imports *
        ("scripts/lib/pythonrc.py",
         " import *' used; unable to detect undefined names"),
        (
            "zerver/views/realm.py",
            "local variable 'message_retention_days' is assigned to but never used",
        ),
        ("settings.py",
         "settings import *' used; unable to detect undefined names"),
        (
            "settings.py",
            "'from .prod_settings_template import *' used; unable to detect undefined names",
        ),
        ("settings.py", "settings.*' imported but unused"),
        ("settings.py", "'.prod_settings_template.*' imported but unused"),
        # Sphinx adds `tags` specially to the environment when running conf.py.
        ("docs/conf.py", "undefined name 'tags'"),
    ]
    if options.full:
        suppress_patterns = []
    return run_pyflakes(files, options, suppress_patterns)
Exemple #4
0
def check_pyflakes(files, options):
    # type: (List[str], argparse.Namespace) -> bool
    suppress_patterns = [
        (b"scripts/lib/pythonrc.py", b"imported but unused"),
        (b'', b"'scripts.lib.setup_path_on_import' imported but unused"),

        # Our ipython startup pythonrc file intentionally imports *
        (b"scripts/lib/pythonrc.py",
         b" import *' used; unable to detect undefined names"),

        # Special dev_settings.py import
        (b'', b"from .prod_settings_template import *"),
        (b"settings.py",
         b"settings import *' used; unable to detect undefined names"),
        (b"settings.py", b"may be undefined, or defined from star imports"),

        # Sphinx adds `tags` specially to the environment when running conf.py.
        (b"docs/conf.py", b"undefined name 'tags'"),
    ]
    return run_pyflakes(files, options, suppress_patterns)