Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspicious state from syntax checker r-lintr: Flycheck checker r-lintr returned 1, but its output contained no errors #1991

Open
solmos opened this issue Jan 5, 2023 · 1 comment

Comments

@solmos
Copy link

solmos commented Jan 5, 2023

Bug description

I get the following error anytime I am typing inside the argument parentheses in a function definition in an R script:

Suspicious state from syntax checker r-lintr: Flycheck checker r-lintr returned 1, but its output contained no errors: Error in rep.int(character, length) : invalid 'times' value
Calls: <Anonymous> ... print.lint -> cat -> highlight_string -> fill_with -> paste0
In addition: Warning messages:
1: In readLines(obj) :
  incomplete final line found on '/private/var/folders/gx/vdqbfzvs66b1swy4qv7pch7c0000gp/T/flycheckxgcutS/test.R'
2: In readLines(obj) :
  incomplete final line found on '/private/var/folders/gx/vdqbfzvs66b1swy4qv7pch7c0000gp/T/flycheckxgcutS/test.R'
Execution halted

Try installing a more recent version of r-lintr, and please open a bug report if the issue persists in the latest release.  Thanks!

Steps to reproduce

Steps to reproduce the behavior:

  1. Open file test.R

  2. Type:

foo <- function()
  1. Place cursor (in insert mode using evil-mode) inside the parentheses.

Screenshots

Screenshot 2023-01-05 at 13 39 03

System configuration

Syntax checkers for buffer test.R in ess-r-mode:

First checker to run:

  r-lintr
    - may enable:    yes
    - may run:       t
    - executable:    Found at /usr/local/bin/R
    - lintr library: present

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot
Emacs version:    28.2
System:           aarch64-apple-darwin21.6.0
Window system:    mac

Emacs configuration: Doom Emacs

@teotenn
Copy link

teotenn commented Jan 28, 2023

I was having same problem as you, without the middle part of In addition: Warning messages:

Try checking the syntax of your .lintr file. Flycheck is very special for the syntax. For example in my case I was trying something like this

(setq tt/lintr-linters
      "linters_with_defaults(
         line_length_linter = line_length_linter(120)
       )"
 )

(setq flycheck-lintr-linters tt/lintr-linters))

Something that with Flymake kind of makes sense and works. But Flycheck keeps sending me the same error as you got. So changed it for (setq flycheck-lintr-linters "linters_with_defaults(line_length_linter = line_length_linter(120))")) and now Flycheck is working.

For the mainteiners, is there a reason why, when I set a variable with spaces flycheck does not recognize it? Flymake had no problems recognizing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants