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

ci: Add linter #406

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
35 changes: 34 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,39 @@ on:
paths-ignore:
- '**/**.md'
jobs:
lint:
name: Lint
runs-on: windows-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0'
- name: Install dependencies
run: dotnet restore
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
~/.local/share/NuGet/Cache
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Run linting
run: dotnet build --no-restore --configuration Release /warnaserror
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
- name: Save linting logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: stylecop-lint-log
path: lint-output.log
check-dotnet:
strategy:
matrix:
Expand All @@ -19,7 +52,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up .NET SDK
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.DOTNET_VERSION }}
Expand Down
4 changes: 4 additions & 0 deletions Parse/Parse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<PackageReference Include="OpenCover" Version="4.7.1221" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Remove="parse-logo.png" />
<None Include="parse-logo.png">
Expand Down
18 changes: 18 additions & 0 deletions Parse/stylecop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"settings": {
"documentationRules": {
"documentPublicElements": false
},
"layoutRules": {
"ignoreSpacesAroundParentheses": true
},
"orderingRules": {
"elementOrder": [
"kind",
"accessibility",
"static"
],
"ignoreAccessModifiers": true
}
}
}
Loading