Skip to content

Commit

Permalink
Merge pull request #2016 from terryding77/master
Browse files Browse the repository at this point in the history
fix: change google_java_format_* to java_google_java_format_*
  • Loading branch information
w0rp committed Oct 25, 2018
1 parent 2dbfbe7 commit 0c17ba2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions autoload/ale/fixers/google_java_format.vim
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
" Author: butlerx <butlerx@notthe,cloud>
" Description: Integration of Google-java-format with ALE.

call ale#Set('google_java_format_executable', 'google-java-format')
call ale#Set('google_java_format_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('google_java_format_options', '')
call ale#Set('java_google_java_format_executable', 'google-java-format')
call ale#Set('java_google_java_format_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('java_google_java_format_options', '')

function! ale#fixers#google_java_format#Fix(buffer) abort
let l:options = ale#Var(a:buffer, 'google_java_format_options')
let l:executable = ale#Var(a:buffer, 'google_java_format_executable')
let l:options = ale#Var(a:buffer, 'java_google_java_format_options')
let l:executable = ale#Var(a:buffer, 'java_google_java_format_executable')

if !executable(l:executable)
return 0
Expand Down
8 changes: 4 additions & 4 deletions test/fixers/test_goofle_java_format_fixer_callback.vader
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Before:
Save g:ale_google_java_format_executable
Save g:ale_java_google_java_format_executable

" Use an invalid global executable, so we don't match it.
let g:ale_google_java_format_executable = 'xxxinvalid'
let g:ale_java_google_java_format_executable = 'xxxinvalid'

call ale#test#SetDirectory('/testplugin/test/fixers')

Expand All @@ -17,11 +17,11 @@ Execute(The google-java-format callback should return 0 when the executable isn'
\ ale#fixers#google_java_format#Fix(bufnr(''))

Execute(The google-java-format callback should run the command when the executable test passes):
let g:ale_google_java_format_executable = has('win32') ? 'cmd' : 'echo'
let g:ale_java_google_java_format_executable = has('win32') ? 'cmd' : 'echo'

AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(ale_google_java_format_executable) . ' --replace %t'
\ 'command': ale#Escape(ale_java_google_java_format_executable) . ' --replace %t'
\ },
\ ale#fixers#google_java_format#Fix(bufnr(''))

0 comments on commit 0c17ba2

Please sign in to comment.