summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lint/generic_lint.py
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2009-01-02 21:15:30 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2009-01-02 21:15:30 +0000
commit9d7b49bfd151717898e7886acb7a4000bbc16472 (patch)
treec71ff42f189447bb8f520abc053a80719ad13c6d /llvm/utils/lint/generic_lint.py
parent6d24def98afe645cc7ec8744637f7e7aae0737dc (diff)
downloadbcm5719-llvm-9d7b49bfd151717898e7886acb7a4000bbc16472.tar.gz
bcm5719-llvm-9d7b49bfd151717898e7886acb7a4000bbc16472.zip
Added some basic lint tools for C++ and generic lint tool applicable to all
types of files (TableGen, LLVM assembly, HTML files, etc.) llvm-svn: 61592
Diffstat (limited to 'llvm/utils/lint/generic_lint.py')
-rwxr-xr-xllvm/utils/lint/generic_lint.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/utils/lint/generic_lint.py b/llvm/utils/lint/generic_lint.py
new file mode 100755
index 00000000000..c8f4835bb6a
--- /dev/null
+++ b/llvm/utils/lint/generic_lint.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+#
+# Checks files to make sure they conform to LLVM standards which can be applied
+# to any programming language: at present, line length and trailing whitespace.
+
+import common_lint
+import sys
+
+class GenericCodeLint(common_lint.BaseLint):
+ MAX_LINE_LENGTH = 80
+
+ def RunOnFile(self, filename, lines):
+ common_lint.VerifyLineLength(filename, lines,
+ GenericCodeLint.MAX_LINE_LENGTH)
+ common_lint.VerifyTrailingWhitespace(filename, lines)
+
+
+def GenericCodeLintMain(filenames):
+ common_lint.RunLintOverAllFiles(GenericCodeLint(), filenames)
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(GenericCodeLintMain(sys.argv[1:]))
OpenPOWER on IntegriCloud