All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_php_cs_fixer_executable
3 Save g:ale_php_cs_fixer_options
4 Save g:ale_php_cs_fixer_fix_options
5 let g:ale_php_cs_fixer_executable = 'php-cs-fixer'
6 let g:ale_php_cs_fixer_options = ''
7 let g:ale_php_cs_fixer_fix_options = ''
9 call ale#test#SetDirectory('/testplugin/test/fixers')
14 call ale#test#RestoreDirectory()
17 Execute(project with php-cs-fixer should use local by default):
18 call ale#test#SetFilename('../test-files/php/project-with-php-cs-fixer/test.php')
21 \ ale#path#Simplify(g:dir . '/../test-files/php/project-with-php-cs-fixer/vendor/bin/php-cs-fixer'),
22 \ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
24 Execute(use-global should override local detection):
25 let g:ale_php_cs_fixer_use_global = 1
26 call ale#test#SetFilename('../test-files/php/project-with-php-cs-fixer/test.php')
30 \ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
32 Execute(project without php-cs-fixer should use global):
33 call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/test.php')
37 \ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
42 Execute(The php-cs-fixer callback should return the correct default values):
43 call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/foo/test.php')
47 \ 'read_temporary_file': 1,
48 \ 'command': ale#Escape('php-cs-fixer')
49 \ . ' ' . g:ale_php_cs_fixer_options
50 \ . ' fix ' . g:ale_php_cs_fixer_fix_options
53 \ ale#fixers#php_cs_fixer#Fix(bufnr(''))
55 Execute(The php-cs-fixer callback should include custom php-cs-fixer options):
56 let g:ale_php_cs_fixer_options = '-nq'
57 let g:ale_php_cs_fixer_fix_options = '--config="$HOME/.php_cs"'
58 call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/test.php')
62 \ 'command': ale#Escape(g:ale_php_cs_fixer_executable)
63 \ . ' -nq fix --config="$HOME/.php_cs" %t',
64 \ 'read_temporary_file': 1,
66 \ ale#fixers#php_cs_fixer#Fix(bufnr(''))