generic_lint.py 683 B

123456789101112131415161718192021222324
  1. #!/usr/bin/python
  2. #
  3. # Checks files to make sure they conform to LLVM standards which can be applied
  4. # to any programming language: at present, line length and trailing whitespace.
  5. import common_lint
  6. import sys
  7. class GenericCodeLint(common_lint.BaseLint):
  8. MAX_LINE_LENGTH = 80
  9. def RunOnFile(self, filename, lines):
  10. common_lint.VerifyLineLength(filename, lines,
  11. GenericCodeLint.MAX_LINE_LENGTH)
  12. common_lint.VerifyTrailingWhitespace(filename, lines)
  13. def GenericCodeLintMain(filenames):
  14. common_lint.RunLintOverAllFiles(GenericCodeLint(), filenames)
  15. return 0
  16. if __name__ == '__main__':
  17. sys.exit(GenericCodeLintMain(sys.argv[1:]))