I have the following code to run pylint on all files in a Git repository with file extension .py, fed by command substitution.
pylint $(git ls-files '*.py')
The script runs just fine except when there are no files matching the pattern. However, the pylint utility gives a verbose help message when it is called with no files, which is not what I want - I don't want to call pylint at all.
So, could I ask for some help on how best to test if any files match the filename pattern before calling pylint?
I'm a pylint and bash newbie.