Ale: An error that should go silent

Created on 28 Oct 2017  Â·  9Comments  Â·  Source: dense-analysis/ale

Sometimes I get this on saving files (very rare in general, but often when I :Gwrite:

Error detected while processing function ale#events#SaveEvent[6]..ale#fix#Fix[25]..ale#job#Stop:
line    9:
E474: Invalid argument

I think even if it can't be avoided it should be silent and don't show error.

ALEInfo has paths of my computer I'm not comfortable to share. I also suggest removing those paths from it.

bug

All 9 comments

You can redact paths before you share whatever output.

Do you have any steps for repeating that bug? That ought not to happen.

This is the ALEInfo:


 Current Filetype: python
Available Linters: ['flake8', 'mypy', 'pycodestyle', 'pylint']
  Enabled Linters: ['flake8', 'mypy', 'pylint']
 Linter Variables:

let g:ale_python_flake8_executable = 'flake8'
let g:ale_python_flake8_options = ''
let g:ale_python_flake8_use_global = 0
let g:ale_python_mypy_executable = 'mypy'
let g:ale_python_mypy_options = ''
let g:ale_python_mypy_use_global = 0
let g:ale_python_pylint_executable = 'pylint'
let g:ale_python_pylint_options = '--rcfile=~/.config/pylint.conf --load-plugins pylint_django'
let g:ale_python_pylint_use_global = 0
 Global Variables:

let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '[%linter%] %s'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'javascript': ['eslint', 'remove_trailing_lines', function('<lambda>1')], 'python': ['autopep8', 'isort', 'remove_trailing_lines', function('<lambda>2'), function('<lambda>3')]}
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_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_open_list = 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 = 1
let g:ale_sign_error = '✖'
let g:ale_sign_offset = 1000000
let g:ale_sign_warning = 'âš '
let g:ale_statusline_format = ['✖ %d', '⚠ %d', '']
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(finished - exit code 0) ['/bin/sh', '-c', '''flake8'' --format=default --stdin-display-name ''/blahblah/somepath.py'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/435/routes.py''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) mypy
(finished - exit code 1) ['/bin/sh', '-c', '''/blahblah/.virtualenvs/somevf/bin/pylint'' --rcfile=~/.config/pylint.conf --load-plugins pylint_django --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n ''/blahblah/somepath.py''']

<<<NO OUTPUT RETURNED>>>

(finished - exit code 0) ['/bin/sh', '-c', '''flake8'' --format=default --stdin-display-name ''/blahblah/somepath.py'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/440/routes.py''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) mypy
(finished - exit code 1) ['/bin/sh', '-c', '''/blahblah/.virtualenvs/somevf/bin/pylint'' --rcfile=~/.config/pylint.conf --load-plugins pylint_django --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n ''/blahblah/somepath.py''']

<<<NO OUTPUT RETURNED>>>

(started) ['/bin/sh', '-c', '''flake8'' --format=default --stdin-display-name ''/blahblah/somepath.py'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/441/routes.py''']
(executable check - failure) mypy
(finished - exit code 0) ['/bin/sh', '-c', '''flake8'' --format=default --stdin-display-name ''/blahblah/somepath.py'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/442/routes.py''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) mypy
(finished - exit code 0) ['/bin/sh', '-c', '''autopep8'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/443/routes.py''']
(finished - exit code 0) ['/bin/sh', '-c', '''/blahblah/.virtualenvs/somevf/bin/isort'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/444/routes.py''']
(started) ['/bin/sh', '-c', '''flake8'' --format=default --stdin-display-name ''/blahblah/somepath.py'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/445/routes.py''']
(executable check - failure) mypy
(started) ['/bin/sh', '-c', '/usr/local/bin/add-trailing-comma --py35-plus --py36-plus ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/446/routes.py''']
(finished - exit code 0) ['/bin/sh', '-c', '''flake8'' --format=default --stdin-display-name ''/blahblah/somepath.py'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/447/routes.py''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) mypy
(finished - exit code 0) ['/bin/sh', '-c', '''flake8'' --format=default --stdin-display-name ''/blahblah/somepath.py'' - < ''/var/folders/sx/995cq4316_57jgdyhwjvf9rw0000gn/T/nvimZbbbKV/458/routes.py''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) mypy
(finished - exit code 1) ['/bin/sh', '-c', '''/blahblah/.virtualenvs/somevf/bin/pylint'' --rcfile=~/.config/pylint.conf --load-plugins pylint_django --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n ''/blahblah/somepath.py''']

<<<NO OUTPUT RETURNED>>>

If it doesn't provide you the information you need then we can go with reproducing plan. I almost always get this error if I save file with :Gwrite from fugitive.

If you can provide some steps for reproducing the bug, I'll have a look at this. Please also provide the full error message that you see, if there are any other lines output for the error message.

There no more lines, that's the complete error message. What about making that error silent? I think it can be ignored.

This is the list of my python fixers for ale:

            \ 'python': [
            \   'autopep8',
            \   'isort',
            \   'remove_trailing_lines',
            \   {buffer -> {
            \     'command': '/usr/local/bin/add-trailing-comma --py35-plus --py36-plus %t',
            \     'read_temporary_file': 1,
            \   }},
            \   {buffer, lines -> map(lines, 'substitute(v:val, ''^\s*$'', '''', '''')')},
            \ ]

If and only if I remove autopep8, isort, and the custom add-trailing-comma fixers it doesn't raise the error. If only one of these 3 are there it always raises the error with :Gwrite.

That error can certainly be fixed. I haven't looked at this yet.

Great, I suggested making it silent in case it's not easy to fix.

I also receive this error primarily when running the Gwrite fugitive command or on changing buffers (when I have autowrite set to on) when editing a file which uses prettier as a fixer(the only fixer i have enabled).
PS: just wanted to take the opportunity to also say thanks for the amazing plugin!!

I should have fixed this now by just changing call jobstop(a:job_id) to silent! call jobstop(a:job_id).

I tested it and it doesn't raise an error anymore. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trevordmiller picture trevordmiller  Â·  3Comments

ilyakopy picture ilyakopy  Â·  4Comments

lervag picture lervag  Â·  3Comments

trevordmiller picture trevordmiller  Â·  4Comments

aressler38 picture aressler38  Â·  3Comments