See the following reprex package: https://github.com/Bisaloo/testlintrconfigerror/:
linters: linters_with_defaults(
backport_linter("2.10.0")
)
The config file is correctly formatted but the backport_linter() setting will generate a warning:
|
if (r_version < "3.0.0") { |
|
warning("It is not recommended to depend on an R version older than 3.0.0. Resetting 'r_version' to 3.0.0.") |
|
r_version <- R_system_version("3.0.0") |
|
} |
This warning is totally unrelated with the config formatting but will bubble up when config is read and produce a red herring message:
Error: Malformed config file, ensure it ends in a newline
Malformed config file, ensure it ends in a newline
It is not recommended to depend on an R version older than 3.0.0. Resetting 'r_version' to 3.0.0.
I looked again and again for the missing newline and couldn't figure out what was wrong until I realized the error came from the warning added at the end of the error message.
See the following reprex package: https://github.com/Bisaloo/testlintrconfigerror/:
The config file is correctly formatted but the
backport_linter()setting will generate a warning:lintr/R/backport_linter.R
Lines 116 to 119 in 1493c5e
This warning is totally unrelated with the config formatting but will bubble up when config is read and produce a red herring message:
I looked again and again for the missing newline and couldn't figure out what was wrong until I realized the error came from the warning added at the end of the error message.