TLDR; you can achieve it by doing pylint src/app src/backend; if [ $(( $? & 2 )) -eq 2 ]; then exit 1; else exit 0; fi
As we can see in @pierre-sassoulas's answer, Pylint's exit codes can be represented in binary as:
Fatal (1) - 00001
Error (2) - 00010
Warning (4) - 00100
Convention (8) - 01000
Refactor (16) - 10000
Information (NA)
Pylint outputs the sum of the message categories found. So anything that has an error will have the second bit (counting from the right) with a 1. We can figure out if there were any errors in the Pylint report using the bitwise AND operator.
pylint src/app src/backend; if [ $(( $? & 2 )) -eq 2 ]; then exit 1; else exit 0; fi
We first run pylint, and then check if the bitwise AND operator between Pylint's exit code and 2 is equal to 2. If it is, then an error was found in the report, and the exit code of the command will be 1, otherwise the exit code is 0.