Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Laurent G
    hum, … let g:ale_ansible_ansible_lint_executable = 'ansible-lint -R -r ./my_rules' doesn't seem to work
    Laurent G
    Ok I tried putting my custom rules into the .ansible-lint config file. It's well taken into account if I run ansible-lint my_playbook.yml but not in vim with ALE. :-/
    Maybe something in my python rules that was ok with ansible-lint but not with ALE?
    Laurent G
    I think my issue is that my path to my custom lint rules is relative. I don't know from where is launch the linters by ALE
    but I assume it's not from my $PATH
    Laurent G
    If any one has any clue, I'm ready to hear!
    @xenlo ALE typically launches linters in a place called the "project root", which is normally identified by either a litner-specific file such as an eslintrc, or a VCS identifier such as a .git directory.
    ... however, I don't think ansible-lint has a project root option, so it would run in the PWD of the spawning process, I believe.
    (in this case, spawning process would be vim)
    Leonhard Saam
    Hello everyone,
    I am trying to switch from VSCode to Vim and was confused about the role of ALE in linting. If I understand everything correctly, ALE has a basic C++ linter. I'm not sure now what ALE actually does. Does it act as a middleman between the linter and Vim or what does it do?
    @The-personified-devil yes - ALE is a layer that takes the output from linters that typically run on the command line (or act as a language server!) and gives you editor functionality based on that.
    ALE itself is not a linter, ALE is the tool that uses linters.
    Kevin Watters
    I have my compiler sending errors to a file local to my project, like .compiler_errors
    what would be the easiest way to define an errorformat and read that file for errors? is there an existing linter i can look to that would have an example of reading from a file?
    @kevinw there's a pretty loosely defined format used by luacheck, teal, and other languages.
    test.tl:5:16: in local declaration: x: got string "hello", expected nil
    test.tl:7:6: argument 1: got <unknown type>, expected string
    So it's like, <filename>:<line>:<column>: <error message>
    Jeremy Zagorski
    Does anyone have experience using Docker Desktop + Rust with Ale? I was reading the ale-lint-other-machines help documentation to create a similar setup on a windows machine, but could not get it to work using the rust:latest image. The executable check fails. I'd be happy to provide my setup if anyone has a similar setup working (not necessarily rust)
    Alessandro Re

    Hello! I started using ALE with rust and python, and I like the experience so far! I have a problem with rust, though that I don't understand: when I create a library project, e.g. using cargo new --lib something, I will get an annoying warning for the code saying that the main is missing: 'main' function not found in crate 'something': consider adding a 'main' function at the crate level.

    How can I investigate/fix this?

    @akiross can you provide me with the output of :ALEInfo ? In general, I want to make sure that it's not rustc, as I don't think rustc actually cares whether it's a library or not.
    Alessandro Re
    Oh I didn't know about :ALEInfo, I'll take a look
    Alessandro Re
    Yeah, it was rustc. I was also missing rust-analyzer: (executable check - failure) rust-analyzer. Now I got a success there, but the message regarding main was from rustc. I removed it from my linters and now there is not that error anymore and things seems better. Thanks!
    Jonathan Birk
    Hey, been using ALE for a week now and it works great. Now i try to use it to fix stuff too but :ALEFix won't do anything. :ALEInfo is at https://pastebin.com/hH8tEak3 . Am I doing something stupid?
    Abid K
    Hi, some fixer is auto fixing my python code and messing it up.. I have setup flake8 for linting, but nothing for fixing. How would I get to know what makes the fixes?
    No fixers are enabled by default unless configured. If you didn't set a setting to do it, it probably means you installed some plugin that's setting a variable for you, that you don't know about. I don't recommend any plugins ever configure any fixers by default.
    I don't read the Gitter so much. People might find this interesting: https://github.com/dense-analysis/ale/discussions You can post threads in there now, and get answers for Q&A style posts like Stack Overflow.
    hi there! Is it somehow possible to either make ALEHover to print the text in popup/floating-window (and not just "echo" it), or, maybe, just get it's text to the variable (and prevent it from being echoed)?
    1 reply
    and, yes, I've tried to set g:ale_hover_to_floating_preview, g:ale_hover_to_preview and g:ale_floating_preview to 1, but hover text is still being echoed :-/
    // oh, I forgot to mebtion, that I'm talking about NeoVim-0.5 (and running with TUI)
    Federico Simonetta
    Hello, someone can help me with this issue? dense-analysis/ale#3695
    Kevin Morris
    Hello. I'm having a quite bizzare issue with completion: This extra "floating window" pops up when completion occurs, https://i.postimg.cc/zG14XT99/ale.png. I can't exactly capture it easily with a screen shot, but the regular old completion dialog does pop up and allow me to select. It leaves me afterward at this window floating, which, in order to remove, I must
    click it with my mouse to get focus (I guess?) and run :q.
    I'm using vim-lsp, vim-lsp-settings, vim-ale, ale and pyls backend language server
    Oh, I'm using nvim.
    latest master on all of that, except for pyls.
    The smaller window that pops up and goes away contains the content you see in that picture, just in a smaller window and fixed around my cursor.
    Kevin Morris
    Welp, it was just a repo sync issue or something. Removed everything, reinstalled, all fine.
    Sorry to bother.
    Kevin Morris
    OK. The problem still exists.
    ALE overrides my tab preferences and now Rust code is using 4 spaces, how do I use 4 space-wide tabs again?
    Wait, sorry, this isn't ALE's fault, nevermind.
    Kevin Choubacha

    Hello, I've been using the ruby sorbet lint for some time and it's pretty much always worked. However, it's stopped picking up errors recently for me. Here is my ALEInfo:

     Current Filetype: ruby
    Available Linters: ['brakeman', 'debride', 'rails_best_practices', 'reek', 'rubocop', 'ruby', 'solargraph', 'sorbet', 'standardrb']
       Linter Aliases:
    'sorbet' -> ['srb']
      Enabled Linters: ['rubocop', 'sorbet']
      Ignored Linters: []
     Suggested Fixers: 
      'prettier' - Apply prettier to a file.
      'remove_trailing_lines' - Remove all blank lines at the end of a file.
      'rubocop' - Fix ruby files with rubocop --auto-correct.
      'rufo' - Fix ruby files with rufo
      'sorbet' - Fix ruby files with srb tc --autocorrect.
      'standardrb' - Fix ruby files with standardrb --fix
      'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
     Linter Variables:
    let g:ale_ruby_rails_best_practices_executable = 'rails_best_practices'
    let g:ale_ruby_rails_best_practices_options = ''
    let g:ale_ruby_rubocop_auto_correct_all = 1
    let g:ale_ruby_rubocop_executable = 'bundle'
    let g:ale_ruby_rubocop_options = ''
    let g:ale_ruby_sorbet_enable_watchman = 0
    let g:ale_ruby_sorbet_executable = 'bundle'
    let g:ale_ruby_sorbet_options = ''
     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 = 1
    let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace'], 'ruby': ['rubocop']}
    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 = {'ruby': ['sorbet', 'rubocop']}
    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) bundle

    That command "bundle" i believe is the sorbet run but even though I have errors in my buffer it's returning success without an output.

    If I run bundle exec srb in the local directory it produces an error output that includes the file I opened.
    Kevin Choubacha
    Ok, i tracked down the issue to a bug with sorbet and the LSP having multiple input directories. It's not related to ale