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

✨ Adds markdown language support #79

Merged
merged 3 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions fmts/doc.go

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

19 changes: 19 additions & 0 deletions fmts/markdown.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package fmts

func init() {
const lang = "markdown"

register(&Fmt{
Name: "remark-lint",
Errorformat: []string{
`%P%f`,
`%#%l:%c %# %trror %m`,
`%#%l:%c %# %tarning %m`,
`%-Q`,
`%-G%.%#`,
},
Description: "Tool for writing clean and consistent markdown code.",
mgrachev marked this conversation as resolved.
Show resolved Hide resolved
URL: "https://github.com/remarkjs/remark-lint",
Language: lang,
})
}
58 changes: 58 additions & 0 deletions fmts/testdata/remark-lint.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
fmts/testdata/resources/markdown/README.md
25:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
26:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
27:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
29:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
30:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
31:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
33:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
34:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
35:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
39:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
40:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
41:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
42:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
43:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
44:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
45:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
63:42-63:95 warning Don’t use literal URLs without angle brackets no-literal-urls remark-lint

fmts/testdata/resources/markdown/subfolder/subFile.md
25:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
26:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
27:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
29:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
30:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
31:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
33:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
34:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
35:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
39:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
40:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
41:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
42:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
43:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
44:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
45:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
63:42-63:95 warning Don’t use literal URLs without angle brackets no-literal-urls remark-lint

fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md
25:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
26:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
27:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
29:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
30:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
31:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
33:3 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
34:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
35:5 warning Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
39:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
40:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
41:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
42:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
43:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
44:7 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
45:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
63:42-63:95 warning Don’t use literal URLs without angle brackets no-literal-urls remark-lint

⚠ 51 warnings
54 changes: 54 additions & 0 deletions fmts/testdata/remark-lint.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
fmts/testdata/resources/markdown/README.md||
fmts/testdata/resources/markdown/README.md|25 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|26 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|27 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|29 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|30 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|31 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|33 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|34 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|35 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|39 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|40 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|41 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|42 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|43 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|44 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|45 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/README.md|63 col 95 warning| Don’t use literal URLs without angle brackets no-literal-urls remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md||
fmts/testdata/resources/markdown/subfolder/subFile.md|25 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|26 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|27 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|29 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|30 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|31 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|33 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|34 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|35 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|39 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|40 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|41 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|42 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|43 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|44 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|45 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subFile.md|63 col 95 warning| Don’t use literal URLs without angle brackets no-literal-urls remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md||
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|25 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|26 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|27 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|29 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|30 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|31 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|33 col 3 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|34 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|35 col 5 warning| Incorrect list-item indent: add 2 spaces list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|39 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|40 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|41 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|42 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|43 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|44 col 7 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|45 col 4 warning| Incorrect list-item indent: add 1 space list-item-indent remark-lint
fmts/testdata/resources/markdown/subfolder/subSubFolder/subSubFile.md|63 col 95 warning| Don’t use literal URLs without angle brackets no-literal-urls remark-lint
65 changes: 65 additions & 0 deletions fmts/testdata/resources/markdown/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Lorem ipsum dolor sit amet, _consectetur_ adipisicing elit, sed do eiusmod
tempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. **_Duis aute irure dolor_** in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

## H2

Lorem ipsum dolor sit amet, _consectetur_ adipisicing elit, sed do eiusmod
tempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.

---

**_Duis aute irure dolor_** in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

##### H3

unordered list:

- item-1
- sub-item-1
- sub-item-2

* item-2
- sub-item-3
- sub-item-4

- item-3
- sub-item-5
- sub-item-6

ordered list:

1. item-1
1. sub-item-1
2. sub-item-2
2. item-2
1. sub-item-3
2. sub-item-4
3. item-3

##### Header4 ?

| Table Header-1 | Table Header-2 | Table Header-3 |
| :------------- | :------------: | -------------: |
| Table Data-1 | Table Data-2 | Table Data-3 |
| TD-4 | Td-5 | TD-6 |
| Table Data-7 | Table Data-8 | Table Data-9 |

# Header5

You may also want some images right in here like ![GitHub Logo](https://cloud.githubusercontent.com/assets/5456665/13322882/e74f6626-dc00-11e5-921d-f6d024a01eaa.png "GitHub") -

you can do that but I would recommend you to use the component "image" and simply split your text.

## Header6

Let us do some links - this for example: https://github.com/MinhasKamal/github-markdown-syntax

is **NOT** a link but this: is [GitHub](https://github.com/MinhasKamal/github-markdown-syntax)
65 changes: 65 additions & 0 deletions fmts/testdata/resources/markdown/subfolder/subFile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Lorem ipsum dolor sit amet, _consectetur_ adipisicing elit, sed do eiusmod
tempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. **_Duis aute irure dolor_** in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

## H2

Lorem ipsum dolor sit amet, _consectetur_ adipisicing elit, sed do eiusmod
tempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.

---

**_Duis aute irure dolor_** in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

##### H3

unordered list:

- item-1
- sub-item-1
- sub-item-2

* item-2
- sub-item-3
- sub-item-4

- item-3
- sub-item-5
- sub-item-6

ordered list:

1. item-1
1. sub-item-1
2. sub-item-2
2. item-2
1. sub-item-3
2. sub-item-4
3. item-3

##### Header4 ?

| Table Header-1 | Table Header-2 | Table Header-3 |
| :------------- | :------------: | -------------: |
| Table Data-1 | Table Data-2 | Table Data-3 |
| TD-4 | Td-5 | TD-6 |
| Table Data-7 | Table Data-8 | Table Data-9 |

# Header5

You may also want some images right in here like ![GitHub Logo](https://cloud.githubusercontent.com/assets/5456665/13322882/e74f6626-dc00-11e5-921d-f6d024a01eaa.png "GitHub") -

you can do that but I would recommend you to use the component "image" and simply split your text.

## Header6

Let us do some links - this for example: https://github.com/MinhasKamal/github-markdown-syntax

is **NOT** a link but this: is [GitHub](https://github.com/MinhasKamal/github-markdown-syntax)
Loading