Python pylint.lint.Run() Examples

The following are 30 code examples of pylint.lint.Run(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pylint.lint , or try the search function .
Example #1
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #2
Source File: pavement.py    From qgis-geoserver-plugin with GNU General Public License v2.0 6 votes vote down vote up
def autopep8(args):
    """Format code according to PEP8
    """
    try:
        import autopep8
    except:
        error('autopep8 not found! Run "paver install_devtools".')
        sys.exit(1)

    if any(x not in args for x in ['-i', '--in-place']):
        args.append('-i')

    args.append('--ignore=E261,E265,E402,E501')
    args.insert(0, 'dummy')

    cmd_args = autopep8.parse_args(args)

    excludes = ('ext-lib', 'ext-src')
    for p in options.plugin.source_dir.walk():
        if any(exclude in p for exclude in excludes):
            continue

        if p.fnmatch('*.py'):
            autopep8.fix_file(p, options=cmd_args) 
Example #3
Source File: pavement.py    From qgis-geoserver-plugin with GNU General Public License v2.0 6 votes vote down vote up
def pep8(args):
    """Check code for PEP8 violations"""
    try:
        import pep8
    except:
        error('pep8 not found! Run "paver install_devtools".')
        sys.exit(1)

    # Errors to ignore
    ignore = ['E203', 'E121', 'E122', 'E123', 'E124', 'E125', 'E126', 'E127',
        'E128', 'E402']
    styleguide = pep8.StyleGuide(ignore=ignore,
                                 exclude=['*/extlibs/*', '*/ext-src/*'],
                                 repeat=True, max_line_length=79,
                                 parse_argv=args)
    styleguide.input_dir(options.plugin.source_dir)
    info('===== PEP8 SUMMARY =====')
    styleguide.options.report.print_statistics() 
Example #4
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #5
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #6
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #7
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #8
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #9
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #10
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #11
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #12
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #13
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #14
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #15
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #16
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #17
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #18
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #19
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #20
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #21
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #22
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #23
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #24
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #25
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #26
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #27
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #28
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #29
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status 
Example #30
Source File: custom_pylint.py    From storage with MIT License 6 votes vote down vote up
def main():
    """
    Script entry point. Return exit code.
    """

    args, include_pattern, exclude_pattern = probe_args()
    if "-h" in args or "--help" in args:
        print_line(__doc__)
        return 0
    if os.getenv("RUN_PYLINT_DISABLED", "") != "":
        return 0
    files = probe_dir(
        os.getcwd(), re.compile(include_pattern), re.compile(exclude_pattern)
    )
    if not files:
        return 0
    show_files(files)
    args.extend(files)
    sys.argv[0] = "pylint"
    return Run(args, None, False).linter.msg_status