lintr icon indicating copy to clipboard operation
lintr copied to clipboard

Is it possible to avoid repetition across code and docs for undesirable linters?

Open IndrajeetPatil opened this issue 3 years ago • 2 comments

Currently, we are repeating the same text twice:

Once in docs-

https://github.com/r-lib/lintr/blob/1a567f09cee74f5eb264a19dfde78f68d8e82278/R/zzz.R#L51

The other time in code-

https://github.com/r-lib/lintr/blob/1a567f09cee74f5eb264a19dfde78f68d8e82278/R/zzz.R#L101-L102

This means that we run the risk of forgetting to update one if the other is updated.

Can we think of a way to avoid this repetition?

IndrajeetPatil avatar Jul 21 '22 06:07 IndrajeetPatil

Not completely sure yet, but there might be a hint about a possible approach in this PR.

IndrajeetPatil avatar Jul 21 '22 06:07 IndrajeetPatil

Maybe a helper like rd_tags() can be written that would auto generate the roxygen docs from all_undesirable_functions.

AshesITR avatar Jul 21 '22 16:07 AshesITR