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_phpcbf_executable
3 Save g:ale_php_phpcbf_standard
4 Save g:ale_php_phpcbf_use_global
6 let g:ale_php_phpcbf_executable = 'phpcbf_test'
7 let g:ale_php_phpcbf_standard = ''
8 let g:ale_php_phpcbf_options = ''
9 let g:ale_php_phpcbf_use_global = 0
11 call ale#test#SetDirectory('/testplugin/test/fixers')
16 call ale#test#RestoreDirectory()
18 Execute(project with phpcbf should use local by default):
19 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
22 \ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
23 \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
25 Execute(use-global should override local detection):
26 let g:ale_php_phpcbf_use_global = 1
27 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
31 \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
33 Execute(project without phpcbf should use global):
34 call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
38 \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
40 Execute(The phpcbf callback should return the correct default values):
41 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
44 \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
45 \ ale#fixers#phpcbf#Fix(bufnr(''))
47 Execute(The phpcbf callback should include the phpcbf_standard option):
48 let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
49 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
52 \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
53 \ ale#fixers#phpcbf#Fix(bufnr(''))
55 Execute(User provided options should be used):
56 let g:ale_php_phpcbf_options = '--my-user-provided-option my-value'
57 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
60 \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . ale#Pad('--my-user-provided-option my-value') . ' -'},
61 \ ale#fixers#phpcbf#Fix(bufnr(''))
65 Save g:ale_php_phpcbf_executable
66 Save g:ale_php_phpcbf_standard
67 Save g:ale_php_phpcbf_use_global
69 let g:ale_php_phpcbf_executable = 'phpcbf_test'
70 let g:ale_php_phpcbf_standard = ''
71 let g:ale_php_phpcbf_options = ''
72 let g:ale_php_phpcbf_use_global = 0
74 call ale#test#SetDirectory('/testplugin/test/fixers')
79 call ale#test#RestoreDirectory()
81 Execute(project with phpcbf should use local by default):
82 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
85 \ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
86 \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
88 Execute(use-global should override local detection):
89 let g:ale_php_phpcbf_use_global = 1
90 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
94 \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
96 Execute(project without phpcbf should use global):
97 call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
101 \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
103 Execute(The phpcbf callback should return the correct default values):
104 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
107 \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
108 \ ale#fixers#phpcbf#Fix(bufnr(''))
110 Execute(The phpcbf callback should include the phpcbf_standard option):
111 let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
112 call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
115 \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
116 \ ale#fixers#phpcbf#Fix(bufnr(''))