mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00
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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user