1*9880d681SAndroid Build Coastguard Worker#!/usr/bin/python 2*9880d681SAndroid Build Coastguard Worker# 3*9880d681SAndroid Build Coastguard Worker# Checks files to make sure they conform to LLVM standards which can be applied 4*9880d681SAndroid Build Coastguard Worker# to any programming language: at present, line length and trailing whitespace. 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Workerimport common_lint 7*9880d681SAndroid Build Coastguard Workerimport sys 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Workerclass GenericCodeLint(common_lint.BaseLint): 10*9880d681SAndroid Build Coastguard Worker MAX_LINE_LENGTH = 80 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Worker def RunOnFile(self, filename, lines): 13*9880d681SAndroid Build Coastguard Worker common_lint.VerifyLineLength(filename, lines, 14*9880d681SAndroid Build Coastguard Worker GenericCodeLint.MAX_LINE_LENGTH) 15*9880d681SAndroid Build Coastguard Worker common_lint.VerifyTrailingWhitespace(filename, lines) 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Workerdef GenericCodeLintMain(filenames): 19*9880d681SAndroid Build Coastguard Worker common_lint.RunLintOverAllFiles(GenericCodeLint(), filenames) 20*9880d681SAndroid Build Coastguard Worker return 0 21*9880d681SAndroid Build Coastguard Worker 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Workerif __name__ == '__main__': 24*9880d681SAndroid Build Coastguard Worker sys.exit(GenericCodeLintMain(sys.argv[1:])) 25