mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +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 '
|
'it is preferred to use the same amount of spaces as preceding '
|
||||||
'indent')
|
'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):
|
def GetPreviousNonBlankLine(clean_lines, linenum):
|
||||||
"""Return the most recent non-blank line and its line number.
|
"""Return the most recent non-blank line and its line number.
|
||||||
|
Reference in New Issue
Block a user