-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdownlint: provide usable local tool #8
Comments
This sounds like you'd like another container that just contains the markdownlint tool? Or something else? Can you detail the workflow you'd like to have available in order to do the linting locally, please? |
not sure what the "node" mess is, but you can install the tool into own directory, do not need to install as global, globbering
also, node provides
|
Problem: I opened a PR to contribute to Solution: currently, none. Test QA has |
here's my stab. it does not handle COPYRIGHT and LICENSE exclusions. not sure where that comes from. I've looked in the past, just don't remember now. also, I think I used the version present in brew before, which provided also a fix command: alias g=git
alias c=composer [~/scm/tmp/laminas-form (2.16.x)★] ➔ g diff
diff --git a/composer.json b/composer.json
index 54f2ad68..be6feeef 100644
--- a/composer.json
+++ b/composer.json
@@ -81,6 +81,12 @@
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
+ "markdownlint.json": "test -f .markdownlint.json || wget https://github.com/laminas/laminas-continuous-integration-action/raw/1.4.x/etc/markdownlint.json -O .markdownlint.json",
+ "markdownlint-cli2": "npx markdownlint-cli2",
+ "md-lint": [
+ "@markdownlint.json",
+ "@markdownlint-cli2 *.md"
+ ],
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
}, [~/scm/tmp/laminas-form (2.16.x)★] ➔ c md-lint
> test -f .markdownlint.json || wget https://github.com/laminas/laminas-continuous-integration-action/raw/1.4.x/etc/markdownlint.json -O .markdownlint.json
> npx markdownlint-cli2 '*.md'
markdownlint-cli2 v0.0.14 (markdownlint v0.23.1)
Finding: *.md
Linting: 4 file(s)
Summary: 5 error(s)
CHANGELOG.md:450:102 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
CHANGELOG.md:472:102 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
CHANGELOG.md:550:91 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
COPYRIGHT.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Copyright (c) 2020 Laminas Pro..."]
LICENSE.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Copyright (c) 2020 Laminas Pro..."]
Script npx markdownlint-cli2 handling the markdownlint-cli2 event returned with error code 1
Script @markdownlint-cli2 *.md was called via md-lint
[~/scm/tmp/laminas-form (2.16.x)★] ➔ |
|
What's useful is here, is to perhaps create a composer package that invokes the markdown tool with all needed config, downloading, merging, etc. perhaps in the future include proxy for all tools. and then update ci to use the super tool itself :) |
Just an FYI, you can run the job via the container: $ docker run -v $(realpath .):/github/workspace -w=/github/workspace ghcr.io/laminas/laminas-continuous-integration-container:1 '{"command":"markdownlint docs/book/**/*.md","php":"7.4","extensions":[],"ini":[],"dependencies":"locked"}' The main things are:
This approach ensures the markdownling config is copied in, and that it runs over the current directory. For tools requiring Composer dependencies, this also ensures that deps are installed. (It might be interesting for us to create a macro of some sort for creating the job argument from a command to run.) |
Feature Request
Summary
See laminas/laminas-form#87: I struggled to run
markdownlint-cli2
locally as I don't wantnode
to mess up my computer. At the end I used a lightweight version of theDockerfile
for the purpose:And had some joey, but we should also provide something to fix code snippets inside doc according to Laminas coding standards, see laminas/laminas-form#87 (comment)
The text was updated successfully, but these errors were encountered: