find ~/bazel/src/main/webapp/lib -type f | grep -v "lib/deps/" | grep -v "lib/ext/" | grep -v "XG_MessageCatalog_" | xargs -I{} -L1 sh -c "echo {}; phpcs -d memory_limit=1024M -p -n -s --standard=/Users/bakert/Desktop/BazelCodingStandard {}"
Edit: Better:
#!/bin/env ruby
BAZEL_HOME = '/Users/bakert/bazel'
STANDARD_PATH = '/Users/bakert/Desktop/BazelCodingStandard'
VERBOSE = false
def main
exclude_patterns = [ /XG_MessageCatalog_/, /\/lib\/deps\//, /\/lib\/ext\// ]
files = Dir.glob("#{BAZEL_HOME}/src/main/webapp/**/*").reject do |f|
exclude_patterns.any? { |p| f.match(p) } \
|| ! File.file?(f) \
|| File.extname(f) != '.php'
end
files.each do |f|
puts f if VERBOSE
print %x[phpcs -d memory_limit=1024M -n -s --standard=#{STANDARD_PATH} #{f}]
end
end
main

Thankyou, Sir, for showing us the way to the STANDARD_PATH.