clint: Reject indented preprocessor directives

This is also not allowed by the style guide:
https://neovim.io/develop/style-guide.xml#Preprocessor_Directives.
This commit is contained in:
ZyX 2016-06-10 22:41:46 +03:00
parent 739f066afe
commit 3676ad4530

View File

@ -2508,6 +2508,11 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
'it is preferred to use the same amount of spaces as preceding '
'indent')
if Match(r'^ +#', line):
error(filename, linenum, 'whitespace/indent', 5,
'Must not indent preprocessor directives, use 1-space indent '
'after the hash')
def GetPreviousNonBlankLine(clean_lines, linenum):
"""Return the most recent non-blank line and its line number.