Skip to content
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

Ci/test md autofix #1

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
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
23 changes: 23 additions & 0 deletions .github/workflows/pr_linter_markdown_matcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Trigger
on:
pull_request:
branches: [main]
paths:
- "content/**/*.md"

jobs:
lilint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Node
uses: actions/[email protected]
with:
node-version: 14

- run: npm install -g markdownlint-cli

- uses: xt0rted/markdownlint-problem-matcher@v1

- run: markdownlint -i "**/template_*.md" -i node_modules content/**/*.md
30 changes: 30 additions & 0 deletions .github/workflows/pr_linter_markdown_reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: reporter

# Trigger
on:
pull_request:
branches: [main]
paths:
- "content/**/*.md"

jobs:
mdlint-report:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: markdownlint-github-check
uses: reviewdog/action-markdownlint@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
level: warning
filter_mode: nofilter

- name: markdownlint-github-pr-review
uses: reviewdog/action-markdownlint@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
markdownlint_flags: content/**/*.md
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.28.1
hooks:
- id: markdownlint
args: [
"--config", ".markdownlint.json",
"--fix",
"-i", "**/template_*.md",
"--output", "linter_markdown_report.txt"
]
language_version: "14.17.6"

# Specific part for https://pre-commit.ci
ci:
autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit.com hooks"
Expand Down
38 changes: 38 additions & 0 deletions content/articles/2021/test_bad_markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Hello !


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3]

Guts marked this conversation as resolved.
Show resolved Hide resolved
# Bonjour 2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD025/single-title/single-h1 Multiple top level headings in the same document [Context: "# Bonjour 2"]


- salut
- première liste à puces


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint-fix] reported by reviewdog 🐶

Suggested change

* et bam
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]

* une autre liste à puces mais pas avec le même caractère
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]


bash
sfbdfdb


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3]


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 4]


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 5]


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 6]

Comment on lines +15 to +19
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint-fix] reported by reviewdog 🐶

Suggested change

# chouette!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD025/single-title/single-h1 Multiple top level headings in the same document [Context: "# chouette!"]


<!-- un saut de ligne anormal -->

---
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD035/hr-style Horizontal rule style [Expected: ----; Actual: ---]


<!-- un saut de ligne normal -->

----

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]

<!-- la balise vidéo est acceptée grâce à la configuration -->
<video width="700" controls>
<!-- markdownlint-disable MD033 -->
<source src="https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_1280_10MG.mp4" type="video/mp4">
Votre navigateur ne supporte pas la balise video HTML 5.
<!-- markdownlint-enable MD033 -->
</video>