Skip to content

"error in callr subprocess": lintr-issue for excluded files #1530

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

Closed
strengejacke opened this issue Sep 6, 2022 · 6 comments
Closed

"error in callr subprocess": lintr-issue for excluded files #1530

strengejacke opened this issue Sep 6, 2022 · 6 comments

Comments

@strengejacke
Copy link

strengejacke commented Sep 6, 2022

I'm using vscode (on Windows) and R 4.2.1, and I have following issue when diagnostics (supported by lintr) are enabled. For files that are not yet saved (i.e. do not exist on hard disk), or for files listed in the exclusion list, I get following warning:

Failed to run diagnostics: ! error in callr subprocess
Caused by error:
! Malformed config file, ensure it ends in a newline
Invalid DCF format.
Regular lines must have a tag.
Offending lines start with:
)
)lintr

It's always the first character in the first line that is highlighted (see screenshot).

image

My .lintr file looks like this:

linters: with_defaults(
  object_name_linter = NULL,
  object_length_linter(50),
  commented_code_linter = NULL,
  object_usage_linter = NULL,
  line_length_linter(120),
  cyclocomp_linter = cyclocomp_linter(50)
)

exclusions: list(
  "*.Rmd"
)

I'm not sure if this is a lintr-issue at all, but I thought starting an issue in this repo might be the most appropriate?

@AshesITR
Copy link
Collaborator

AshesITR commented Sep 6, 2022

Hi @strengejacke,
that's indeed malformed.
You need a continuation indent of two spaces in dcf after a line break.

Try this, noting the terminal newline and the indented closing parentheses.

linters: with_defaults(
    object_name_linter = NULL,
    object_length_linter(50),
    commented_code_linter = NULL,
    object_usage_linter = NULL,
    line_length_linter(120),
    cyclocomp_linter = cyclocomp_linter(50)
  )

exclusions: list(
    "*.Rmd"
  )

@strengejacke
Copy link
Author

strengejacke commented Sep 6, 2022

Thanks, this works, at least the initial issue is resolved. Now I get a new error:

Failed to run diagnostics: ! error in callr subprocess
Caused by error in (function (linter, name) ...:
! Expected 'NA' to be a function of class 'linter', not a logical of class 'logical'lintr

Couldn't find anything clarifying on the internet yet...

@eitsupi
Copy link
Contributor

eitsupi commented Sep 8, 2022

Couldn't find anything clarifying on the internet yet...

Line 9, the empty line seems to be causing the problem.

By the way, I've read the documentation and I'm wondering if it is possible to specify files with wildcards (*).
https://lintr.r-lib.org/articles/lintr.html?q=exclusions#exclusions

@strengejacke
Copy link
Author

Thanks, looks like everything is working as expected now!

@strengejacke
Copy link
Author

(this is how it looks like now)

@MichaelChirico
Copy link
Collaborator

Definitely more evidence for #1210... these issues are hard to debug/explain. (also quite poorly documented at the moment)

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

No branches or pull requests

4 participants