Skip to content

markdownlint-climarkdownlint-cli2 #1934

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

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
240ca29
`markdownlint-cli` → `markdownlint-cli2`
parkerbxyz Oct 5, 2022
a1f1959
Update CLI arguments
parkerbxyz Oct 19, 2022
ddc5cdb
Add `cli_executable` for markdownlint
parkerbxyz Oct 19, 2022
a3b1a53
Update markdownlint CLI examples
parkerbxyz Oct 19, 2022
c25c393
Add markdownlint CLI docker configuration
parkerbxyz Oct 19, 2022
d2bf2e0
Revert "Add markdownlint CLI docker configuration"
parkerbxyz Oct 19, 2022
b373238
Add `davidanson` to CSpell config
parkerbxyz Oct 19, 2022
f38a730
Update `config_file_name` to `LINTER_DEFAULT`
parkerbxyz Oct 19, 2022
1bcca1b
Replace CLI args with executables
parkerbxyz Oct 19, 2022
56f1abe
Add `cli_executable_fix` to schema
parkerbxyz Oct 19, 2022
1f75e5f
Fix order of properties
parkerbxyz Oct 19, 2022
bfa5f48
Fix `cli_executable_version` value
parkerbxyz Oct 19, 2022
09a6240
Set markdownlint CLI args to empty strings
parkerbxyz Oct 19, 2022
9b42e07
Revert whitespaces changes made by editor
parkerbxyz Oct 19, 2022
c1a6fcf
Split `cli_executable_help`
parkerbxyz Oct 19, 2022
4f2a380
Revert "Split `cli_executable_help`"
parkerbxyz Oct 19, 2022
5a73252
Update megalinter-configuration.jsonschema.json
parkerbxyz Oct 19, 2022
3a4f7fc
Remove `cli_executable_help` from markdownlint
parkerbxyz Oct 19, 2022
d30cbd0
Try using `tail` in `cli_help_arg_name`
parkerbxyz Oct 19, 2022
25dbd28
Remove `cli_fix_arg_name`
parkerbxyz Oct 19, 2022
9629101
Add markdownlint CLI Docker image
parkerbxyz Oct 21, 2022
10f8b8c
Fix markdownlint violation in good test files
parkerbxyz Oct 21, 2022
7c54598
Remove markdownlint `cli_docker_image`
parkerbxyz Oct 23, 2022
38b16fe
Add changelog entry
parkerbxyz Oct 24, 2022
718db1a
Move `.markdownlint.json` to project root
parkerbxyz Oct 24, 2022
b65abf6
Update markdownlint CLI name in cupcake Dockerfile
parkerbxyz Oct 24, 2022
955e59d
Update markdownlint help and version configuration
parkerbxyz Oct 24, 2022
d51ae39
Add new `cli_executable_config` option
parkerbxyz Oct 24, 2022
60dc71e
Try using extra commands/args
parkerbxyz Oct 24, 2022
5431095
Revert "Try using extra commands/args"
parkerbxyz Oct 25, 2022
38aa9dd
Revert "Add new `cli_executable_config` option"
parkerbxyz Oct 25, 2022
212f7a0
Revert "Update markdownlint help and version configuration"
parkerbxyz Oct 25, 2022
3f6592d
Merge remote-tracking branch 'upstream/main'
parkerbxyz Nov 14, 2022
6f25cf6
Merge remote-tracking branch 'upstream/main'
parkerbxyz Nov 27, 2022
d3415d0
Merge remote-tracking branch 'upstream/main'
parkerbxyz Feb 26, 2025
f35e760
Update markdown.megalinter-descriptor.yml
parkerbxyz Feb 26, 2025
7d35bd2
Update megalinter-descriptor.jsonschema.json
parkerbxyz Feb 26, 2025
74a078e
Update newer Dockerfiles
parkerbxyz Feb 26, 2025
8a315d1
MARKDOWNLINT_CLI → MARKDOWNLINT_CLI2
parkerbxyz Feb 26, 2025
b298c1e
Update markdownlint-cli2 version
parkerbxyz Feb 26, 2025
8300355
Downcase markdownlint
parkerbxyz Feb 26, 2025
df444ed
Update Node.js version in devcontainer configuration
parkerbxyz Feb 27, 2025
ad2a97e
Fix formatting in build.py to remove trailing space in delete command
parkerbxyz Feb 27, 2025
f255146
Fix formatting in megalinter descriptor files to remove trailing spaces
parkerbxyz Feb 27, 2025
37f344e
bash build.sh
parkerbxyz Feb 27, 2025
e79a896
Update Python and Node.js versions in Dockerfile
parkerbxyz Feb 28, 2025
d97a69b
Inherit Python and Node.js versions from Dockerfile in devcontainer c…
parkerbxyz Feb 28, 2025
0abb568
Remove outdated comments
parkerbxyz Feb 28, 2025
ecf8402
Add Docker and Docker extension to devcontainer configuration
parkerbxyz Feb 28, 2025
4960ccf
Update markdownlint configuration
parkerbxyz Feb 28, 2025
e2ec8fc
Merge remote-tracking branch 'upstream/main'
parkerbxyz Mar 5, 2025
31ae481
Add workaround for markdownlint-cli2 returning exit code 2 with `--help`
parkerbxyz Mar 6, 2025
e16b96e
Fix test skipping conditions for markdownlint
parkerbxyz Mar 6, 2025
60e2afd
Merge branch 'main' into main
parkerbxyz Mar 6, 2025
cd1fda8
Merge remote-tracking branch 'upstream/main'
parkerbxyz Apr 14, 2025
d8ea678
Merge branch 'main' into main
parkerbxyz Apr 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .automation/generated/linter-helps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .automation/test/markdown/markdown_good_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ls -la
### Walk away

