Skip to content

Commit c7e72ce

Browse files
committed
Initial commit: CodeContext.NET
A tool that analyzes C# codebases and generates context for AI assistants. Features: - Pattern detection (naming, error handling, async patterns) - Multiple export formats (JSON, Markdown, Plain Text) - Fast parallel processing - NuGet package detection
0 parents  commit c7e72ce

File tree

15 files changed

+1536
-0
lines changed

15 files changed

+1536
-0
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '9.0.x'
20+
21+
- name: Restore dependencies
22+
run: dotnet restore
23+
24+
- name: Build
25+
run: dotnet build --configuration Release --no-restore
26+
27+
- name: Test
28+
run: dotnet test --no-restore --verbosity normal
29+
30+
- name: Pack
31+
run: dotnet pack src/CodeContext.CLI/CodeContext.CLI.csproj --configuration Release --output ./artifacts
32+
33+
- name: Upload artifacts
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: nuget-packages
37+
path: ./artifacts/*.nupkg

.gitignore

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.rsuser
6+
*.suo
7+
*.user
8+
*.userosscache
9+
*.sln.docstates
10+
11+
# User-specific files (MonoDevelop/Xamarin Studio)
12+
*.userprefs
13+
14+
# Mono auto generated files
15+
mono_crash.*
16+
17+
# Build results
18+
[Dd]ebug/
19+
[Dd]ebugPublic/
20+
[Rr]elease/
21+
[Rr]eleases/
22+
x64/
23+
x86/
24+
[Ww][Ii][Nn]32/
25+
[Aa][Rr][Mm]/
26+
[Aa][Rr][Mm]64/
27+
bld/
28+
[Bb]in/
29+
[Oo]bj/
30+
[Ll]og/
31+
[Ll]ogs/
32+
33+
# Visual Studio 2015/2017 cache/options directory
34+
.vs/
35+
36+
# Visual Studio 2017 auto generated files
37+
Generated\ Files/
38+
39+
# MSTest test Results
40+
[Tt]est[Rr]esult*/
41+
[Bb]uild[Ll]og.*
42+
43+
# NUnit
44+
*.VisualState.xml
45+
TestResult.xml
46+
nunit-*.xml
47+
48+
# Build Results of an ATL Project
49+
[Dd]ebugPS/
50+
[Rr]eleasePS/
51+
dlldata.c
52+
53+
# Benchmark Results
54+
BenchmarkDotNet.Artifacts/
55+
56+
# .NET
57+
project.lock.json
58+
project.fragment.lock.json
59+
artifacts/
60+
61+
# Tye
62+
.tye/
63+
64+
# ASP.NET Scaffolding
65+
ScaffoldingReadMe.txt
66+
67+
# StyleCop
68+
StyleCopReport.xml
69+
70+
# Files built by Visual Studio
71+
*_i.c
72+
*_p.c
73+
*_h.h
74+
*.ilk
75+
*.meta
76+
*.obj
77+
*.iobj
78+
*.pch
79+
*.pdb
80+
*.ipdb
81+
*.pgc
82+
*.pgd
83+
*.rsp
84+
*.sbr
85+
*.tlb
86+
*.tli
87+
*.tlh
88+
*.tmp
89+
*.tmp_proj
90+
*_wpftmp.csproj
91+
*.log
92+
*.tlog
93+
*.vspscc
94+
*.vssscc
95+
.builds
96+
*.pidb
97+
*.svclog
98+
*.scc
99+
100+
# Visual Studio profiler
101+
*.psess
102+
*.vsp
103+
*.vspx
104+
*.sap
105+
106+
# Visual Studio Trace Files
107+
*.e2e
108+
109+
# ReSharper is a .NET coding add-in
110+
_ReSharper*/
111+
*.[Rr]e[Ss]harper
112+
*.DotSettings.user
113+
114+
# JetBrains Rider
115+
*.sln.iml
116+
.idea/
117+
118+
# Visual Studio code coverage results
119+
*.coverage
120+
*.coveragexml
121+
122+
# NuGet Packages
123+
*.nupkg
124+
# NuGet Symbol Packages
125+
*.snupkg
126+
# The packages folder can be ignored because of Package Restore
127+
**/[Pp]ackages/*
128+
# except build/, which is used as an MSBuild target.
129+
!**/[Pp]ackages/build/
130+
# Uncomment if necessary however generally it will be regenerated when needed
131+
#!**/[Pp]ackages/repositories.config
132+
# NuGet v3's project.json files produces more ignorable files
133+
*.nuget.props
134+
*.nuget.targets
135+
136+
# Microsoft Azure Build Output
137+
csx/
138+
*.build.csdef
139+
140+
# Windows Store app package directories and files
141+
AppPackages/
142+
BundleArtifacts/
143+
Package.StoreAssociation.xml
144+
_pkginfo.txt
145+
*.appx
146+
*.appxbundle
147+
*.appxupload
148+
149+
# Visual Studio cache files
150+
# files ending in .cache can be ignored
151+
*.[Cc]ache
152+
# but keep track of directories ending in .cache
153+
!?*.[Cc]ache/
154+
155+
# Others
156+
ClientBin/
157+
~$*
158+
*~
159+
*.dbmdl
160+
*.dbproj.schemaview
161+
*.jfm
162+
*.pfx
163+
*.publishsettings
164+
orleans.codegen.cs
165+
166+
# Node.js Tools for Visual Studio
167+
.ntvs_analysis.dat
168+
node_modules/
169+
170+
# Backup & report files from converting an old project file
171+
# to a newer Visual Studio version. Backup files are not needed,
172+
# because we have git ;-)
173+
_UpgradeReport_Files/
174+
Backup*/
175+
UpgradeLog*.XML
176+
UpgradeLog*.htm
177+
ServiceFabricBackup/
178+
*.rptproj.bak
179+
180+
# Local History for Visual Studio Code
181+
.history/
182+
.ionide/
183+
184+
# macOS
185+
.DS_Store
186+
187+
# JetBrains Rider
188+
.idea/
189+
*.sln.iml
190+
191+
# Output files
192+
codebase-context.json
193+
codebase-context.md
194+
codebase-context.txt

