Added markdownlint to the pre-commit actions

This commit is contained in:
Michele Cereda
2022-05-08 22:05:02 +02:00
parent 1193cc6fc4
commit 4619d75381
4 changed files with 39 additions and 3 deletions

View File

@@ -12,6 +12,12 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: check-yaml - id: check-yaml
- id: check-added-large-files - id: check-added-large-files
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
args:
- -r "~MD013" # ignore line-length rule
- repo: https://github.com/ansible-community/ansible-lint - repo: https://github.com/ansible-community/ansible-lint
rev: v6.0.2 rev: v6.0.2
hooks: hooks:

View File

@@ -24,7 +24,6 @@ This repository is not open for contributions, but I might accept suggestions. P
- [myshittycode.com] - [myshittycode.com]
[LICENSE]: LICENSE [LICENSE]: LICENSE
[myshittycode.com]: https://myshittycode.com/ [myshittycode.com]: https://myshittycode.com/

View File

@@ -11,6 +11,9 @@ gem install mdl
# Check files. # Check files.
mdl README.md mdl README.md
mdl path/to/dir/ mdl path/to/dir/
# Ignore a specific rule.
mdl -r "~MD013" README.md
``` ```
## Further readings ## Further readings

View File

@@ -7,8 +7,8 @@
pre-commit sample-config > .pre-commit-config.yaml pre-commit sample-config > .pre-commit-config.yaml
# manually run checks # manually run checks
pre-commit run --all-files # all checks pre-commit run --all-files
pre-commit run ansible-lint # ansible-lint only pre-commit run ansible-lint --files ansible/
# automatically run checks at every commit # automatically run checks at every commit
pre-commit install pre-commit install
@@ -20,6 +20,34 @@ pre-commit autoupdate
SKIP=flake8 git commit -m "foo" SKIP=flake8 git commit -m "foo"
``` ```
```yaml
---
# File .pre-commit-config.yaml
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md # ignore markdown's line break
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
args:
- -r "~MD013" # ignore line-length rule
- repo: https://github.com/ansible-community/ansible-lint
rev: v6.0.2
hooks:
- id: ansible-lint
```
## Further readings ## Further readings
- Pre-commit's [website] - Pre-commit's [website]