Skip to content

Commit 680aa99

Browse files
Add linter step in CI build workflow
1 parent 95a3c7d commit 680aa99

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/ci-build.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ jobs:
2121
- name: Restore dependencies
2222
run: dotnet restore
2323

24-
# Format the output of dotnet format
25-
- name: Add dotnet-format problem matcher
26-
uses: xt0rted/dotnet-format-problem-matcher@v1
27-
2824
# Install dotnet format as a global tool
29-
- name: Install dotnet format
30-
run: |
31-
dotnet tool install --global dotnet-format
32-
dotnet format --verify-no-changes --verbosity diagnostic
25+
- name: Install dotnet tools
26+
run: dotnet tool restore
27+
28+
- name: Run Linter
29+
run: check.sh
3330

3431
- name: Build
3532
run: dotnet build --no-restore

check.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
dotnet jb inspectcode Notion.sln -f="Text" --no-build --include="**.cs" -o=".lint/CodeWarningResults.txt"
4+
5+
totalLines=`cat .lint/CodeWarningResults.txt | grep "^.*$" -c`
6+
7+
if [[ "$totalLines" -gt 1 ]]; then
8+
echo "There are few linter warnings - please fix them before running the pipeline"
9+
cat .lint/CodeWarningResults.txt
10+
exit 1
11+
fi

0 commit comments

Comments
 (0)