I have ALE configured to lint and fix Ruby and Javascript files. Linting works as expected - the tools are found and I get info in the location list, etc. about changes to be made.
However, fixing the files using the same linters does not work. I have tried both fix on save and manually calling :ALEFix
. In both cases nothing happens.
My vim configuration is here: https://github.com/prognostikos/dotfiles/blob/master/vim/vimrc.symlink
:ALEInfo
after running :ALEFix
follows:
Current Filetype: ruby
Available Linters: ['brakeman', 'cspell', 'debride', 'rails_best_practices', 'reek', 'rubocop', 'ruby', 'solargraph', 'sorbet', 'standardrb']
Linter Aliases:
'sorbet' -> ['srb']
Enabled Linters: ['standardrb']
Ignored Linters: []
Suggested Fixers:
'prettier' - Apply prettier to a file.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'rubocop' - Fix ruby files with rubocop --auto-correct.
'rufo' - Fix ruby files with rufo
'sorbet' - Fix ruby files with srb tc --autocorrect.
'standardrb' - Fix ruby files with standardrb --fix
'syntax_tree' - Fix ruby files with stree write
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
Linter Variables:
let g:ale_ruby_rails_best_practices_executable = 'rails_best_practices'
let g:ale_ruby_rails_best_practices_options = ''
let g:ale_ruby_standardrb_executable = 'standardrb'
let g:ale_ruby_standardrb_options = ''
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'ruby': ['standardrb'], 'javascript': ['standard']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'ruby': ['standardrb'], 'javascript': ['standard']}
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) standardrb
(finished - exit code 0) ['/bin/zsh', '-c', '''standardrb'' --format json --force-exclusion --stdin ''/Users/rohrer/c/bn/mrclean/lib/faraday_middleware/sign_body.rb'' < ''/var
/folders/q9/dp048sqn3gx_qf03ccn85r100000gn/T/vWxRZht/3/sign_body.rb''']
<<<OUTPUT STARTS>>>
{"metadata":{"rubocop_version":"1.40.0","ruby_engine":"ruby","ruby_version":"3.1.3","ruby_patchlevel":"185","ruby_platform":"arm64-darwin21"},"files":[{"path":"lib/faraday_midd
leware/sign_body.rb","offenses":[{"severity":"convention","message":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","cop_n
ame":"Style/StringLiterals","corrected":true,"correctable":true,"location":{"start_line":1,"start_column":9,"last_line":1,"last_column":17,"length":9,"line":1,"column":9}},{"se
verity":"convention","message":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","cop_name":"Style/StringLiterals","correcte
d":true,"correctable":true,"location":{"start_line":2,"start_column":9,"last_line":2,"last_column":28,"length":20,"line":2,"column":9}},{"severity":"convention","message":"Unne
cessary spacing detected.","cop_name":"Layout/ExtraSpacing","corrected":true,"correctable":true,"location":{"start_line":6,"start_column":19,"last_line":6,"last_column":23,"len
gth":5,"line":6,"column":19}},{"severity":"convention","message":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","cop_name
":"Style/StringLiterals","corrected":true,"correctable":true,"location":{"start_line":6,"start_column":27,"last_line":6,"last_column":34,"length":8,"line":6,"column":27}},{"sev
erity":"convention","message":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","cop_name":"Style/StringLiterals","corrected
":true,"correctable":true,"location":{"start_line":7,"start_column":27,"last_line":7,"last_column":41,"length":15,"line":7,"column":27}},{"severity":"convention","message":"Pre
fer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","cop_name":"Style/StringLiterals","corrected":true,"correctable":true,"locatio
n":{"start_line":10,"start_column":15,"last_line":10,"last_column":23,"length":9,"line":10,"column":15}},{"severity":"convention","message":"Closing method call brace must be o
n the line after the last argument when opening brace is on a separate line from the first argument.","cop_name":"Layout/MultilineMethodCallBraceLayout","corrected":true,"corre
ctable":true,"location":{"start_line":31,"start_column":24,"last_line":31,"last_column":24,"length":1,"line":31,"column":24}},{"severity":"convention","message":"Indent `)` to
column 6 (not 0)","cop_name":"Layout/ClosingParenthesisIndentation","corrected":true,"correctable":true,"location":{"start_line":32,"start_column":1,"last_line":32,"last_column
":1,"length":1,"line":32,"column":1}}]}],"summary":{"offense_count":8,"target_file_count":1,"inspected_file_count":1}}
<<<OUTPUT ENDS>>>
(finished - exit code 0) ['/bin/zsh', '-c', '''standardrb'' --config ''/Users/rohrer/c/bn/mrclean/.standard.yml'' --fix --force-exclusion --stdin ''/Users/rohrer/c/bn/mrclean/l
ib/faraday_middleware/sign_body.rb'' < ''/var/folders/q9/dp048sqn3gx_qf03ccn85r100000gn/T/vWxRZht/5/sign_body.rb''']