为了检查包的代码质量,我使用了下面的命令来使用包林特
lintr::lint_package()得到一个我想忽略的结果:
函数的圈复杂度应小于15。
如何忽略文件(行号范围)的单个lintr (cyclocomp_linter)的单个“假阳性”lintr结果?
编辑1:当前我正在使用这个.lintr配置文件作为解决方法(完全禁用.lintr配置文件):
linters: with_defaults(
cyclocomp_linter = NULL # instead of NULL I could use: cyclocomp_linter(16)
)发布于 2021-02-07 14:03:52
虽然它不能准确地解决您的问题,但是您可以用# nolint start然后# nolint end包装该函数,以防止任何linter标记该函数。
防止特定链接器标记特定行集的语法目前正在开发中-请参阅https://github.com/jimhester/lintr/pull/660。这将出现在下一个主要的lintr版本(3.0.0)中。
https://stackoverflow.com/questions/64559018
复制相似问题