diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a677f2c..af23b3fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 }} diff --git a/Parse/Parse.csproj b/Parse/Parse.csproj index 4e098693..d0085628 100644 --- a/Parse/Parse.csproj +++ b/Parse/Parse.csproj @@ -27,6 +27,10 @@ + + + + diff --git a/Parse/stylecop.json b/Parse/stylecop.json new file mode 100644 index 00000000..590850cf --- /dev/null +++ b/Parse/stylecop.json @@ -0,0 +1,18 @@ +{ + "settings": { + "documentationRules": { + "documentPublicElements": false + }, + "layoutRules": { + "ignoreSpacesAroundParentheses": true + }, + "orderingRules": { + "elementOrder": [ + "kind", + "accessibility", + "static" + ], + "ignoreAccessModifiers": true + } + } +}