diff options
author | ZyX <kp-pav@yandex.ru> | 2016-06-10 22:41:46 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-06-11 00:08:58 +0300 |
commit | 3676ad453028990ccc781fd076ece9a406423502 (patch) | |
tree | 26f8610e82dd5b22a8c7ac7585c937526c3fd93c /src/clint.py | |
parent | 739f066afee351ebb96a5f14a2721c9d78ab92c4 (diff) | |
download | rneovim-3676ad453028990ccc781fd076ece9a406423502.tar.gz rneovim-3676ad453028990ccc781fd076ece9a406423502.tar.bz2 rneovim-3676ad453028990ccc781fd076ece9a406423502.zip |
clint: Reject indented preprocessor directives
This is also not allowed by the style guide:
https://neovim.io/develop/style-guide.xml#Preprocessor_Directives.
Diffstat (limited to 'src/clint.py')
-rwxr-xr-x | src/clint.py | 5 |
1 files changed, 5 insertions, 0 deletions
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. |