mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-27 22:41:10 +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:
34
test/command_callback/test_cs_mcs_command_callbacks.vader
Normal file
34
test/command_callback/test_cs_mcs_command_callbacks.vader
Normal file
@@ -0,0 +1,34 @@
|
||||
Before:
|
||||
Save g:ale_cs_mcs_options
|
||||
|
||||
unlet! g:ale_cs_mcs_options
|
||||
|
||||
runtime ale_linters/cs/mcs.vim
|
||||
|
||||
let b:command_tail = ' -unsafe --parse'
|
||||
|
||||
After:
|
||||
Restore
|
||||
unlet! b:command_tail
|
||||
unlet! b:ale_cs_mcs_options
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(Check for proper default command):
|
||||
|
||||
let b:command = ale_linters#cs#mcs#GetCommand(bufnr(''))
|
||||
let b:command = substitute(b:command,'\s\+',' ','g')
|
||||
|
||||
AssertEqual
|
||||
\ b:command,
|
||||
\ 'mcs -unsafe --parse %t'
|
||||
|
||||
Execute(The options should be be used in the command):
|
||||
|
||||
let b:ale_cs_mcs_options = '-pkg:dotnet'
|
||||
let b:command = ale_linters#cs#mcs#GetCommand(bufnr(''))
|
||||
let b:command = substitute(b:command,'\s\+',' ','g')
|
||||
|
||||
AssertEqual
|
||||
\ b:command,
|
||||
\ 'mcs' . b:command_tail . ' ' . b:ale_cs_mcs_options . ' %t',
|
||||
|
||||
Reference in New Issue
Block a user