2019-06-03 22:40:22 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('java', 'checkstyle')
|
|
|
|
call ale#test#SetFilename('dummy.java')
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
|
|
|
Execute(The checkstyle callback should return the correct default value):
|
2019-06-10 01:18:06 +00:00
|
|
|
AssertLinter 'checkstyle',
|
|
|
|
\ ale#Escape('checkstyle')
|
|
|
|
\ . ' -c ' . ale#Escape('/google_checks.xml')
|
|
|
|
\ . ' %s'
|
2019-06-03 22:40:22 +00:00
|
|
|
|
|
|
|
Execute(The checkstyle executable should be configurable):
|
|
|
|
let b:ale_java_checkstyle_executable = 'foobar'
|
|
|
|
|
2019-06-10 01:18:06 +00:00
|
|
|
AssertLinter 'foobar',
|
|
|
|
\ ale#Escape('foobar')
|
|
|
|
\ . ' -c ' . ale#Escape('/google_checks.xml')
|
|
|
|
\ . ' %s'
|
2019-06-03 22:40:22 +00:00
|
|
|
|
|
|
|
Execute(Custom options should be supported):
|
|
|
|
let b:ale_java_checkstyle_options = '--foobar'
|
|
|
|
|
2019-06-10 01:18:06 +00:00
|
|
|
AssertLinter 'checkstyle',
|
|
|
|
\ ale#Escape('checkstyle')
|
|
|
|
\ . ' --foobar'
|
|
|
|
\ . ' -c ' . ale#Escape('/google_checks.xml')
|
|
|
|
\ . ' %s'
|
2019-06-03 22:40:22 +00:00
|
|
|
|
|
|
|
Execute(configuration files set in _config should be supported):
|
|
|
|
let b:ale_java_checkstyle_config = ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml')
|
|
|
|
|
|
|
|
AssertLinter 'checkstyle',
|
|
|
|
\ ale#Escape('checkstyle')
|
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml'))
|
|
|
|
\ . ' %s'
|
|
|
|
|
|
|
|
Execute(configuration files set in _options should be preferred over _config):
|
|
|
|
let b:ale_java_checkstyle_config = '/foo.xml'
|
|
|
|
let b:ale_java_checkstyle_options = '-c /bar.xml'
|
|
|
|
|
|
|
|
AssertLinter 'checkstyle', ale#Escape('checkstyle') . ' -c /bar.xml %s'
|
|
|
|
|
|
|
|
let b:ale_java_checkstyle_options = '-x -c /bar.xml'
|
|
|
|
|
|
|
|
AssertLinter 'checkstyle', ale#Escape('checkstyle') . ' -x -c /bar.xml %s'
|
|
|
|
|
2019-06-10 01:18:06 +00:00
|
|
|
Execute(google_checks.xml should be used by default):
|
2019-06-03 22:40:22 +00:00
|
|
|
call ale#test#SetFilename('checkstyle_paths/test.java')
|
|
|
|
|
|
|
|
AssertLinter 'checkstyle',
|
|
|
|
\ ale#Escape('checkstyle')
|
2019-06-10 01:18:06 +00:00
|
|
|
\ . ' -c ' . ale#Escape('/google_checks.xml')
|
2019-06-03 22:40:22 +00:00
|
|
|
\ . ' %s'
|
|
|
|
|
|
|
|
Execute(Other relative paths should be supported):
|
|
|
|
let b:ale_java_checkstyle_config = 'checkstyle_paths/other_config.xml'
|
|
|
|
|
|
|
|
AssertLinter 'checkstyle',
|
|
|
|
\ ale#Escape('checkstyle')
|
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml'))
|
|
|
|
\ . ' %s'
|
|
|
|
|
|
|
|
call ale#test#SetFilename('checkstyle_paths/test.java')
|
|
|
|
|
|
|
|
let b:ale_java_checkstyle_config = 'other_config.xml'
|
|
|
|
|
|
|
|
AssertLinter 'checkstyle',
|
|
|
|
\ ale#Escape('checkstyle')
|
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml'))
|
|
|
|
\ . ' %s'
|