Closed sigmafelix closed 9 months ago
Relevant download functions in ./input/Rinput/download_functions
got # nolint start
and # nolint end
in my working branch isong-calc-covar
.
This issue is moved to "Wiki" section.
@sigmafelix
Another way to implement #nolint
on the data download functions is with a .lintr
configuration file. The configuration file will allow us to "exclude" specific lines/sections of code in the download...data.R
functions from one or more linters, in this case the cyclocomp_linter
.
Using this method we can ensure that all other linters are applied to the download functions, and avoid potentially confusing #nolint start/end
lines of code within the R/
folder.
I have explored the .lintr
configuration file on branch mm_download_function_enhancements_1117, and applied it to the GEOS-CF, GMTED, and NCEP NARR data download functions.
https://cran.r-project.org/web/packages/lintr/vignettes/lintr.html
@mitchellmanware Sounds good. I will delete the obsolete wiki page.
if ... else ...
statements ormethods::is
calls, etc. To bypass this, one can manually wrap a function with# nolint start
and# nolint end
(Reference), for example:Before
After
It should be noted that bypassing should be allowed to functions with cyclomatic complexity only. Codes in general should abide by the general style guidance from linters. To see whether there is cyclomatic complexity, please run linter this code in RStudio Addins > Lint current file
After linting, a tab named "Markers" will appear at the third quadrant (given that your RStudio is in default panel configurations).