-
Notifications
You must be signed in to change notification settings - Fork 195
Description
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:
Lines 116 to 119 in 1493c5e
| 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:
lintr::lint_package()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.