🔥
|
This repository is beta software. |
The purpose of this pre-commit hook is narrow.
The goal is to ensure that Asciidoc (.adoc) files in the modules
directory of the openshift-docs
repo are updated with the names of the assembly AsciiDoc files that reference them.
See pre-commit for instructions.
Sample .pre-commit-config.yaml
:
repos:
- repo: https://github.com/mikemckiernan/module-used-by
rev: v0.1.4
hooks:
- id: module-used-by
args: ["--ignore-dir=drupal", "--ignore-dir=rest_api", "--ignore-dir=contributing_to_docs", --ignore-file="README.adoc"]
types: [asciidoc]
Refer to the tags page to find the most recent rev
.
The args
field is optional, but harmless to include with versions >= v0.1.4.
You can specify additional directories for files to ignore from consideration.
Comments at the end of the module-used-by block comment are not preserved. If the comment block ends like the following example, then the hook deletes last two lines of the comment.
...
// * cookies/holiday/gingerbread.adoc
// * cookies/chocolate-chip.adoc
//
// Bread recipes link to this; do not change anchor
...
// * cookies/holiday/gingerbread.adoc
// * cookies/chocolate-chip.adoc
If the module-used-by block comment is preceded by another comment, the hook deletes the first comment and then inserts the module-used-by block comment. As a result, the hook leaves the file with the original module-used-by comment block as the second comment, or in any subsequent position.
// TODO - possibly delete this file
// Or does someone want anchovy-and-anise-flavored cookies?
// Module included in the following assemblies:
//
// Module included in the following assemblies:
//
// * installing/installing_aws/installing-aws-network-customizations.adoc
// * installing/installing_azure/installing-azure-network-customizations.adoc
// Module included in the following assemblies:
//
...