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

chore: Add tooling from docs project #647

Merged
merged 8 commits into from
Nov 30, 2023
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
44 changes: 44 additions & 0 deletions .github/linters/.markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
###########################
###########################
## Markdown Linter rules ##
###########################
###########################

# Linter rules doc:
# - https://github.com/DavidAnson/markdownlint
#
# Note:
# To comment out a single error:
# <!-- markdownlint-disable -->
# any violations you want
# <!-- markdownlint-restore -->
#

###############
# Rules by id #
###############
MD024: false
MD013:
line_length: 120
code_blocks: false
ignore_code_blocks: true
tables: false
MD026: false
MD046: false # Mix of indented and fenced code blocks
MD004: false
# MD004: false # Unordered list style
# MD007:
# indent: 2 # Unordered list indentation
# MD013:
# line_length: 808 # Line length
# MD026:
# punctuation: ".,;:!。,;:" # List of not allowed
# MD029: false # Ordered list item prefix
# MD033: false # Allow inline HTML
# MD036: false # Emphasis used instead of a heading

#################
# Rules by tags #
#################
# blank_lines: false # Error on blank lines
32 changes: 31 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,40 @@ name: CI
on:
push:
branches:
- master
- master
pull_request:
branches:
- master

jobs:
linting:
name: "Markdown linting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out the code
- uses: actions/setup-node@v4
name: Setup node
with:
node-version: "18"
- run: npm install -g markdownlint-cli2
name: Install markdownlint-cli2
- run: markdownlint-cli2-config ".github/linters/.markdownlint.yml" "documentation/*.md"
name: run Markdownlint
spellcheck:
name: "Spell check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out the code
- uses: actions/setup-node@v4
name: Setup node
with:
node-version: "18"
- run: npm install -g cspell
name: Install cSpell
- run: cspell --config ./cSpell.json "documentation/*.md" --no-progress
name: run cSpell
build:
runs-on: windows-latest
steps:
Expand Down
11 changes: 11 additions & 0 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"MD024": false,
"MD013": {
"line_length": 123,
"code_blocks": false,
"tables": false
},
"MD026": false,
"MD046": false,
"MD004": false
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"cSpell.words": [
"Linq",
"addin",
"addins",
"intellisense",
"langword",
"nunit",
"NUnit",
"paramref",
"typeparam",
"typeparamref",
"wiki"
],
"cSpell.enabled": true,
"cSpell.enableFiletypes": [
"aspnetcorerazor"
],
"editor.wordWrap": "wordWrapColumn",
"editor.wrappingIndent": "same",
"editor.wordWrapColumn": 120,
"editor.rulers": [120],
}
222 changes: 222 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
{
"version": "0.2",
"language": "en",
"words": [
"buildable",
"choco",
"chocolatey",
"CODEPAGE",
"Codespaces",
"combinatorially",
"composability",
"discoverability",
"Dogfood",
"DWORD",
"Enumerables",
"frameworkteam",
"Guid",
"Guids",
"Hashtable",
"hotfix",
"hotfixes",
"intellisense",
"Interpolatable",
"ints",
"JetBrains",
"Linq",
"nameof",
"nuget",
"nunit",
"NUnit",
"nuspecs",
"Obsoletion",
"Parallelizable",
"parallelization",
"paramref",
"PDBs",
"Pluggable",
"prefilter",
"Randomizer",
"Refactorings",
"reimplementation",
"Remoting",
"ReSharper",
"ruleset",
"runtimes",
"seamlessness",
"Serializable",
"Silverlight",
"teamcity",
"Tracelog",
"typeof",
"typeparam",
"typeparamref",
"Ulps",
"ULPs",
"uninstantiated",
"unmanaged",
"VSIX",
"VSIXes",
"vstest",
"wiki",
"writability",
"yourfoldername"
],
"ignoreWords": [
"addin",
"addins",
"langword",
"ushort",
"ulong",
"iarray",
"sarray",
"idict",
"onetimesetup",
"onetimeteardown",
"testfixture",
"setupfixture",
"datapoint",
"datapoints",
"sbyte",
"IntelliTests",
"IntelliTest",
"shadowcopy",
"testcase",
"Testcase",
"netcoreapp",
"netcore",
"nunitlite",
"nunitagent",
"tracelevel",
"vssettings",
"notabug",
"norepro",
"wontfix",
"easyfix",
"nupkg",
"Terje",
"Prouse",
"runsettings",
"aolszowka",
"Letterle",
"Fixtureparams",
"tipsandtricks",
"Musser",
"Sandstrom",
"Idfor",
"editorconfig",
"Testgenerator",
"HKCU",
"testcasecount",
"inputfiles",
"inprocess",
"testlist",
"configfile",
"appbase",
"classname",
"runstate",
"fullname",
"teardowns",
"Halvorsen",
"iunequal",
"cppsample",
"SSCLI",
"Afterxxx",
"activeconfig",
"netstandard",
"Gallio",
"Codice",
"mytest",
"Rebracer",
"myassembly",
"FULLNAMES",
"markdownlint",
"netcorefactory",
"pakrym",
"rprouse",
"Blazor",
"WASM",
"methodname",
"netfx",
"snupkg",
"testparam",
"gleb",
"osokin",
"lahma",
"unsortable",
"Dalsbø",
"Delarosbil",
"Mikkel",
"Nylander",
"Bundgaard",
"Weerdenburg",
"Ihor",
"Sychevskyi",
"Cropp",
"Maddock",
"Frans",
"Bouma",
"yowko"
],
"patterns": [
{
"name": "Markdown links",
"pattern": "\\((.*)\\)",
"description": ""
},
{
"name": "Markdown code blocks",
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
},
{
"name": "Inline code blocks",
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
},
{
"name": "Link contents",
"pattern": "\\<a(.*)\\>",
"description": ""
},
{
"name": "Snippet references",
"pattern": "-- snippet:(.*)",
"description": ""
},
{
"name": "Snippet references 2",
"pattern": "\\<\\[sample:(.*)",
"description": "another kind of snippet reference"
},
{
"name": "Multi-line code blocks",
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm"
},
{
"name": "HTML Tags",
"pattern": "<[^>]*>",
"description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string"
},
{
"name": "UID Lines",
"pattern": "uid: (.*)"
}
],
"ignoreRegExpList": [
"Markdown links",
"Markdown code blocks",
"Inline code blocks",
"Link contents",
"Snippet references",
"Snippet references 2",
"Multi-line code blocks",
"HTML Tags",
"UID Lines"
],
"ignorePaths": [
"**/articles/nunit-engine/release-notes.md",
"**/articles/nunit/release-notes/framework.md",
"**/articles/vs-test-adapter/AdapterV*-Release-Notes.md"
]
}
9 changes: 6 additions & 3 deletions documentation/NUnit1001.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

## Description

The individual arguments provided by a TestCaseAttribute must match the type of the corresponding parameter of the method.
The individual arguments provided by a TestCaseAttribute must match the type of the corresponding parameter of the
method.

## Motivation

Expand All @@ -32,7 +33,8 @@ public void SampleTest(int numberValue)

### Problem

In the test case above, `true` in the test case indicates that `numberValue` should be a boolean. However, the test declares that `numberValue` is an integer. This will lead to a runtime failure.
In the test case above, `true` in the test case indicates that `numberValue` should be a boolean. However, the test
declares that `numberValue` is an integer. This will lead to a runtime failure.

### Fix

Expand Down Expand Up @@ -65,7 +67,8 @@ public void SampleTest(int numberValue)

### Via ruleset file

Configure the severity per project, for more info see [MSDN](https://learn.microsoft.com/en-us/visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules?view=vs-2022).
Configure the severity per project, for more info see
[MSDN](https://learn.microsoft.com/en-us/visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules?view=vs-2022).

### Via .editorconfig file

Expand Down
Loading