CodeContext.sln

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeContext.Core", "src\CodeContext.Core\CodeContext.Core.csproj", "{9EA18276-D341-4C63-B26C-BFB65AF7067F}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeContext.CLI", "src\CodeContext.CLI\CodeContext.CLI.csproj", "{A8433CF5-8F81-445B-BAA2-9D20180B185B}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeContext.Tests", "tests\CodeContext.Tests\CodeContext.Tests.csproj", "{714B69CA-A19F-4456-B1F4-7113783B6FDC}"
13+
EndProject
14+
Global
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|Any CPU = Debug|Any CPU
17+
Debug|x64 = Debug|x64
18+
Debug|x86 = Debug|x86
19+
Release|Any CPU = Release|Any CPU
20+
Release|x64 = Release|x64
21+
Release|x86 = Release|x86
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x64.ActiveCfg = Debug|Any CPU
27+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x64.Build.0 = Debug|Any CPU
28+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x86.ActiveCfg = Debug|Any CPU
29+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Debug|x86.Build.0 = Debug|Any CPU
30+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x64.ActiveCfg = Release|Any CPU
33+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x64.Build.0 = Release|Any CPU
34+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x86.ActiveCfg = Release|Any CPU
35+
{9EA18276-D341-4C63-B26C-BFB65AF7067F}.Release|x86.Build.0 = Release|Any CPU
36+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x64.ActiveCfg = Debug|Any CPU
39+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x64.Build.0 = Debug|Any CPU
40+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x86.ActiveCfg = Debug|Any CPU
41+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Debug|x86.Build.0 = Debug|Any CPU
42+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x64.ActiveCfg = Release|Any CPU
45+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x64.Build.0 = Release|Any CPU
46+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x86.ActiveCfg = Release|Any CPU
47+
{A8433CF5-8F81-445B-BAA2-9D20180B185B}.Release|x86.Build.0 = Release|Any CPU
48+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x64.ActiveCfg = Debug|Any CPU
51+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x64.Build.0 = Debug|Any CPU
52+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x86.ActiveCfg = Debug|Any CPU
53+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Debug|x86.Build.0 = Debug|Any CPU
54+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
55+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x64.ActiveCfg = Release|Any CPU
57+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x64.Build.0 = Release|Any CPU
58+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x86.ActiveCfg = Release|Any CPU
59+
{714B69CA-A19F-4456-B1F4-7113783B6FDC}.Release|x86.Build.0 = Release|Any CPU
60+
EndGlobalSection
61+
GlobalSection(SolutionProperties) = preSolution
62+
HideSolutionNode = FALSE
63+
EndGlobalSection
64+
GlobalSection(NestedProjects) = preSolution
65+
{9EA18276-D341-4C63-B26C-BFB65AF7067F} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
66+
{A8433CF5-8F81-445B-BAA2-9D20180B185B} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
67+
{714B69CA-A19F-4456-B1F4-7113783B6FDC} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
68+
EndGlobalSection
69+
EndGlobal

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Berkant
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)