Skip to content

Commit 36fc565

Browse files
committed
Avoid uncontrolled recursion when validating markdownlint configuration files
The project infrastructure validates the markdownlint configuration files against their JSON schema. In addition to the repository's own markdownlint configuration file at the standard location, a reusable standardized "asset" configuration file is hosted in the repository. Previously, in order to provide validation coverage for all the .markdownlint.yml files in the repository, a "globstar" was used to cause the validator to recursively search the entire file tree under the repository. That approach is problematic because the repository contains externally maintained files (e.g., the npm packages under the node_modules folder). Searching and validating these files is inefficient at best and the cause of spurious failures at worst. That worst case scenario has now occurred as a file from a npm package dependency is being discovered by the validation system and failing validation. This is avoided by targeting the search. The chosen approach is to validate only the "asset" file. Even though this causes the file in the root of the repository to no longer be validated directly, it continues to be indirectly validated because the file in the root is an exact copy of the "asset" (and the repository infrastructure enforces the sync).
1 parent 4bccfb7 commit 36fc565

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ tasks:
705705
SCHEMA_URL: https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json
706706
SCHEMA_PATH:
707707
sh: task utility:mktemp-file TEMPLATE="markdownlint-schema-XXXXXXXXXX.json"
708-
DATA_PATH: "**/.markdownlint.{yml,yaml}"
708+
DATA_PATH: "workflow-templates/assets/check-markdown/.markdownlint.yml"
709709
deps:
710710
- task: npm:install-deps
711711
cmds:

0 commit comments

Comments
 (0)