Last active
August 28, 2018 07:09
-
-
Save pansila/6b2a725917e421cf4b33e0111bcfec27 to your computer and use it in GitHub Desktop.
Patch of cpplint to detect mixture uses of tabs and spaces for indent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cpplint.py b/cpplint.py | |
index 95c0c32..b8cabad 100755 | |
--- a/cpplint.py | |
+++ b/cpplint.py | |
@@ -4466,6 +4466,9 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, | |
if line.find('\t') != -1: | |
error(filename, linenum, 'whitespace/tab', 1, | |
'Tab found; better to use spaces') | |
+ if Match('^\s* \t', line) or Match('^\s*\t ', line): | |
+ error(filename, linenum, 'whitespace/indent', 1, | |
+ 'Indent with mixture of tabs and spaces is not allowed') | |
# One or three blank spaces at the beginning of the line is weird; it's | |
# hard to reconcile that with 2-space indents. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment