Skip to content
Merged
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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Restore dependencies
run: dotnet restore SharpLinter.slnx

- name: Build Solution
run: dotnet build SharpLinter.slnx --configuration Release --no-restore

- name: Run Tests
run: dotnet test SharpLinter.slnx --configuration Release --no-build --verbosity normal

- name: Pack NuGet Packages
run: dotnet pack SharpLinter.slnx --configuration Release --no-build -o artifacts

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: artifacts/*.nupkg
16 changes: 16 additions & 0 deletions .sharplinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"preset": "recommended",
"customRulesFile": ".sharplinter.rules.yaml",
"exclude": [
"**/bin/**",
"**/obj/**",
"**/artifacts/**",
"**/nupkg/**"
],
"formatting": {
"enabled": true,
"indentSize": 4,
"useTabs": false,
"newLineForBraces": true
}
}
37 changes: 37 additions & 0 deletions .sharplinter.rules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SharpLinter Custom Rules
# Define your own rules here without writing C# analyzer code.

rules:
# Example 1: Flag TODO or HACK comments in code
- id: "CUSTOM001"
title: "Clean up temporary comments"
description: "HACK, TODO, or FIXME comments should be resolved before committing code."
category: "Maintainability"
severity: "warning"
type: "pattern"
pattern:
kind: "comment"
match: "TODO|HACK|FIXME"

# Example 2: Limit method length to 40 lines
- id: "CUSTOM002"
title: "Method exceeds line limit"
description: "Methods should not exceed 40 lines. Consider decomposing complex logic."
category: "Maintainability"
severity: "suggestion"
type: "metric"
metric:
target: "method"
measure: "lines"
max: 40

# Example 3: Ban public fields
- id: "CUSTOM003"
title: "Encapsulation violation"
description: "Public instance fields should be refactored to properties."
category: "Design"
severity: "warning"
type: "naming"
naming:
target: "field"
pattern: "^[a-z_][a-zA-Z0-9]*$" # camelCase fields should be private/protected
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 rahu619

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 0 additions & 45 deletions LinterProject.API/Controllers/CodeAnalysisController.cs

This file was deleted.

38 changes: 0 additions & 38 deletions LinterProject.API/ExceptionHandlingMiddleware.cs

This file was deleted.

16 changes: 0 additions & 16 deletions LinterProject.API/Interfaces/ICodeAnalysisService.cs

This file was deleted.

17 changes: 0 additions & 17 deletions LinterProject.API/LinterProject.API.csproj

This file was deleted.

39 changes: 0 additions & 39 deletions LinterProject.API/Program.cs

This file was deleted.

31 changes: 0 additions & 31 deletions LinterProject.API/Properties/launchSettings.json

This file was deleted.

86 changes: 0 additions & 86 deletions LinterProject.API/Services/CodeAnalysisService.cs

This file was deleted.

Loading