File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 6262
6363-- see mfussenegger/dotfiles
6464local checkstyle_config = vim .fs .joinpath (vim .uv .cwd (), " checkstyle.xml" )
65- local has_checkstyle = vim .uv .fs_stat (checkstyle_config ) and vim .fn .executable (" checkstyle" )
65+ local has_checkstyle = vim .fn .filereadable (checkstyle_config ) == 1
66+ local checkstyle_bin = vim .fn .executable (" checkstyle" ) == 1
6667local is_main = vim .api .nvim_buf_get_name (0 ):find (" src/main/java" ) ~= nil
67- if has_checkstyle and is_main then
68+ if has_checkstyle and checkstyle_bin and is_main then
6869 local bufnr = vim .api .nvim_get_current_buf ()
6970 require (" lint.linters.checkstyle" ).config_file = checkstyle_config
7071 vim .api .nvim_create_autocmd ({ " BufEnter" , " BufWritePost" }, {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ local function maven_settings()
1010 local maven_home = vim .env [" MAVEN_HOME" ]
1111 if maven_home then
1212 local settings_xml = vim .fs .joinpath (maven_home , " conf" , " settings.xml" )
13- if vim .fn .filereadable (settings_xml ) then
13+ if vim .fn .filereadable (settings_xml ) == 1 then
1414 return settings_xml
1515 end
1616 end
You can’t perform that action at this time.
0 commit comments