I’m trying to integrate checking my code using pyflakes into a building process. I’ve defined the following target in my Makefile:
pyflakes:
find $(APPLICATION_DIRECTORY) -iname "*.py" -exec pyflakes "{}" \;
The problem is that find returns 0 every time even if there are code issues (pyflakes returns not 0) and make succeeds. Ideally, I want to run the check on every source file and stop make if at least one of -exec failed. Is there a way to achieve this?
I assume there is no way to make
findreturn exit code of-exec.What should work is piping to
xargs: