roxygen2 should return info about what's changed, or otherwise get a helper for this
I'm trying to set up a GitHub Actions to ding us whenever we forget to roxygenize() some change. This happens with some frequency when a change to docs is made during review.
My current approach (https://github.com/r-lib/lintr/pull/2460/commits/85ed38a57f5aaad64fec1519973a4a77adefe79e) is a bit long-winded: (1) check the content of man/ doesn't change after roxygenize(), then loop over the files and check that the content hasn't changed.
OTOH, it seems from the output of roxygenize() that it is already doing this sort of comparison under the hood -- hence "Writing 'any_is_na_linter.Rd'" in the roxygenize() output:
However, AFAICT this info is lost after being emitted to the terminal. If it were part of the roxygenize() output, I could save some headache maintaining the similar script, as well as being more confident the two classifiers would always agree without trying to call roxygen2:::same_contents() myself.
The other possible approach here would be to parse the .Rd files, extract the source files, and then compare timestamps between source and destination. It's not 100% perfect if you're running dynamic code, but I bet it would get you a long way.
Not sure I see 100% what you mean, but here's the essence of our current approach:
https://github.com/r-lib/lintr/blob/1f5e46992c7f5590f6d28e17e212a861f12312f0/.dev/roxygen_test.R#L14-L16
normalize_rd <- function(rd_file) as.character(parse_Rd(rd_file))
rd_equal <- function(f1, f2) isTRUE(all.equal(normalize_rd(f1), normalize_rd(f2)))
I meant you could look at https://github.com/r-lib/lintr/blob/1f5e46992c7f5590f6d28e17e212a861f12312f0/man/Linter.Rd#L2, and then see if utils.R was newer than linter.Rd.