From 3676ad453028990ccc781fd076ece9a406423502 Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 10 Jun 2016 22:41:46 +0300 Subject: [PATCH] clint: Reject indented preprocessor directives This is also not allowed by the style guide: https://neovim.io/develop/style-guide.xml#Preprocessor_Directives. --- src/clint.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/clint.py b/src/clint.py index 1bbe3d71de..0cf89ad12f 100755 --- a/src/clint.py +++ b/src/clint.py @@ -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.