2018-08-02 22:44:12 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('php', 'phpcs')
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! g:executable
|
|
|
|
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
|
|
|
Execute(The local phpcs executable should be used):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/phpcs/project-with-phpcs/foo/test.php')
|
2018-08-02 22:44:12 +00:00
|
|
|
|
2021-03-20 22:11:22 +00:00
|
|
|
let g:executable = ale#path#Simplify(g:dir . '/../test-files/phpcs/project-with-phpcs/vendor/bin/phpcs')
|
2018-08-02 22:44:12 +00:00
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinterCwd '%s:h'
|
|
|
|
AssertLinter g:executable, ale#Escape(g:executable)
|
2019-05-29 22:17:04 +00:00
|
|
|
\ . ' -s --report=emacs --stdin-path=%s'
|
2018-08-02 22:44:12 +00:00
|
|
|
|
|
|
|
Execute(use_global should override local executable detection):
|
|
|
|
let g:ale_php_phpcs_use_global = 1
|
|
|
|
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/phpcs/project-with-phpcs/foo/test.php')
|
2018-08-02 22:44:12 +00:00
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'phpcs', ale#Escape('phpcs')
|
2019-05-29 22:17:04 +00:00
|
|
|
\ . ' -s --report=emacs --stdin-path=%s'
|
2018-08-02 22:44:12 +00:00
|
|
|
|
|
|
|
Execute(Projects without local executables should use the global one):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/phpcs/project-without-phpcs/foo/test.php')
|
2018-08-02 22:44:12 +00:00
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'phpcs', ale#Escape('phpcs')
|
2019-05-29 22:17:04 +00:00
|
|
|
\ . ' -s --report=emacs --stdin-path=%s'
|
2018-08-18 18:59:35 +00:00
|
|
|
|
2019-05-29 22:17:04 +00:00
|
|
|
Execute(User provided options should be used):
|
2018-08-18 18:59:35 +00:00
|
|
|
let g:ale_php_phpcs_options = '--my-user-provided-option my-value'
|
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'phpcs', ale#Escape('phpcs')
|
2019-05-29 22:17:04 +00:00
|
|
|
\ . ' -s --report=emacs --stdin-path=%s --my-user-provided-option my-value'
|
|
|
|
|
|
|
|
Execute(The _standard option should be used):
|
|
|
|
let g:ale_php_phpcs_standard = 'foobar'
|
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'phpcs', ale#Escape('phpcs')
|
2019-05-29 22:17:04 +00:00
|
|
|
\ . ' -s --report=emacs --stdin-path=%s --standard=' . ale#Escape('foobar')
|