mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	build(clint): make NOLINT work with header checks (#31281)
Problem: NOLINT doesn't work with header checks. Solution: Move these checks after ProcessLine() calls.
This commit is contained in:
		
							
								
								
									
										14
									
								
								src/clint.py
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/clint.py
									
									
									
									
									
								
							| @@ -897,7 +897,7 @@ def CheckIncludes(filename, lines, error): | |||||||
|             if (not name.endswith('.h.generated.h') and |             if (not name.endswith('.h.generated.h') and | ||||||
|                     not name.endswith('/defs.h') and |                     not name.endswith('/defs.h') and | ||||||
|                     not name.endswith('_defs.h') and |                     not name.endswith('_defs.h') and | ||||||
|                     not name.endswith('h.inline.generated.h') and |                     not name.endswith('.h.inline.generated.h') and | ||||||
|                     not name.endswith('_defs.generated.h') and |                     not name.endswith('_defs.generated.h') and | ||||||
|                     not name.endswith('_enum.generated.h')): |                     not name.endswith('_enum.generated.h')): | ||||||
|                 error(filename, i, 'build/include_defs', 5, |                 error(filename, i, 'build/include_defs', 5, | ||||||
| @@ -2206,12 +2206,6 @@ def ProcessFileData(filename, file_extension, lines, error, | |||||||
|  |  | ||||||
|         error = RecordedError |         error = RecordedError | ||||||
|  |  | ||||||
|     if file_extension == 'h': |  | ||||||
|         CheckForHeaderGuard(filename, lines, error) |  | ||||||
|         CheckIncludes(filename, lines, error) |  | ||||||
|         if filename.endswith('/defs.h') or filename.endswith('_defs.h'): |  | ||||||
|             CheckNonSymbols(filename, lines, error) |  | ||||||
|  |  | ||||||
|     RemoveMultiLineComments(filename, lines, error) |     RemoveMultiLineComments(filename, lines, error) | ||||||
|     clean_lines = CleansedLines(lines, init_lines) |     clean_lines = CleansedLines(lines, init_lines) | ||||||
|     for line in range(clean_lines.NumLines()): |     for line in range(clean_lines.NumLines()): | ||||||
| @@ -2219,6 +2213,12 @@ def ProcessFileData(filename, file_extension, lines, error, | |||||||
|                     nesting_state, error, |                     nesting_state, error, | ||||||
|                     extra_check_functions) |                     extra_check_functions) | ||||||
|  |  | ||||||
|  |     if file_extension == 'h': | ||||||
|  |         CheckForHeaderGuard(filename, lines, error) | ||||||
|  |         CheckIncludes(filename, lines, error) | ||||||
|  |         if filename.endswith('/defs.h') or filename.endswith('_defs.h'): | ||||||
|  |             CheckNonSymbols(filename, lines, error) | ||||||
|  |  | ||||||
|     # We check here rather than inside ProcessLine so that we see raw |     # We check here rather than inside ProcessLine so that we see raw | ||||||
|     # lines rather than "cleaned" lines. |     # lines rather than "cleaned" lines. | ||||||
|     CheckForBadCharacters(filename, lines, error) |     CheckForBadCharacters(filename, lines, error) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq