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

后端 未结 14 2198
眼角桃花
眼角桃花 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:42

    To run Pylint on all code in Git version control,

    pylint $(git ls-files '*.py')
    

    This is very fast, as Git already knows the names of all of your files. It also works on macOS which lacks Bash 4. However it won't lint files that are very new and haven't been git added to the repos yet.

提交回复
热议问题