Skip to content

Fix Markdown lint when having spaces in path#20503

Open
jlaur wants to merge 1 commit intoopenhab:mainfrom
jlaur:markdownlint-path
Open

Fix Markdown lint when having spaces in path#20503
jlaur wants to merge 1 commit intoopenhab:mainfrom
jlaur:markdownlint-path

Conversation

@jlaur
Copy link
Copy Markdown
Contributor

@jlaur jlaur commented Apr 2, 2026

This fixes this error on mvn clean install from a path having spaces in it:

[INFO] Running 'npm exec --yes markdownlint-cli2 -- **/*.md !**/target/** !**/node_modules/** --config C:\Users\Jacob Laursen\Development\jlaur\openhab-addons/.github/markdownlint.yaml' in C:\Users\Jacob Laursen\Development\jlaur\openhab-addons\bundles\org.openhab.automation.pidcontroller
[INFO] markdownlint-cli2 v0.22.0 (markdownlint v0.40.0)
[INFO] Error: Unable to use configuration file 'C:/Users/Jacob'; Configuration file should be one of the supported names (e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name (e.g., 'example.markdownlint-cli2.jsonc') or have a supported extension (e.g., jsonc, json, yaml, yml, cjs, mjs).
[INFO]     at throwForConfigurationFile (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:48:9)
[INFO]     at readOptionsOrConfig (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:169:5)
[INFO]     at main (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:926:27)
[INFO]     ... 3 lines matching cause stack trace ...
[INFO]     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
[INFO]   [cause]: Error: Configuration file should be one of the supported names (e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name (e.g., 'example.markdownlint-cli2.jsonc') or have a supported extension (e.g., jsonc, json, yaml, yml, cjs, mjs).
[INFO]       at readOptionsOrConfig (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:161:13)
[INFO]       at main (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:926:27)
[INFO]       at file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:28
[INFO]       at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
[INFO]       at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
[INFO]       at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  58.721 s
[INFO] Finished at: 2026-04-02T18:45:25+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:2.0.0:npm (markdownlint) on project org.openhab.automation.pidcontroller: Failed to run task: 'npm exec --yes markdownlint-cli2 -- **/*.md !**/target/** !**/node_modules/** --config C:\Users\Jacob Laursen\Development\jlaur\openhab-addons/.github/markdownlint.yaml' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]

Regression of #19010

Regression of openhab#19010

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur added infrastructure Build system and Karaf related issues and PRs regression Regression that happened during the development of a release. Not shown on final release notes. labels Apr 2, 2026
@jlaur jlaur requested a review from a team as a code owner April 2, 2026 19:02
@jlaur
Copy link
Copy Markdown
Contributor Author

jlaur commented Apr 2, 2026

That didn't go well with the CI build:

[INFO] Running 'npm exec --yes markdownlint-cli2 -- **/*.md !**/target/** !**/node_modules/** --config "/home/runner/work/openhab-addons/openhab-addons/.github/markdownlint.yaml"' in /home/runner/work/openhab-addons/openhab-addons/bundles
[INFO] markdownlint-cli2 v0.22.0 (markdownlint v0.40.0)
[INFO] Error: Unable to use configuration file '/home/runner/work/openhab-addons/openhab-addons/bundles/"/home/runner/work/openhab-addons/openhab-addons/.github/markdownlint.yaml"'; Configuration file should be one of the supported names (e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name (e.g., 'example.markdownlint-cli2.jsonc') or have a supported extension (e.g., jsonc, json, yaml, yml, cjs, mjs).
[INFO]     at throwForConfigurationFile (file:///home/runner/.npm/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:48:9)
[INFO]     at readOptionsOrConfig (file:///home/runner/.npm/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:169:5)
[INFO]     at main (file:///home/runner/.npm/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:926:27)
[INFO]     ... 3 lines matching cause stack trace ...
[INFO]     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5) {
[INFO]   [cause]: Error: Configuration file should be one of the supported names (e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name (e.g., 'example.markdownlint-cli2.jsonc') or have a supported extension (e.g., jsonc, json, yaml, yml, cjs, mjs).
[INFO]       at readOptionsOrConfig (file:///home/runner/.npm/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:161:13)
[INFO]       at main (file:///home/runner/.npm/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:926:27)
[INFO]       at file:///home/runner/.npm/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:28
[INFO]       at ModuleJob.run (node:internal/modules/esm/module_job:413:25)
[INFO]       at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:660:26)
[INFO]       at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
[INFO] }

@lsiepel
Copy link
Copy Markdown
Contributor

lsiepel commented Apr 2, 2026

That didn't go well with the CI build:

Error:  Failed to execute goal com.github.eirslett:frontend-maven-plugin:2.0.0:npm (markdownlint) on project org.openhab.addons.reactor.bundles: Failed to run task: 'npm exec --yes markdownlint-cli2 -- **/*.md !**/target/** !**/node_modules/** --config "/home/runner/work/openhab-addons/openhab-addons/.github/markdownlint.yaml"' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]

Quotes in xml can be a pain. From ChatGPT this is suggested:

<arguments>
  <argument>exec</argument>
  <argument>--yes</argument>
  <argument>markdownlint-cli2</argument>
  <argument>--</argument>
  <argument>**/*.md</argument>
  <argument>!**/target/**</argument>
  <argument>!**/node_modules/**</argument>
  <argument>--config</argument>
  <argument>${maven.multiModuleProjectDirectory}/.github/markdownlint.yaml</argument>
</arguments>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Build system and Karaf related issues and PRs regression Regression that happened during the development of a release. Not shown on final release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants