question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors after setup .lintr in the HOME directory

See original GitHub issue

Here is the error after setup .lintr file in the HOME directory on MacBook. The error highlight always on the first character of the first line.

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
eitsupicommented, Feb 4, 2022

That format is not correct. (That is, the wiki description is not correct.) It is in the form of a dcf, which is correctly written as follows:

linters: with_defaults(
  object_usage_linter = NULL,
  commented_code_linter = NULL
  )

or

linters: with_defaults(
  object_usage_linter = NULL,
  commented_code_linter = NULL)

See if you can read the file with R’s read.dcf() function.

read.dcf(".lintr")                                                                 
#> Error in read.dcf(".lintr") : Line starting ') ...' is malformed!
1reaction
eitsupicommented, Feb 15, 2022

would not give me an error with read.dcf but still wouldn’t work, I had to actually add an explicit new line:

The reason is that a line without a newline character (LF) at the end is not considered a line. https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

See https://github.com/r-lib/lintr/issues/886.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where can the .lintr config file be located? - Stack Overflow
The code to find the config seems to walk up parent directories till it finds a match. Are you sure it's not working...
Read more >
lintr: A 'Linter' for R Code
Description Checks adherence to a given style, syntax errors and possible semantic issues. Supports on the fly checking of R code edited with....
Read more >
Changelog - lintr
brace_linter() allows opening curly braces on a new line when there is a comment ... Parse error lints now appear with the linter...
Read more >
README - lintr
Create configuration file for lintr # Source this file in package root directory # List here files to exclude from lint checking, as...
Read more >
lintr package - RDocumentation
Installation. lintr is fully integrated into flycheck when using ESS. See the installalation documentation for those packages for more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found