You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify file discovery code in markdown:check-links task
Since projects often contain many Markdown files and new files may be added or the paths of the existing files changed
frequently, the best approach for validating Markdown files is to search the project file tree recursively for all
Markdown files, with exclusions configured for the paths of any externally maintained files.
The `markdown:check-links` task uses the markdown-link-check tool. This tool does not have a capability for discovering
Markdown files so it is necessary to use the `find` command to discover the files, then pass their paths to the
markdown-link-check tool.
Previously the discovery code used `find` to generate an array of paths, which was iterated over passed individually to
markdown-link-check in a `for` loop. The `for` loop is unnecessary because `find` has an `-exec` flag that can be used
to execute commands using the discovered paths. Although the syntax and behavior of this flag is unintuitive, these
disadvantages that come from its use are outweighed by the benefits of the significant amount of code that can be
replaced by it. Since the `-exec`/`-execdir` flags are already in use in the assets and project infrastructure, the
maintainer will be forced to work with them regardless.
0 commit comments