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
After setting up ktlint using kotlin = { "ktlint" }, in my neovim config and saving a file, the file formats correctly but the ktlint debug information is added on both sides of the file. Here is an example from Gradle's default hello world after removing a tab and then saving with the format on save option enabled:
Set up ale with ktlint enabled for kotlin formatting and format on save
Generate Gradle hello world project
Save App.kt
:ALEInfo
let g:ale_loclist_msg_format = v:null 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_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 = 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_sign_highlight_linenrs = 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
The text was updated successfully, but these errors were encountered:
I use ktlint with ALE for work and I have never seen this behavior. I just tested on my machine and the fixer works as expected. Can you verify if you have some ktlint configuration that causes it to output debug information?
I am using latest ALE from master, neovim 0.7.0-dev, and ktlint 0.42.1.
I don't have any ktlint configuration and other ALE fixers are working properly. I tried a few different ktlint versions as well and updated ALE. Same result each time.
Seems there was a bug that caused ktlint to output debug info even if --debug flag was not used: pinterest/ktlint#1412
If you still see this behavior and are sure the --debug flag is not being passed to ktlint then is a regression on Ktlint side. I recommend to report this problem at Ktlint repository.
Information
NVIM v0.6.1
Build type: Release
Arch Linux x86_64
What went wrong
After setting up ktlint using
kotlin = { "ktlint" },
in my neovim config and saving a file, the file formats correctly but the ktlint debug information is added on both sides of the file. Here is an example from Gradle's default hello world after removing a tab and then saving with the format on save option enabled:`00:46:02.120 [main] DEBUG com.pinterest.ktlint.Main - Discovered reporter with "baseline" id.
00:46:02.122 [main] DEBUG com.pinterest.ktlint.Main - Discovered reporter with "checkstyle" id.
00:46:02.123 [main] DEBUG com.pinterest.ktlint.Main - Discovered reporter with "json" id.
00:46:02.123 [main] DEBUG com.pinterest.ktlint.Main - Discovered reporter with "html" id.
00:46:02.123 [main] DEBUG com.pinterest.ktlint.Main - Discovered reporter with "plain" id.
00:46:02.123 [main] DEBUG com.pinterest.ktlint.Main - Discovered reporter with "sarif" id.
00:46:02.123 [main] DEBUG com.pinterest.ktlint.Main - Initializing "plain" reporter with {verbose=false, color=false, color_name=DARK_GRAY}
/*
*/
package hello_world
class App {
}
fun main() {
println(App().greeting)
}
00:46:03.083 [main] DEBUG com.pinterest.ktlint.Main - 1248ms / 1 file(s) / 0 error(s)`
Reproducing the bug
:ALEInfo
let g:ale_loclist_msg_format = v:null 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_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 = 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_sign_highlight_linenrs = 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
The text was updated successfully, but these errors were encountered: