Skip to content

Commit f1fb97e

Browse files
Cyberdyne Developmentclaude
andcommitted
chore: restructure into public/ folder for GitHub subtree sync
Move all project files into public/ subfolder. Add GitHub CI workflows (ci.yml, forward-pr.yml, protect-sync-integrity.yml, CodeQL config), LICENSE, and README.md. Update .gitlab-ci.yml with build/test/deploy/sync stages matching FDW pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit f1fb97e

61 files changed

Lines changed: 6839 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# ===============================================
2+
# CRITICAL RULES - BLOCK DEVELOPMENT (Real bugs/security)
3+
# ===============================================
4+
5+
# Security - These are actual vulnerabilities
6+
dotnet_diagnostic.CA3001.severity = error # SQL injection
7+
dotnet_diagnostic.CA3003.severity = error # File path injection
8+
dotnet_diagnostic.CA3006.severity = error # Process command injection
9+
dotnet_diagnostic.CA3075.severity = error # XML DTD processing
10+
dotnet_diagnostic.CA5362.severity = error # Certificate validation bypass
11+
dotnet_diagnostic.CA5394.severity = error # Insecure randomness
12+
dotnet_diagnostic.SCS0002.severity = error # SQL injection
13+
dotnet_diagnostic.SCS0007.severity = error # XSS
14+
dotnet_diagnostic.SCS0028.severity = error # Unsafe deserialization
15+
dotnet_diagnostic.SCS0029.severity = error # Hardcoded passwords
16+
17+
# Memory Leaks - These cause production issues
18+
dotnet_diagnostic.CA1001.severity = error # Types owning disposables must be disposable
19+
dotnet_diagnostic.CA2000.severity = warning # Dispose objects before scope loss
20+
dotnet_diagnostic.CA2213.severity = error # Disposable fields must be disposed
21+
dotnet_diagnostic.IDISP001.severity = warning # Dispose created
22+
dotnet_diagnostic.IDISP003.severity = error # Dispose previous before reassigning
23+
dotnet_diagnostic.IDISP004.severity = error # Don't ignore IDisposable returns
24+
dotnet_diagnostic.IDISP005.severity = error # Return value disposal tracking
25+
dotnet_diagnostic.IDISP007.severity = error # Don't dispose injected
26+
27+
# Async/Threading - These cause deadlocks/crashes
28+
dotnet_diagnostic.VSTHRD100.severity = error # Async void methods
29+
dotnet_diagnostic.VSTHRD110.severity = error # Observe async results
30+
dotnet_diagnostic.VSTHRD002.severity = error # Avoid .Result and .Wait()
31+
dotnet_diagnostic.AsyncFixer03.severity = error # Fire-and-forget async
32+
33+
# Reliability - These cause runtime failures
34+
dotnet_diagnostic.CA2201.severity = error # Don't raise reserved exceptions
35+
dotnet_diagnostic.CA2219.severity = error # Don't raise exceptions in finally
36+
dotnet_diagnostic.CA2241.severity = error # String format mismatches
37+
38+
# ===============================================
39+
# PERFORMANCE RULES - AUTO-FIXABLE (Won't block dev)
40+
# ===============================================
41+
42+
# All these have automatic fixes and improve performance
43+
dotnet_diagnostic.CA1510.severity = warning # Remove redundant null checks
44+
dotnet_diagnostic.CA1822.severity = warning # Mark members as static
45+
dotnet_diagnostic.CA1865.severity = warning # Use char overloads instead of string
46+
dotnet_diagnostic.CA1805.severity = warning # Remove explicit initialization to default
47+
dotnet_diagnostic.CA1859.severity = warning # Use concrete return types
48+
dotnet_diagnostic.CA1720.severity = warning # Rename identifier that conflicts with type
49+
dotnet_diagnostic.CA1827.severity = suggestion # Use Any() instead of Count() > 0
50+
dotnet_diagnostic.CA1829.severity = suggestion # Use Length/Count property
51+
dotnet_diagnostic.CA1834.severity = suggestion # Use StringBuilder.Append(char)
52+
dotnet_diagnostic.CA1835.severity = suggestion # Use Memory/Span overloads
53+
dotnet_diagnostic.CA1841.severity = suggestion # Prefer Dictionary.Contains
54+
dotnet_diagnostic.CA1845.severity = suggestion # Use span-based string.Concat
55+
dotnet_diagnostic.CA1846.severity = suggestion # Prefer AsSpan over Substring
56+
dotnet_diagnostic.CA1847.severity = suggestion # Use char literal for single char
57+
dotnet_diagnostic.CA2016.severity = warning # Forward CancellationToken
58+
59+
# Meziantou Performance - All auto-fixable
60+
dotnet_diagnostic.MA0029.severity = suggestion # Combine LINQ methods
61+
dotnet_diagnostic.MA0063.severity = suggestion # Optimize Enumerable.Count() usage
62+
dotnet_diagnostic.MA0066.severity = suggestion # Use Equals over CompareTo == 0
63+
dotnet_diagnostic.MA0067.severity = suggestion # Use Guid.Empty
64+
dotnet_diagnostic.MA0089.severity = suggestion # Use Memory optimizations
65+
dotnet_diagnostic.MA0110.severity = suggestion # Use regex source generator
66+
dotnet_diagnostic.MA0098.severity = suggestion # Use IEnumerable.Any() instead of Count()
67+
68+
# AsyncFixer - Auto-fixable performance
69+
dotnet_diagnostic.AsyncFixer01.severity = suggestion # Unnecessary async/await
70+
dotnet_diagnostic.AsyncFixer04.severity = suggestion # ConfigureAwait(false)
71+
dotnet_diagnostic.AsyncFixer05.severity = suggestion # Downcasting Task<T> to Task
72+
73+
# ===============================================
74+
# FORMATTING - ONLY IN CI/CD (Never block local dev)
75+
# ===============================================
76+
77+
# StyleCop - All auto-fixable formatting
78+
dotnet_diagnostic.SA1000.severity = none # Keywords should be spaced correctly
79+
dotnet_diagnostic.SA1005.severity = none # Single line comment spacing
80+
dotnet_diagnostic.SA1010.severity = none # Opening square brackets should not be preceded by a space
81+
dotnet_diagnostic.SA1025.severity = none # Multiple whitespace
82+
dotnet_diagnostic.SA1027.severity = none # Tabs and spaces should be used correctly
83+
dotnet_diagnostic.SA1028.severity = none # No trailing whitespace
84+
dotnet_diagnostic.SA1121.severity = none # Use built-in type alias
85+
dotnet_diagnostic.SA1122.severity = none # Use string.Empty
86+
dotnet_diagnostic.SA1137.severity = none # Same indentation
87+
dotnet_diagnostic.SA1204.severity = none # Static members should appear before non-static members
88+
dotnet_diagnostic.SA1210.severity = none # Using directives ordering
89+
dotnet_diagnostic.SA1214.severity = none # Readonly fields should appear before non-readonly fields
90+
dotnet_diagnostic.SA1413.severity = none # Trailing comma
91+
dotnet_diagnostic.SA1503.severity = none # Braces should not be omitted
92+
dotnet_diagnostic.SA1508.severity = none # Closing brace should not be preceded by a blank line
93+
dotnet_diagnostic.SA1516.severity = none # Elements separated by blank line
94+
95+
# ===============================================
96+
# PERMANENTLY DISABLED (Noise/False positives)
97+
# ===============================================
98+
99+
# Too pedantic or situational
100+
dotnet_diagnostic.CA1062.severity = none # Validate arguments (null checks everywhere)
101+
dotnet_diagnostic.CA1303.severity = none # Localization
102+
dotnet_diagnostic.CA1031.severity = none # Catch specific exceptions
103+
dotnet_diagnostic.CA1014.severity = none # CLSCompliant
104+
dotnet_diagnostic.CA2007.severity = none # ConfigureAwait (covered by AsyncFixer)
105+
106+
# Naming - Only enforce on public API surface
107+
dotnet_code_quality.CA1707.api_surface = public # Allow underscores in private members (_camelCase convention)
108+
dotnet_diagnostic.SA1600.severity = none # Documentation
109+
dotnet_diagnostic.SA1633.severity = none # File headers
110+
dotnet_diagnostic.SA1402.severity = none # Single type per file
111+
dotnet_diagnostic.SA1101.severity = none # Prefix this
112+
dotnet_diagnostic.SA1309.severity = none # Field underscore
113+
dotnet_diagnostic.SA1200.severity = none # Using directives placement
114+
dotnet_diagnostic.MA0002.severity = warning # Use IEqualityComparer or IComparer (perf issue)
115+
dotnet_diagnostic.MA0004.severity = none # Use AsyncFixer04 instead
116+
dotnet_diagnostic.MA0006.severity = suggestion # Use string.Equals (correctness)
117+
dotnet_diagnostic.MA0009.severity = warning # Regex DoS (real security issue)
118+
dotnet_diagnostic.MA0016.severity = suggestion # Prefer abstraction over implementation
119+
dotnet_diagnostic.MA0048.severity = none # File name must match type name - replaced by FDW005 (supports generic arity variants)
120+
dotnet_diagnostic.FDW005.severity = warning # File name must match type name (FDW custom - allows generic arity variants in same file)
121+
dotnet_diagnostic.FDW006.severity = warning # Method too long (replaces MA0051)
122+
dotnet_diagnostic.FDW007.severity = warning # Method too complex
123+
dotnet_diagnostic.FDW008.severity = warning # Method name contains underscore
124+
dotnet_diagnostic.MA0051.severity = none # Replaced by FDW006+FDW007
125+
dotnet_diagnostic.VSTHRD200.severity = none # Async suffix - confusing API
126+
127+
# ===============================================
128+
# MODERN ANALYZER RECOMMENDATIONS
129+
# ===============================================
130+
131+
# Consider adding these modern analyzers:
132+
# - Microsoft.CodeAnalysis.NetAnalyzers (included in .NET SDK)
133+
# - Roslynator.Analyzers (excellent refactoring, not pedantic)
134+
# - Microsoft.VisualStudio.Threading.Analyzers (you have this)
135+
# - NetFabric.Hyperlinq.Analyzer (LINQ performance)
136+
# - SmartAnalyzers.CSharpExtensions.Annotations (null safety)
137+
138+
# ===============================================
139+
# CI/CD ESCALATION (add to your pipeline)
140+
# ===============================================
141+
# In your azure-pipelines.yml:
142+
# - script: |
143+
# dotnet format --verify-no-changes --severity info
144+
# displayName: 'Verify formatting'
145+
# condition: eq(variables['Build.Reason'], 'PullRequest')
146+
#
147+
# - script: |
148+
# dotnet build -p:EnforceCodeStyleInBuild=true -p:TreatWarningsAsErrors=true
149+
# displayName: 'Build with strict analysis'
150+
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
151+
152+
# ===============================================
153+
# IDE EXPERIENCE SETTINGS
154+
# ===============================================
155+
156+
# Modern C# preferences (all have fixes)
157+
csharp_style_prefer_switch_expression = true:suggestion
158+
csharp_style_prefer_pattern_matching = true:suggestion
159+
csharp_style_prefer_null_check_over_type_check = true:suggestion
160+
csharp_prefer_simple_using_statement = true:suggestion
161+
csharp_style_prefer_index_operator = true:suggestion
162+
csharp_style_prefer_range_operator = true:suggestion
163+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
164+
csharp_style_prefer_tuple_swap = true:suggestion
165+
csharp_style_prefer_utf8_string_literals = true:suggestion
166+
167+
# Init-only preferences
168+
csharp_style_prefer_readonly_struct = true:suggestion
169+
csharp_style_prefer_readonly_struct_member = true:suggestion
170+
171+
# File scoped namespaces (modern C#)
172+
csharp_style_namespace_declarations = file_scoped:suggestion
173+
174+
# Primary constructors (C# 12)
175+
csharp_style_prefer_primary_constructors = true:suggestion
176+
177+
# ===============================================
178+
# NAMING CONVENTIONS (non-blocking)
179+
# ===============================================
180+
181+
# Define naming rules but keep them as suggestions
182+
dotnet_naming_rule.async_methods_should_have_suffix.severity = suggestion
183+
dotnet_naming_rule.async_methods_should_have_suffix.symbols = async_methods
184+
dotnet_naming_rule.async_methods_should_have_suffix.style = async_suffix
185+
186+
dotnet_naming_symbols.async_methods.applicable_kinds = method
187+
dotnet_naming_symbols.async_methods.applicable_accessibilities = *
188+
dotnet_naming_symbols.async_methods.required_modifiers = async
189+
190+
dotnet_naming_style.async_suffix.required_suffix = Async
191+
dotnet_naming_style.async_suffix.capitalization = pascal_case

.github/codeql/codeql-config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: "CodeQL Config"
2+
3+
paths-ignore:
4+
- tests
5+
- '**/*.Tests'
6+
- '**/*.Tests.csproj'
7+
- '**/tests/**'

.github/workflows/ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
paths-ignore:
9+
- 'README.md'
10+
- 'LICENSE'
11+
- '*.md'
12+
pull_request:
13+
branches:
14+
- master
15+
- develop
16+
workflow_dispatch:
17+
18+
env:
19+
DOTNET_VERSION: '10.0'
20+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
21+
DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet
22+
23+
jobs:
24+
build-and-test:
25+
name: Build and Test
26+
runs-on: windows-latest
27+
env:
28+
BUILD_CONFIGURATION: Release
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup .NET
36+
uses: actions/setup-dotnet@v4
37+
with:
38+
global-json-file: global.json
39+
40+
- name: Cache NuGet packages
41+
uses: actions/cache@v4
42+
with:
43+
path: ${{ env.NUGET_PACKAGES }}
44+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
45+
restore-keys: |
46+
${{ runner.os }}-nuget-
47+
48+
- name: Restore packages
49+
run: dotnet restore
50+
51+
- name: Build
52+
run: dotnet build --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
53+
54+
- name: Test
55+
run: dotnet test --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --verbosity normal
56+
continue-on-error: ${{ github.ref == 'refs/heads/develop' }}
57+
58+
security-scan:
59+
name: Security Scan
60+
runs-on: windows-latest
61+
needs: build-and-test
62+
if: |
63+
github.event_name == 'push' &&
64+
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
65+
permissions:
66+
actions: read
67+
contents: read
68+
security-events: write
69+
env:
70+
BUILD_CONFIGURATION: Release
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
with:
75+
fetch-depth: 0
76+
77+
- name: Setup .NET
78+
uses: actions/setup-dotnet@v4
79+
with:
80+
global-json-file: global.json
81+
82+
- name: Initialize CodeQL
83+
uses: github/codeql-action/init@v3
84+
with:
85+
languages: csharp
86+
config-file: ./.github/codeql/codeql-config.yml
87+
88+
- name: Restore packages
89+
run: dotnet restore
90+
91+
- name: Build for CodeQL
92+
run: dotnet build --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
93+
94+
- name: Perform CodeQL Analysis
95+
uses: github/codeql-action/analyze@v3
96+
with:
97+
category: "/language:csharp"
98+
continue-on-error: true
99+
100+
- name: Security audit (vulnerable packages)
101+
run: |
102+
$output = dotnet list package --vulnerable --include-transitive 2>&1
103+
Write-Output $output
104+
if ($output -match "has the following vulnerable packages") {
105+
Write-Output "::error::Vulnerable packages detected"
106+
exit 1
107+
}
108+
continue-on-error: true

.github/workflows/forward-pr.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Forward PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
notify-internal:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Trigger internal review pipeline
12+
run: |
13+
curl -X POST \
14+
--fail \
15+
-F "token=${{ secrets.INTERNAL_TRIGGER_TOKEN }}" \
16+
-F "ref=develop" \
17+
-F "variables[PR_NUMBER]=${{ github.event.pull_request.number }}" \
18+
"${{ secrets.INTERNAL_API_URL }}"
19+
20+
echo "PR #${{ github.event.pull_request.number }} forwarded for internal review"
21+
22+
- name: Comment on PR
23+
uses: actions/github-script@v7
24+
with:
25+
script: |
26+
await github.rest.issues.createComment({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
issue_number: context.issue.number,
30+
body: 'Thanks for your contribution!\n\nThis PR has been forwarded to our internal review system. A maintainer will review and merge it there, which will automatically close this PR.\n\nPlease do not merge this PR directly via GitHub - it will be handled through our sync process.'
31+
});

0 commit comments

Comments
 (0)