Run Pylint for all Python files in a directory and all subdirectories

后端 未结 14 2165
眼角桃花
眼角桃花 2021-01-30 19:45

I have

find . -iname \"*.py\" -exec pylint -E {} ;\\

and

FILES=$(find . -iname \"*.py\")
pylint -E $FILES

If

14条回答
  •  情歌与酒
    2021-01-30 20:24

    Im using the "pylint_runner" in order to run pylint on all files in the directory and the subdirectories. Python 3.7.4

    pylint_runner 0.54

    pylint 2.4.1

    https://pypi.org/project/pylint_runner/

    Here is the command to run it from the Docker container:

    docker run -i --rm --name my_container \
      -v "$PWD":"$PWD" -w "$PWD" \
        python:3.7 \
          /bin/sh -c "pip3 install -r requirements.txt; pylint_runner -v"
    

    requirements.txt - should exist in the "$PWD" directory and contain "pylint_runner" entry.

提交回复
热议问题