ale icon indicating copy to clipboard operation
ale copied to clipboard

ALEFix replaces contents of buffer with terminal output (only for phpcbf)

Open Arizard opened this issue 2 years ago • 0 comments

Information

VIM version

NVIM v0.7.0
Build type: Release

Operating System:

MacOS Monterey 12.4

What went wrong

I have been using the phpcbf fixer for a while, and no issues until today. I was adjusting my init.vim file to group the settings into sections. I also added a couple of nmap lines and some autocmd lines.

When I tried to use ALEFix (phpcbf fixer) it replaced the entire buffer with the terminal output of phpcbf. See video below:

https://user-images.githubusercontent.com/4595972/174217500-8d6bd79b-2399-428b-8c70-c1f6258e567c.mov

Reproducing the bug

Not really sure how to reproduce, but I can share my init.vim if necessary. It's pretty long so I won't share it straight away.

It does not happen when using ALEFix on javascript or vue files. It also does not happen when using php_cs_fixer.

:ALEInfo

 Current Filetype: php
Available Linters: ['cspell', 'intelephense', 'langserver', 'phan', 'php', 'phpactor', 'phpcs', 'phpmd', 'phpstan', 'psalm', 'tlint']
  Enabled Linters: ['phpcs', 'phpstan']
  Ignored Linters: []
 Suggested Fixers: 
  'php_cs_fixer' - Fix PHP files with php-cs-fixer.
  'phpcbf' - Fix PHP files with phpcbf.
  '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.
 Linter Variables:

let g:ale_php_phpcbf_executable = 'phpcbf'
let g:ale_php_phpcbf_options = ''
let g:ale_php_phpcbf_standard = ''
let g:ale_php_phpcbf_use_global = 0
let g:ale_php_phpcs_executable = 'phpcs'
let g:ale_php_phpcs_options = ''
let g:ale_php_phpcs_standard = '/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'
let g:ale_php_phpcs_use_global = 0
let g:ale_php_phpstan_autoload = ''
let g:ale_php_phpstan_configuration = ''
let g:ale_php_phpstan_executable = 'phpstan'
let g:ale_php_phpstan_level = ''
let g:ale_php_phpstan_memory_limit = '1500M'
let g:ale_php_phpstan_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 = {'scala': ['scalafmt'], 'vue': ['eslint', 'importjs'], 'php': ['phpcbf'], '*': ['remove_trailing_lines', 'trim_whitespace'], 'javascript': ['eslint', 'importjs']}
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 = {'scala': ['metals'], 'vue': ['eslint'], 'php': ['phpcs', 'phpstan'], 'javascript': ['eslint']}
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 = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(executable check - success) /Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure'' && ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' --standard=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/2/ReportResultJob.php''']

<<<NO OUTPUT RETURNED>>>

(executable check - success) phpstan
(finished - exit code 0) ['/bin/zsh', '-c', '''phpstan'' --version']

<<<OUTPUT STARTS>>>
PHPStan - PHP Static Analysis Tool 1.1.2
<<<OUTPUT ENDS>>>

(started) ['/bin/zsh', '-c', '''phpstan'' analyze --no-progress --error-format json --memory-limit ''1500M'' ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/5/ReportResultJob.php''']
(finished - exit code 0) ['/bin/zsh', '-c', '''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcbf'' --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php''  - < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/6/ReportResultJob.php''']
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure'' && ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' --standard=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/7/ReportResultJob.php''']

<<<NO OUTPUT RETURNED>>>

(started) ['/bin/zsh', '-c', '''phpstan'' analyze --no-progress --error-format json --memory-limit ''1500M'' ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/8/ReportResultJob.php''']
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure'' && ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' --standard=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/9/ReportResultJob.php''']

<<<NO OUTPUT RETURNED>>>

(started) ['/bin/zsh', '-c', '''phpstan'' analyze --no-progress --error-format json --memory-limit ''1500M'' ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/10/ReportResultJob.php''']
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure'' && ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' --standard=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/11/ReportResultJob.php''']

<<<NO OUTPUT RETURNED>>>

(finished - exit code 0) ['/bin/zsh', '-c', '''phpstan'' analyze --no-progress --error-format json --memory-limit ''1500M'' ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/12/ReportResultJob.php''']

<<<OUTPUT STARTS>>>
{"totals":{"errors":0,"file_errors":0},"files":[],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/bin/zsh', '-c', '''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcbf'' --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php''  - < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/13/ReportResultJob.php''']
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure'' && ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' --standard=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/14/ReportResultJob.php''']

<<<NO OUTPUT RETURNED>>>

(started) ['/bin/zsh', '-c', '''phpstan'' analyze --no-progress --error-format json --memory-limit ''1500M'' ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/15/ReportResultJob.php''']
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure'' && ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' --standard=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/16/ReportResultJob.php''']

<<<NO OUTPUT RETURNED>>>

(started) ['/bin/zsh', '-c', '''phpstan'' analyze --no-progress --error-format json --memory-limit ''1500M'' ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/17/ReportResultJob.php''']
(finished - exit code 0) ['/bin/zsh', '-c', 'cd ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure'' && ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' --standard=''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/phpcs.xml'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/18/ReportResultJob.php''']

<<<NO OUTPUT RETURNED>>>

(started) ['/bin/zsh', '-c', '''phpstan'' analyze --no-progress --error-format json --memory-limit ''1500M'' ''/Users/aoldman/dev/src/github.com/deputyapp/deputy-webapp/Tenant/Domain/PayComparison/Service/Infrastructure/ReportResultJob.php'' < ''/var/folders/f7/yyzwywf54239mx153kng86vh0000gn/T/nvim1v4HkM/19/ReportResultJob.php''']```

Arizard avatar Jun 17 '22 03:06 Arizard