Skip to content

ALE not linting .r files with lintr (but working with other filetypes) #3089

@mikekaminsky

Description

@mikekaminsky

Information

VIM version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 27 2020 12:11:13)
macOS version

Operating System: MacOS Catalina 10.15.3

What went wrong

I can't get ALE + lintr to lint my .r files. I have confirmed that ALE works with other files (e.g., my .vimrc file with vint).

When I run :ALEInfo I can see issues appearing, but they don't appear in my vim editor at all.

I'm running a minimal .vimrc with just ALE installed via vim-plug and the problem persists.

I've installed new versions of vim, ALE, and lintr.

I've looked through the issues both this repository and in the lintr repository and haven't seen anything relevant.

Reproducing the bug

  1. Install ALE
  2. Install lintr in R via install.packages('lintr')
  3. Open up a test.r file
  4. Observe that the file is not linted.

I assume that these steps won't actually reproduce this since other people aren't experiencing this issue, but this works consistently on my machine.

If this is a dumb issue in my configuration I'm very sorry in advance.

:ALEInfo

 Current Filetype: r
Available Linters: ['lintr']
  Enabled Linters: ['lintr']
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'styler' - Fix R files with styler.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_r_lintr_lint_package = 0
let g:ale_r_lintr_options = 'with_defaults()'
 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_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 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 = {}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
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_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) Rscript
(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/Users/michaelkaminsky'' && Rscript --vanilla -e ''suppressPackageStartupMessages(library(lintr));lint(cache = FALSE, commandArgs(TRUE), with_defaults())'' ''/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r''']

<<<OUTPUT STARTS>>>
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:4:30: style: There should be a space between right parenthesis and an opening curly brace.
write_f <- function(path, obj){
                             ^~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:10:31: style: There should be a space between right parenthesis and an opening curly brace.
write_f2 <- function(path, obj){
                              ^~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:11:3: warning: local variable ‘name’ assigned but may not be used
  name <- deparse(substitute(obj))
  ^~~~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:12:3: warning: no visible global function definition for ‘log_info’
  log_info("Writing {name} to {path}")
  ^~~~~~~~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:16:10: style: Only use double-quotes.
write_f2('~/Desktop', x)
         ^~~~~~~~~~~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:18:27: style: There should be a space between right parenthesis and an opening curly brace.
other_func <- function(obj){
                          ^~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:19:12: style: Only use double-quotes.
  write_f2('~/Downloads', obj)
           ^~~~~~~~~~~~~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:26:26: style: There should be a space between right parenthesis and an opening curly brace.
wrapper_func <- function(){
                         ^~
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:40:1: style: Trailing blank lines are superfluous.

^
/private/var/folders/gb/1v70s2y97b9f42rs9jfpqrxw0000gn/T/vOW3kfS/1/scratch.r:41:1: style: Trailing blank lines are superfluous.

^
<<<OUTPUT ENDS>>>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions