Commit 2030cc21 authored by Matt Wala's avatar Matt Wala
Browse files

run-pylint.py: Log and display command line

parent 4968a8a9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
#!/usr/bin/env python
#!/usr/bin/env python3
"""This script allows using Pylint with YAML-based config files.

The usage of this script is identical to Pylint, except that this script accepts
@@ -26,10 +26,14 @@ This example is equivalent to invoking pylint with the options
"""

import sys
import logging
import shlex

import pylint.lint
import yaml

logger = logging.getLogger(__name__)


def generate_args_from_yaml(input_yaml):
    """Generate a list of strings suitable for use as Pylint args, from YAML.
@@ -69,8 +73,10 @@ def main():
        else:
            args.append(arg)

    logger.info("pylint %s", " ".join(shlex.quote(arg) for arg in args))
    pylint.lint.Run(args)


if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)
    main()