We're all done **here**.

- [Link Action](https://github.com)
1 change: 1 addition & 0 deletions .automation/test/markdown/markdown_good_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ls -la
### Walk away

We're all done **here**.

- [Link Action](https://github.com)
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@
"dartanalyzer",
"datasource",
"dateformat",
"davidanson",
"davidjeddy",
"dclint",
"dearmor",
Expand Down
13 changes: 11 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"context": ".."
},
"features": {
"ghcr.io/devcontainers-extra/features/coverage-py:2": {}
"ghcr.io/devcontainers-extra/features/coverage-py:2": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"enableNonRootDocker": "true",
"moby": "true"
}
},
"customizations": {
"vscode": {
Expand Down Expand Up @@ -37,9 +42,13 @@
"rogalmic.bash-debug",
"streetsidesoftware.code-spell-checker",
"stylelint.vscode-stylelint",
"timonwong.shellcheck"
"timonwong.shellcheck",
"ms-azuretools.vscode-docker"
]
}
},
"containerEnv": {
"DOCKER_BUILDKIT": "1"
},
"remoteUser": "vscode"
}
File renamed without changes.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l

- Linters enhancements
- [editorconfig_checker](https://megalinter.io/latest/descriptors/editorconfig_editorconfig_checker/) Changes default EditorConfig-Checker config filename by @llaville in <https://github.com/oxsecurity/megalinter/issues/5061>
- Use `markdownlint-cli2` instead of `markdownlint-cli`


- Fixes

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ ARG LUA_LUACHECK_VERSION=3.3.1
ARG CARGO_SELENE_VERSION=0.28.0
# renovate: datasource=crate depName=stylua
ARG CARGO_STYLUA_VERSION=2.0.0
# renovate: datasource=npm depName=markdownlint-cli
ARG NPM_MARKDOWNLINT_CLI_VERSION=0.44.0
# renovate: datasource=npm depName=markdownlint-cli2
ARG NPM_MARKDOWNLINT_CLI2_VERSION=0.17.2
# renovate: datasource=npm depName=markdown-link-check
ARG NPM_MARKDOWN_LINK_CHECK_VERSION=3.12.2
# renovate: datasource=npm depName=markdown-table-formatter
Expand Down Expand Up @@ -564,7 +564,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
npm-package-json-lint-config-default@${NPM_PACKAGE_JSON_LINT_CONFIG_DEFAULT_VERSION} \
eslint-plugin-react@${NPM_ESLINT_PLUGIN_REACT_VERSION} \
eslint-plugin-jsx-a11y@${NPM_ESLINT_PLUGIN_JSX_ALLY_VERSION} \
markdownlint-cli@${NPM_MARKDOWNLINT_CLI_VERSION} \
markdownlint-cli2@${NPM_MARKDOWNLINT_CLI2_VERSION} \
markdown-link-check@${NPM_MARKDOWN_LINK_CHECK_VERSION} \
markdown-table-formatter@${NPM_MARKDOWN_TABLE_FORMATTER_VERSION} \
pyright@${NPM_PYRIGHT_VERSION} \
Expand Down
2 changes: 1 addition & 1 deletion docs/all_linters.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
| [**lychee**](https://github.com/lycheeverse/lychee){target=_blank} | 0.18.0 | [Apache-2.0](licenses/lychee.md) | [![GitHub stars](https://img.shields.io/github/stars/lycheeverse/lychee?cacheSeconds=3600)](https://github.com/lycheeverse/lychee){target=_blank} | [SPELL](descriptors/spell_lychee.md) | :white_circle: | [Repository](https://github.com/lycheeverse/lychee){target=_blank} |
| [**markdown-link-check**](https://github.com/tcort/markdown-link-check){target=_blank} | 3.12.2 | [ISC](licenses/markdown-link-check.md) | [![GitHub stars](https://img.shields.io/github/stars/tcort/markdown-link-check?cacheSeconds=3600)](https://github.com/tcort/markdown-link-check){target=_blank} | [MARKDOWN](descriptors/markdown_markdown_link_check.md) | :heart: | [MegaLinter reference](https://github.com/tcort/markdown-link-check#run-in-other-tools){target=_blank} |
| [**markdown-table-formatter**](https://github.com/nvuillam/markdown-table-formatter){target=_blank} | 1.6.1 | [MIT](licenses/markdown-table-formatter.md) | [![GitHub stars](https://img.shields.io/github/stars/nvuillam/markdown-table-formatter?cacheSeconds=3600)](https://github.com/nvuillam/markdown-table-formatter){target=_blank} | [MARKDOWN](descriptors/markdown_markdown_table_formatter.md) | :white_circle: | [Repository](https://github.com/nvuillam/markdown-table-formatter){target=_blank} |
| [**markdownlint**](https://github.com/DavidAnson/markdownlint){target=_blank} | 0.44.0 | [MIT](licenses/markdownlint.md) | [![GitHub stars](https://img.shields.io/github/stars/DavidAnson/markdownlint?cacheSeconds=3600)](https://github.com/DavidAnson/markdownlint){target=_blank} | [MARKDOWN](descriptors/markdown_markdownlint.md) | :white_circle: | [Repository](https://github.com/DavidAnson/markdownlint){target=_blank} |
| [**markdownlint**](https://github.com/DavidAnson/markdownlint){target=_blank} | 0.17.2 | [MIT](licenses/markdownlint.md) | [![GitHub stars](https://img.shields.io/github/stars/DavidAnson/markdownlint?cacheSeconds=3600)](https://github.com/DavidAnson/markdownlint){target=_blank} | [MARKDOWN](descriptors/markdown_markdownlint.md) | :white_circle: | [Repository](https://github.com/DavidAnson/markdownlint){target=_blank} |
| [**mypy**](https://github.com/python/mypy){target=_blank} | 1.15.0 | [MIT](licenses/mypy.md) | [![GitHub stars](https://img.shields.io/github/stars/python/mypy?cacheSeconds=3600)](https://github.com/python/mypy){target=_blank} | [PYTHON](descriptors/python_mypy.md) | <!-- --> | [Repository](https://github.com/python/mypy){target=_blank} |
| [**npm-groovy-lint**](https://github.com/nvuillam/npm-groovy-lint){target=_blank} | 15.1.0 | [MIT](licenses/npm-groovy-lint.md) | [![GitHub stars](https://img.shields.io/github/stars/nvuillam/npm-groovy-lint?cacheSeconds=3600)](https://github.com/nvuillam/npm-groovy-lint){target=_blank} | [GROOVY](descriptors/groovy_npm_groovy_lint.md) | :heart: | [MegaLinter reference](https://nvuillam.github.io/npm-groovy-lint/#mega-linter){target=_blank} |
| [**npm-package-json-lint**](https://github.com/tclindner/npm-package-json-lint){target=_blank} | 8.0.0 | [MIT](licenses/npm-package-json-lint.md) | [![GitHub stars](https://img.shields.io/github/stars/tclindner/npm-package-json-lint?cacheSeconds=3600)](https://github.com/tclindner/npm-package-json-lint){target=_blank} | [JSON](descriptors/json_npm_package_json_lint.md) | :heart: | [MegaLinter reference](https://npmpackagejsonlint.org/docs/integrations#megalinter){target=_blank} |
Expand Down
22 changes: 11 additions & 11 deletions docs/descriptors/markdown_markdownlint.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ description: How to use markdownlint (configure, ignore files, ignore errors, he

Checks for errors in Markdown files, and can also auto-fix some of them.

[MarkdownLint](https://github.com/DavidAnson/markdownlint) is run through [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli)
[markdownlint](https://github.com/DavidAnson/markdownlint) is run through [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2)

To see MarkdownLint version, you can have a look in the dependencies of latest markdownlint-cli version.
To see markdownlint version, you can have a look in the dependencies of latest markdownlint-cli2 version.

## markdownlint documentation

- Version in MegaLinter: **0.44.0**
- Version in MegaLinter: **0.17.2**
- Visit [Official Web Site](https://github.com/DavidAnson/markdownlint#readme){target=_blank}
- See [How to configure markdownlint rules](https://github.com/igorshubovych/markdownlint-cli#configuration){target=_blank}
- See [How to configure markdownlint rules](https://github.com/DavidAnson/markdownlint-cli2#configuration){target=_blank}
- If custom `.markdownlint.json` config file isn't found, [.markdownlint.json](https://github.com/oxsecurity/megalinter/tree/main/TEMPLATES/.markdownlint.json){target=_blank} will be used
- See [How to disable markdownlint rules in files](https://github.com/DavidAnson/markdownlint#configuration){target=_blank}
- See [How to ignore files and directories with markdownlint](https://github.com/igorshubovych/markdownlint-cli#ignoring-files){target=_blank}
- See [How to ignore files and directories with markdownlint](https://github.com/DavidAnson/markdownlint-cli2#configuration){target=_blank}
- See [Index of problems detected by markdownlint](https://github.com/DavidAnson/markdownlint#rules--aliases){target=_blank}

[![markdownlint - GitHub](https://gh-card.dev/repos/DavidAnson/markdownlint.svg?fullname=)](https://github.com/DavidAnson/markdownlint){target=_blank}
Expand All @@ -39,7 +39,7 @@ To see MarkdownLint version, you can have a look in the dependencies of latest m
| MARKDOWN_MARKDOWNLINT_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| MARKDOWN_MARKDOWNLINT_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| MARKDOWN_MARKDOWNLINT_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `list_of_files`: Call the linter with the list of files as argument<br/>- `project`: Call the linter from the root of the project | `list_of_files` |
| MARKDOWN_MARKDOWNLINT_CLI2_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `list_of_files`: Call the linter with the list of files as argument<br/>- `project`: Call the linter from the root of the project | `list_of_files` |
| MARKDOWN_MARKDOWNLINT_FILE_EXTENSIONS | Allowed file extensions. `"*"` matches any extension, `""` matches empty extension. Empty list excludes all files<br/>Ex: `[".py", ""]` | `[".md"]` |
| MARKDOWN_MARKDOWNLINT_FILE_NAMES_REGEX | File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files<br/>Ex: `["Dockerfile(-.+)?", "Jenkinsfile"]` | Include every file |
| MARKDOWN_MARKDOWNLINT_PRE_COMMANDS | List of bash commands to run before the linter | None |
Expand All @@ -49,7 +49,7 @@ To see MarkdownLint version, you can have a look in the dependencies of latest m
| MARKDOWN_MARKDOWNLINT_RULES_PATH | Path where to find linter configuration file | Workspace folder, then MegaLinter default rules |
| MARKDOWN_MARKDOWNLINT_DISABLE_ERRORS | Run linter but consider errors as warnings | `true` |
| MARKDOWN_MARKDOWNLINT_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | `0` |
| MARKDOWN_MARKDOWNLINT_CLI_EXECUTABLE | Override CLI executable | `['markdownlint']` |
| MARKDOWN_MARKDOWNLINT_CLI2_EXECUTABLE | Override CLI executable | `['markdownlint']` |

## IDE Integration

Expand Down Expand Up @@ -118,7 +118,7 @@ markdownlint --fix -c .markdownlint.json myfile.md
```shell
Usage: markdownlint [options] [files|directories|globs...]

MarkdownLint Command Line Interface
markdownlint command line interface

Arguments:
files|directories|globs files, directories, and/or globs to lint
Expand All @@ -145,9 +145,9 @@ Options:

- Dockerfile commands :
```dockerfile
# renovate: datasource=npm depName=markdownlint-cli
ARG NPM_MARKDOWNLINT_CLI_VERSION=0.44.0
# renovate: datasource=npm depName=markdownlint-cli2
ARG NPM_MARKDOWNLINT_CLI2_VERSION=0.17.2
```

- NPM packages (node.js):
- [markdownlint-cli@0.44.0](https://www.npmjs.com/package/markdownlint-cli/v/0.44.0)
- [markdownlint-cli2@0.17.2](https://www.npmjs.com/package/markdownlint-cli2/v/0.17.2)
1 change: 0 additions & 1 deletion docs/descriptors/repository_trufflehog.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,3 @@ ARG REPOSITORY_TRUFFLEHOG_VERSION=3.88.23
FROM trufflesecurity/trufflehog:${REPOSITORY_TRUFFLEHOG_VERSION} AS trufflehog
COPY --link --from=trufflehog /usr/bin/trufflehog /usr/bin/
```

Loading