Skip to content

Broaden regex for warning banner for generated files #15216

Description

@willgearty

#2085 and #2123 implemented really handy warning banners for generated files. It looks like this was mostly intended for documentation files generated by roxygen2, so the regex is quite specific:

boost::regex reRoxygen(
"Generated by roxygen2: do not edit by hand\n"
"Please edit documentation in ");

It's great that there's an alternative regex that only looks for "do not edit by hand", but in this case it doesn't extract the alternatives information, resulting in no links being included in the warning banner.

Would it be possible to expand the first regex just a little bit so that it catches other examples of generated files, like the following that I'm hoping to use in a package vignette compilation workflow? Then it would be able to also include the link to the vignette source file:

% Generated by precompile.R: do not edit by hand
% Please edit source in vignettes/rredlist.Rmd.orig

Activity

  1. added
    new
    on Sep 24, 2024
  2. changed the title [-]Broaden regex for generated files[/-] [+]Broaden regex for warning banner for generated files[/+] on Sep 24, 2024
  3. removed
    new
    on Sep 30, 2024
  4. added this to the Mariposa Orchid milestone on Sep 30, 2024
  5. willgearty commented on Oct 2, 2024

    @willgearty
    Author

    As a follow-up, here is another example that I'd love to see covered:

    ---
    # Generated by vignettes/precompile.R: do not edit by hand.
    # Please edit source in vignettes/source/_rredlist.Rmd
    title: "Introduction to rredlist"
    author: "William Gearty"
    date: "2024-10-01"
    output: rmarkdown::html_vignette
    vignette: >
      %\VignetteIndexEntry{Introduction to rredlist}
      %\VignetteEngine{knitr::rmarkdown}
      %\VignetteEncoding{UTF-8}
    ---
    [vignette body here]
  6. added a commit that references this issue on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions