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

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

    If your goal is to run pylint on all files in the current working directory and subfolders, here is one workaround. This script runs pylint on the current directory. If __init__.py does not exist, it creates it, runs pylint, then removes it.

    #! /bin/bash -
    if [[ ! -e __init__.py ]]; then
        touch __init__.py
        pylint `pwd`
        rm __init__.py
    else
        pylint `pwd`
    fi
    

提交回复
热议问题