Skip to content

Commit 958cf1a

Browse files
committed
Initial commit
0 parents  commit 958cf1a

14 files changed

+398
-0
lines changed

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
insert_final_newline = true
6+
indent_size = 4
7+
indent_style = space
8+
trim_trailing_whitespace = true
9+
10+
[*.js]
11+
end_of_line = lf
12+
indent_size = 2
13+
14+
[*.json]
15+
indent_size = 2
16+
17+
[*.ts]
18+
end_of_line = lf
19+
indent_size = 2
20+
21+
[*.yml]
22+
indent_size = 2
23+
24+
[{package.json,package-lock.json}]
25+
end_of_line = lf

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
*.js text eol=lf
5+
*.ts text eol=lf
6+
7+
package.json text eol=lf
8+
package-lock.json text eol=lf
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "dotnet-format",
5+
"pattern": [
6+
{
7+
"regexp": "^\\s+(.*)\\((\\d+),(\\d+)\\):\\s+(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4
12+
}
13+
]
14+
}
15+
]
16+
}

.github/workflows/pull_request.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Pull Request
2+
3+
on: pull_request
4+
5+
jobs:
6+
message-check:
7+
name: Block Autosquash Commits
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Block Autosquash Commits
13+
uses: xt0rted/block-autosquash-commits-action@v2.0.0
14+
with:
15+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
__tests__/runner/*
2+
3+
# comment out in distribution branches
4+
dist/
5+
6+
node_modules/
7+
lib/
8+
9+
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
10+
# Logs
11+
logs
12+
*.log
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
lerna-debug.log*
17+
18+
# Diagnostic reports (https://nodejs.org/api/report.html)
19+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
20+
21+
# Runtime data
22+
pids
23+
*.pid
24+
*.seed
25+
*.pid.lock
26+
27+
# Directory for instrumented libs generated by jscoverage/JSCover
28+
lib-cov
29+
30+
# Coverage directory used by tools like istanbul
31+
coverage
32+
*.lcov
33+
34+
# nyc test coverage
35+
.nyc_output
36+
37+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
38+
.grunt
39+
40+
# Bower dependency directory (https://bower.io/)
41+
bower_components
42+
43+
# node-waf configuration
44+
.lock-wscript
45+
46+
# Compiled binary addons (https://nodejs.org/api/addons.html)
47+
build/Release
48+
49+
# Dependency directories
50+
jspm_packages/
51+
52+
# TypeScript v1 declaration files
53+
typings/
54+
55+
# TypeScript cache
56+
*.tsbuildinfo
57+
58+
# Optional npm cache directory
59+
.npm
60+
61+
# Optional eslint cache
62+
.eslintcache
63+
64+
# Optional REPL history
65+
.node_repl_history
66+
67+
# Output of 'npm pack'
68+
*.tgz
69+
70+
# Yarn Integrity file
71+
.yarn-integrity
72+
73+
# dotenv environment variables file
74+
.env
75+
.env.test
76+
77+
# parcel-bundler cache (https://parceljs.org/)
78+
.cache
79+
80+
# next.js build output
81+
.next
82+
83+
# nuxt.js build output
84+
.nuxt
85+
86+
# vuepress build output
87+
.vuepress/dist
88+
89+
# Serverless directories
90+
.serverless/
91+
92+
# FuseBox cache
93+
.fusebox/
94+
95+
# DynamoDB Local files
96+
.dynamodb/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Brian Surowiec
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# dotnet-format Problem Matcher
2+
3+
[![CI Workflow Status](https://github.com/xt0rted/dotnet-format-problem-matcher/workflows/CI/badge.svg)](https://github.com/xt0rted/dotnet-format-problem-matcher/actions?query=workflow%3ACI)
4+
5+
Adds a problem matcher that will detect errors from [dotnet-format](https://github.com/dotnet/format) and create annotations for them.
6+
7+
## Usage
8+
9+
```yml
10+
on: push
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 3.1.101
19+
- uses: xt0rted/dotnet-format-problem-matcher@v1
20+
- run: dotnet tool install -g dotnet-format
21+
- run: dotnet-format --dry-run
22+
```
23+
24+
![Example of inline annotations](docs/annotations.png)
25+
26+
![Example of build log with highlighted errors](docs/build-log.png)
27+
28+
## Options
29+
30+
Name | Allowed values | Description
31+
-- | -- | --
32+
`action` | `add` (default), `remove` | If the problem matcher should be registered or removed
33+
34+
## License
35+
36+
The scripts and documentation in this project are released under the [MIT License](LICENSE)

action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "dotnet-format Problem Matcher"
2+
3+
description: "Sets up a problem matcher for dotnet-format that's used to create annotations for violations"
4+
5+
author: "xt0rted"
6+
7+
branding:
8+
icon: "command"
9+
color: "green"
10+
11+
inputs:
12+
action:
13+
description: "The action to take on the problem matcher (add or remove)"
14+
required: false
15+
default: add
16+
17+
runs:
18+
using: "node12"
19+
main: "dist/index.js"

docs/annotations.png

26.2 KB
Loading

docs/build-log.png

75.4 KB
Loading

0 commit comments

Comments
 (0)