You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should ignore error S101 for files in tests/ and surface the error elsewhere. However, when running ruff through ALE on a file at path tests/test_ruff.py, I can see the error still appears
This is confirmed in the output for ALEInfo:
(finished - exit code 1) ['/bin/zsh', '-c', '''/Users/xxx/Library/Caches/pypoetry/virtualenvs/test-ruff-Xi6EnTdk-py3.11/bin/ruff'' --format text - < ''/var/folders/hr/_46cyfr51290z837bnrk9vjc0000gn/T/nvim.xxx/RxEmX2/22/test_ruff.py''']
<<<OUTPUT STARTS>>>
-:1:8: F401 `math` imported but unused
-:4:5: S101 Use of `assert` detected
Found 2 error(s).
1 potentially fixable with the --fix option.
If I add the S101 error to the ignore list then the error is correctly ignored by ALE/ruff.
When running ruff directly through :!ruff % only the F401 is shown as expected
Running :ALELint on the above test file returns an unwanted error
:ALEInfo
Expand
Current Filetype: python
Available Linters: ['bandit', 'cspell', 'flake8', 'flakehell', 'jedils', 'mypy', 'prospector', 'pycodestyle', 'pydocstyle', 'pyflakes', 'pylama', 'pylint', 'pylsp', 'pyre', 'pyright', 'refurb', 'ruff', 'unimport', 'vulture']
Enabled Linters: ['ruff']
Ignored Linters: []
Suggested Fixers:
'add_blank_lines_for_python_control_statements' - Add blank lines before control statements.
'autoflake' - Fix flake issues with autoflake.
'autoimport' - Fix import issues with autoimport.
'autopep8' - Fix PEP8 issues with autopep8.
'black' - Fix PEP8 issues with black.
'isort' - Sort Python imports with isort.
'pyflyby' - Tidy Python imports with pyflyby.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'reorder-python-imports' - Sort Python imports with reorder-python-imports.
'ruff' - A python linter/fixer for Python written in Rust
'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_auto_pipenv = 0
let g:ale_python_auto_poetry = 0
let g:ale_python_ruff_auto_pipenv = 0
let g:ale_python_ruff_auto_poetry = 0
let g:ale_python_ruff_change_directory = 0
let g:ale_python_ruff_executable = 'ruff'
let g:ale_python_ruff_options = ''
let g:ale_python_ruff_use_global = 0
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 = 0
let g:ale_fixers = {}
let b:ale_fixers = {'python': ['autoimport', 'isort', 'black']}
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 = 0
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = {'python': ['ruff']}
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
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 = 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 = 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_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) /Users/xxx/Library/Caches/pypoetry/virtualenvs/test-ruff-Xi6EnTdk-py3.11/bin/ruff
(finished - exit code 0) ['/bin/zsh', '-c', '''/Users/xxx/Library/Caches/pypoetry/virtualenvs/test-ruff-Xi6EnTdk-py3.11/bin/ruff'' --version']
<<<OUTPUT STARTS>>>
ruff 0.0.209
<<<OUTPUT ENDS>>>
(finished - exit code 1) ['/bin/zsh', '-c', '''/Users/xxx/Library/Caches/pypoetry/virtualenvs/test-ruff-Xi6EnTdk-py3.11/bin/ruff'' --format text - < ''/var/folders/hr/_46cyfr51290z837bnrk9vjc0000gn/T/nvim.xxx/iF20kJ/1/test_ruff.py''']
<<<OUTPUT STARTS>>>
-:1:8: F401 `math` imported but unused
-:4:5: S101 Use of `assert` detected
Found 2 error(s).
1 potentially fixable with the --fix option.
<<<OUTPUT ENDS>>>
The text was updated successfully, but these errors were encountered:
This behavior will be improved with #4414. Since ALE passes file contents to Ruff on stdin, without the filename, Ruff doesn't know what file ignore rules to apply.
Information
VIM version
Operating System: MacOSX 11.5.2
What went wrong
I have some configuration set for the
ruff
linter in mypyproject.toml
like soThis should ignore error
S101
for files intests/
and surface the error elsewhere. However, when runningruff
throughALE
on a file at pathtests/test_ruff.py
, I can see the error still appearsThis is confirmed in the output for
ALEInfo
:If I add the
S101
error to theignore
list then the error is correctly ignored by ALE/ruff.When running
ruff
directly through:!ruff %
only theF401
is shown as expectedReproducing the bug
pyproject.toml
:tests/test_ruff.py
:Running
:ALELint
on the above test file returns an unwanted error:ALEInfo
Expand
The text was updated successfully, but these errors were encountered: