Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALE still lints on save when you fix on save and linting on save is disabled #2497

Closed
ghost opened this issue May 13, 2019 · 2 comments
Closed
Labels

Comments

@ghost
Copy link

ghost commented May 13, 2019

Information

VIM version

VIM - Vi IMproved 8.1 (2018 May 18, compiled May 8 2019 21:19:47)
macOS version

Operating System: macOS Mojave 10.14.4

What went wrong

In my vimrc configuration I have set lint_on_save to 0 such that I invoke the linter manually and have fix_on_save set to 1 because I would like fixes to be done automatically (currently I'm using the fixer as a code formatter).

What I have noticed; however, is that when I open a file in Vim and save it, the linter is run even though lint_on_save is equal to 0.
If fix_on_save and lint_on_save are both disabled, the linter is not run when a file is saved.

What I would expect to happen with the combination of settings I have mentioned is that the linter and fixer are invoked independently of one another.

Reproducing the bug

  1. Open a file in vim
  2. save the file using :w (no changes need to be made to the file)
  3. Linter warnings are generated even though lint_on_save is disabled

:ALEInfo

Current Filetype: python
Available Linters: ['bandit', 'flake8', 'mypy', 'prospector', 'pycodestyle', 'pydocstyle', 'pyflakes', 'pylama', 'pylint', 'pyls', 'pyre', 'vulture']
Enabled Linters: ['mypy', 'pylint']
Suggested Fixers:
'add_blank_lines_for_python_control_statements' - Add blank lines before control statements.
'autopep8' - Fix PEP8 issues with autopep8.
'black' - Fix PEP8 issues with black.
'isort' - Sort Python imports with isort.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'yapf' - Fix Python files with yapf.
Linter Variables:

let g:ale_python_mypy_auto_pipenv = 0
let g:ale_python_mypy_executable = 'mypy'
let g:ale_python_mypy_ignore_invalid_syntax = 0
let g:ale_python_mypy_options = '--ignore-missing-imports'
let g:ale_python_mypy_use_global = 0
let g:ale_python_pylint_auto_pipenv = 0
let g:ale_python_pylint_change_directory = 1
let g:ale_python_pylint_executable = 'pylint'
let g:ale_python_pylint_options = '--disable=invalid-name,missing-docstring --max-line-length=120 --extension-pkg-whitelist=lxml'
let g:ale_python_pylint_use_global = 0
let g:ale_python_pylint_use_msg_id = 0
Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:null
let g:ale_command_wrapper = v:null
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = v:null
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 = {'*': ['remove_trailing_lines', 'trim_whitespace'], 'python': ['autopep8']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = v:null
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 0
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {'python': ['pylint', 'mypy']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = v:null
let g:ale_list_window_size = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = v:null
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = v:null
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = v:null
let g:ale_sign_error = v:null
let g:ale_sign_info = v:null
let g:ale_sign_offset = v:null
let g:ale_sign_style_error = v:null
let g:ale_sign_style_warning = v:null
let g:ale_sign_warning = v:null
let g:ale_statusline_format = v:null
let g:ale_type_map = v:null
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:

@w0rp w0rp added the bug label May 13, 2019
@w0rp w0rp changed the title Dependency between fix on save and lint on save settings ALE still lints on save when you fix on save and linting on save is disabled May 13, 2019
@w0rp w0rp closed this as completed in 42cbff2 May 13, 2019
@w0rp
Copy link
Member

w0rp commented May 13, 2019

I have fixed this now. Now ALE won't lint on save if you've disabled linting on save and you've enabled fixing on save. It will still lint the buffer if you run :ALEFix.

@ghost
Copy link
Author

ghost commented May 13, 2019

That's a super quick response and fix! Thanks 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant