Skip to content

Commit c659c4c

Browse files
authored
Use dotnet-format instead of broken dotnet format (#338)
- Use dotnet-format instead of broken dotnet format
1 parent 73729ba commit c659c4c

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
runs-on: windows-2022
1111
steps:
1212
- uses: actions/checkout@v3
13+
- name: Set up dotnet tools
14+
run: make install-tools
1315
- name: Check dotnet Style
1416
run: make lint
1517
security:
1618
runs-on: windows-2022
1719
steps:
1820
- uses: actions/checkout@v3
1921
- name: Set up dotnet tools
20-
run: make setup-tools
21-
- name: Install security-code-scan
22-
run: make install-scanner
22+
run: make install-tools
2323
- name: Run security analysis
2424
run: make scan
2525
# TODO: In the future, we can collect the output logs by enabling Code Scanning and using the pre-built GitHub Action: https://github.com/marketplace/actions/securitycodescan

Makefile

+13-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ coverage:
2727

2828
## format - Formats the project
2929
format:
30-
dotnet format
30+
dotnet dotnet-format --no-restore
3131

3232
## install-cert - Install the PFX certificate to your system (Windows only)
3333
# @parameters:
@@ -36,13 +36,20 @@ format:
3636
install-cert:
3737
scripts\install_cert.bat ${cert} ${pass}
3838

39-
## install-scanner - Install SecurityCodeScan to your system
40-
install-scanner:
41-
dotnet tool install --local security-scan --version 5.6.3
39+
## install-tools - Install required dotnet tools
40+
install-tools:
41+
dotnet new tool-manifest || exit 0
42+
dotnet tool install --local security-scan --version 5.6.3 || exit 0
43+
dotnet tool install --local dotnet-format || exit 0
44+
45+
## install - Install requirements
46+
install: | install-tools
47+
git submodule init
48+
git submodule update
4249

4350
## lint - Lints the project
4451
lint:
45-
dotnet format --verify-no-changes
52+
dotnet dotnet-format --no-restore --check
4653

4754
## lint-scripts - Lint and validate the Batch scripts (Windows only)
4855
lint-scripts:
@@ -88,10 +95,6 @@ scan:
8895
setup:
8996
scripts\setup.bat
9097

91-
## setup-tools - Set up the manifest files for dotnet tools
92-
setup-tools:
93-
dotnet new tool-manifest
94-
9598
## sign - Sign all generated DLLs and NuGet packages with the provided certificate (Windows only)
9699
# @parameters:
97100
# cert= - The certificate to use for signing the built assets.
@@ -115,4 +118,4 @@ test-fw:
115118
uninstall-scanner:
116119
dotnet tool uninstall security-scan
117120

118-
.PHONY: help build build-test-fw build-prod clean format install-cert install-scanner lint lint-scripts pre-release publish-all publish release restore scan setup setup-tools sign test test-fw uninstall-scanner
121+
.PHONY: help build build-test-fw build-prod clean format install-cert install-tools install lint lint-scripts pre-release publish-all publish release restore scan setup sign test test-fw uninstall-scanner

0 commit comments

Comments
 (0)