mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 04:52:29 +08:00
Implemented review recommendations
Implements suggestions and recommendations suggested by the first review of the "Advance C# linter based on mcs -t:module (#952)" pull request. - Clarifies and simplifies description of linters and options - Added links to help file and marked the mcsc linter as to be run only when file in buffer is saved or loaded. - Added comments to the mcsc.vim file to clarify code - removed type checks considered not necessary be reviewer. - addresses findings by vader - removed call to getcwd and cd in vim script - handler expands file names relative to route of source tree into absolute pathes. Fixes errors not being marked when vim is started from subdirectory of source tree. - implements tests for mcs.vim and mcsc.vim linter
This commit is contained in:
44
test/handler/test_mcsc_handler.vader
Normal file
44
test/handler/test_mcsc_handler.vader
Normal file
@@ -0,0 +1,44 @@
|
||||
Before:
|
||||
Save g:ale_cs_mcsc_source
|
||||
|
||||
unlet! g:ale_cs_mcsc_source
|
||||
|
||||
runtime ale_linters/cs/mcsc.vim
|
||||
|
||||
After:
|
||||
unlet! g:ale_cs_mcsc_source
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The mcs handler should handle cannot find symbol errors):
|
||||
let g:ale_cs_mcsc_source='/home/foo/project/bar'
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 12,
|
||||
\ 'col' : 29,
|
||||
\ 'text': 'error CS1001: ; expected',
|
||||
\ 'type': 'E',
|
||||
\ 'filename': '/home/foo/project/bar/Test.cs'
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 101,
|
||||
\ 'col': 0,
|
||||
\ 'text': 'error CS1028: Unexpected processor directive (no #if for this #endif)',
|
||||
\ 'type': 'E',
|
||||
\ 'filename': '/home/foo/project/bar/Test.cs'
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 10,
|
||||
\ 'col': 12,
|
||||
\ 'text': 'warning CS0123: some warning',
|
||||
\ 'type': 'W',
|
||||
\ 'filename': '/home/foo/project/bar/Test.cs'
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#cs#mcsc#Handle(347, [
|
||||
\ 'Test.cs(12,29): error CS1001: ; expected',
|
||||
\ 'Test.cs(101,0): error CS1028: Unexpected processor directive (no #if for this #endif)',
|
||||
\ 'Test.cs(10,12): warning CS0123: some warning',
|
||||
\ 'Compilation failed: 2 error(s), 1 warnings',
|
||||
\ ])
|
||||
Reference in New Issue
Block a user