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

Fix markdownlint warnings #194

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Markdown Lint CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v19
with:
globs: 'doc/rules/*.md'
12 changes: 12 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"no-duplicate-heading": {
"siblings_only": true
},
"MD033": {
"allowed_elements": [
"a",
"div"
]
},
"MD041": false
}
3 changes: 2 additions & 1 deletion doc/rules/ByteOrderMark.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ parent directory, respectively). So, for example, the pattern

Note that the pattern matching is performed with the relative paths to the
directory containing the configuration file `StyleChecker.xml`, so if the
pattern starts with a slash, it does not match any file. It is recommended to place the configuration file in the project root directory.
pattern starts with a slash, it does not match any file. It is recommended to
place the configuration file in the project root directory.

The pattern can contain an asterisk ('`*`') character as a wildcard,
which matches any character other than a slash zero or more times.
Expand Down
4 changes: 2 additions & 2 deletions doc/rules/DiscardingReturnValue.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ return value must not be ignored. The value of `id` attribute
must represent the fully-qualified type name (of the type containing it)
followed by its name and parameter types as follows:

```
FullyQualifiedTypeName.MethodName(ParameterTypeName1, ParameterTypeName2, ...)
```csharp
FullyQualifiedTypeName.MethodName(ParameterTypeName1, ParameterTypeName2, )
```

The type name must be fully-qualified,
Expand Down
2 changes: 2 additions & 0 deletions doc/rules/NoDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void Foo()

To do so, edit `StyleChecker.xml` file as follows:

<!-- markdownlint-disable MD013 -->
```xml
<?xml version="1.0" encoding="utf-8" ?>
<config xmlns="https://maroontress.com/StyleChecker/config.v1">
Expand All @@ -58,6 +59,7 @@ To do so, edit `StyleChecker.xml` file as follows:
</config>
```
<!-- markdownlint-enable MD013 -->

Further more, for example, if you would like ignore test classes wholly
(namely, ignore them and all they contain) like the following code:
Expand Down
1 change: 0 additions & 1 deletion doc/rules/NoSingleSpaceAfterTripleSlash.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- markdownlint-disable MD024 MD033 MD041-->
<div class="project-logo">StyleChecker</div>
<div id="toc-level" data-values="H2,H3"></div>

Expand Down
1 change: 1 addition & 0 deletions doc/rules/NotOneShotInitialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ public void Baz()
...
}
```

> [Run][example-2]

Or more simply, you can also use a tuple containing the action of type `Action`
Expand Down
5 changes: 2 additions & 3 deletions doc/rules/TypeClassParameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,13 @@ invokes the original version of `Print` with an argument other than the
`typeof()` operator whose operand is not a `static` class, because it is
unable to replace the parameter `type` with a type parameter `T`.

> ### Restriction
> 🚧 **Restriction**
>
> This analyzer can only diagnose local functions and private methods
> with the Visual Studio 2019 editor.
> To diagnose non-private methods with Visual Studio 2019,
> perform Build Solution or Analysis ➜ Run Code Analysis.


## Code fix

The code fix provides the option of replacing the parameter with a type
Expand Down Expand Up @@ -108,7 +107,7 @@ public void Invoke()
}
```

> ### Remarks
> 🚨 **Remarks**
>
> If a type has both `DoSomething<T>()` and `DoSomething(Type)` methods
> at the same time, the code fix provider renames `DoSomething<T>`
Expand Down
2 changes: 1 addition & 1 deletion doc/rules/UnnecessaryUsing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Warning
implement [IDisposable][system.idisposable] but dispose of nothing.
See the note of them \[[1](#ref1)\], which is quoted as follows:

> #### Note
> **Note**
>
> This type implements the `IDisposable` interface, but does not actually
> have any resources to dispose. This means that disposing it by directly
Expand Down
Loading