mirror of
				https://github.com/koalaman/shellcheck.git
				synced 2025-10-25 09:50:45 +08:00 
			
		
		
		
	Expose (some) span information in TTY output
This commit is contained in:
		| @@ -78,7 +78,14 @@ outputForFile color sys comments = do | |||||||
| cuteIndent :: PositionedComment -> String | cuteIndent :: PositionedComment -> String | ||||||
| cuteIndent comment = | cuteIndent comment = | ||||||
|     replicate (fromIntegral $ colNo comment - 1) ' ' ++ |     replicate (fromIntegral $ colNo comment - 1) ' ' ++ | ||||||
|         "^-- " ++ code (codeNo comment) ++ ": " ++ messageText comment |         makeArrow ++ " " ++ code (codeNo comment) ++ ": " ++ messageText comment | ||||||
|  |   where | ||||||
|  |     arrow n = '^' : replicate (fromIntegral $ n-2) '-' ++ "^" | ||||||
|  |     makeArrow = | ||||||
|  |         let sameLine = lineNo comment == endLineNo comment | ||||||
|  |             delta = endColNo comment - colNo comment | ||||||
|  |         in | ||||||
|  |             if sameLine && delta > 2 && delta < 32 then arrow delta else "^--" | ||||||
|  |  | ||||||
| code code = "SC" ++ show code | code code = "SC" ++ show code | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user