ropensci-review-tools / srr

Software Review Roclets
https://docs.ropensci.org/srr/
Other
4 stars 2 forks source link

Require standard enumeration to be enclosed in curly brackets #1

Closed mpadge closed 3 years ago

mpadge commented 3 years ago

@noamross Time to start structuring next steps via issues. This first one: Current parsing of standards from roxygen blocks is pure grep, and therefore messy and likely neither bug-free nor ideal. One possible approach for final form would be to demand that standards immediately follow roxygen tags, and only parse first standard thereafter. That has the disadvantage of not enabling standards to be lumped together in a single block, and so preventing things like this:

#' @rssr G1.1, G2.2, G3.3, RE1.1-1.5 are all addressed here

That's obviously so advantageous it must be allowed, which means implementing my second suggested form, of requiring that standards immediately follow tags, and requiring that they are enumerated within [...]. The brackets are important to enable incidental references within one standard to others which might not necessarily be addressed there; like this:

#' @rssr [G1.1] is addressed here, but G.2.2 is not

Slight disadvantage of that is extra effort to type square brackets, but (i) the initial dump can include those, so copy-paste will always leave them intact; and (ii) It's very easy to detect anomalies in formatting (like only one bracket), and issue diagnostic errors.

Comment here if you've got any other suggestions or ideas, otherwise I'll just go ahead and implement the second form.

mpadge commented 3 years ago

Title changed because square brackets are auto-parsed by roxygen2 when markdown = TRUE as markdown hyperlinks. Choice is then either to enforce escape-formatted square brackets (\\[), or just use curly braces which are left as-is. The latter seems easier, so will now be implemented.