What is the recommended approach with lintr object_usage_lintr? #327
-
using box implies that the symbols "appear" out of thin air, so object_usage_lintr thinks that the entity is undefined. Of course one can define it as a global symbol, but it gets quite boring quickly, and if you don't have a package it won't work anyway, because the lintr is not executing the code anyway. Is there a better way to ensure that the lintr accepts the symbol as existing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Unfortunately there’s no good way to make The ‘lintr’ package might be accept a patch adding support for ‘box’ (I have previously added ‘box’-specific handling to another linter, and the linter already has special handling for other R packages), but this wouldn’t fix the underlying issues that this linter has for other, common code, so I would still recommend against using it, even patched. The issue is fundamentally that And speaking of 1 Actually |
Beta Was this translation helpful? Give feedback.
Unfortunately there’s no good way to make
object_usage_linter
happy. ‘box’ isn’t the only common use-case which generates issues, and I therefore (unfortunately) recommend disablingobject_usage_linter
entirely: the linter is fundamentally broken, and I don’t think it is fixable.The ‘lintr’ package might be accept a patch adding support for ‘box’ (I have previously added ‘box’-specific handling to another linter, and the linter already has special handling for other R packages), but this wouldn’t fix the underlying issues that this linter has for other, common code, so I would still recommend against using it, even patched.
The issue is fundamentally that
object_usage_linter
(mostly1) re…