.editorconfig
+16
-0
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..64664d6
@@ -0,0 +1,16 @@
root = true
# All files
[*]
indent_style = space
insert_final_newline = true
# Config files
[*.{xml,json,slnx,csproj,props}]
indent_size = 2
# C# files
[*.cs]
indent_size = 4
tab_width = 4
max_line_length = 120
.gitignore
+487
-0
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e7495bb
@@ -0,0 +1,487 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from `dotnet new gitignore`
# dotenv files
.env
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
.idea/
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# Vim temporary swap files
*.swp
# dotnet aspire generated docker-compose file
/docker-compose.yaml
Directory.Build.props
+9
-0
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..06ec977
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<TargetFramework>net11.0</TargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
</Project>
Directory.Packages.props
+16
-0
diff --git a/Directory.Packages.props b/Directory.Packages.props
new file mode 100644
index 0000000..2829a75
@@ -0,0 +1,16 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<GlobalPackageReference Include="CSharpier.MsBuild" Version="1.3.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</GlobalPackageReference>
</ItemGroup>
<ItemGroup>
<PackageVersion Include="LibGit2Sharp" Version="0.31.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="11.0.0-preview.5.26302.115" />
</ItemGroup>
</Project>
README.md
+3
-0
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..08ccef3
@@ -0,0 +1,3 @@
# Reviewer
A system for running LLM agent reviews on git commits.
Reviewer.slnx
+6
-0
diff --git a/Reviewer.slnx b/Reviewer.slnx
new file mode 100644
index 0000000..2eb5f77
@@ -0,0 +1,6 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/Reviewer/Reviewer.csproj" />
<Project Path="src/Reviewer.Cli/Reviewer.Cli.csproj" />
</Folder>
</Solution>
dotnet-tools.json
+13
-0
diff --git a/dotnet-tools.json b/dotnet-tools.json
new file mode 100644
index 0000000..6e2e244
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.3.0",
"commands": [
"csharpier"
],
"rollForward": false
}
}
}
\ No newline at end of file
global.json
+7
-0
diff --git a/global.json b/global.json
new file mode 100644
index 0000000..2439bbe
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "11.0.100-preview.5.26302.115",
"allowPrerelease": true,
"rollForward": "disable"
}
}
src/Reviewer.Cli/InputOptions.cs
+33
-0
diff --git a/src/Reviewer.Cli/InputOptions.cs b/src/Reviewer.Cli/InputOptions.cs
new file mode 100644
index 0000000..0cfbbd7
@@ -0,0 +1,33 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
namespace Reviewer.Cli;
internal sealed class InputOptions
{
[Required]
public required string RepositoryPath { get; set; }
[Required]
public required string CommitHash { get; set; }
}
[OptionsValidator]
internal sealed partial class InputOptionsValidator : IValidateOptions<InputOptions>;
internal static class InputOptionsServiceCollectionExtensions
{
extension(IServiceCollection services)
{
public IServiceCollection AddInputOptions()
{
services
.AddOptions<InputOptions>()
.BindConfiguration("")
.Validate<InputOptionsValidator>()
.ValidateOnStart();
return services;
}
}
}
src/Reviewer.Cli/Program.cs
+20
-0
diff --git a/src/Reviewer.Cli/Program.cs b/src/Reviewer.Cli/Program.cs
new file mode 100644
index 0000000..0f39e1e
@@ -0,0 +1,20 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Reviewer;
using Reviewer.Cli;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddInputOptions();
builder.Services.AddReviewService();
using var app = builder.Build();
await app.StartAsync();
var reviewService = app.Services.GetRequiredService<ReviewService>();
var inputOptions = app.Services.GetRequiredService<IOptions<InputOptions>>();
reviewService.Review(new(inputOptions.Value.RepositoryPath, inputOptions.Value.CommitHash));
src/Reviewer.Cli/Reviewer.Cli.csproj
+14
-0
diff --git a/src/Reviewer.Cli/Reviewer.Cli.csproj b/src/Reviewer.Cli/Reviewer.Cli.csproj
new file mode 100644
index 0000000..530ab87
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Reviewer.Cli</RootNamespace>
<AssemblyName>Reviewer.Cli</AssemblyName>
<OutputType>Exe</OutputType>
<EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Reviewer\Reviewer.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" />
</ItemGroup>
</Project>
src/Reviewer.Cli/packages.lock.json
+207
-0
diff --git a/src/Reviewer.Cli/packages.lock.json b/src/Reviewer.Cli/packages.lock.json
new file mode 100644
index 0000000..9c9aa77
@@ -0,0 +1,207 @@
{
"version": 2,
"dependencies": {
"net11.0": {
"CSharpier.MsBuild": {
"type": "Direct",
"requested": "[1.3.0, )",
"resolved": "1.3.0",
"contentHash": "jzzLpmz7F6LyBh5FTZy8/4dEYVcAG9VjBPKryZ82LIoUuupcBkCSXzaeS/4oYcp/rBC8yVLcDstJ8CIv9n2IFw=="
},
"Microsoft.Extensions.Hosting": {
"type": "Direct",
"requested": "[11.0.0-preview.5.26302.115, )",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "QW+SY1+83Em1y6P89GuUnjZx8tpGCOoumMrWy6l32YQJU0yoiGbPzd9cK0JDNyOzEmOjC4PNeN9bsdThMOWWWw==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.Binder": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.CommandLine": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.FileExtensions": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.Json": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.UserSecrets": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.DependencyInjection": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Diagnostics": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.FileProviders.Physical": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging.Configuration": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging.Console": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging.Debug": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging.EventLog": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging.EventSource": "11.0.0-preview.5.26302.115"
}
},
"LibGit2Sharp.NativeBinaries": {
"type": "Transitive",
"resolved": "2.0.323",
"contentHash": "Kg+fJGWhGj5qRXG0Ilj4ddhuodGXZg57yhfX6OVUDR0M2DKg/UR42/d74+qv5l1qotc1qJilo/ho7xQnULP6yA=="
},
"Microsoft.Extensions.Configuration": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "rRRcEKScN/CuYr15WRzDqONxpQ52EXSSCMWYjG3dXaheKcZkwb172WtPvjH3rQ5mjJfNCFoy38CNAERvcKfgig=="
},
"Microsoft.Extensions.Configuration.Binder": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "QHS547c+SiP/0RYZeAxvBak9JuF9LWJTp2T4Ansix1hIcxa+hoS1hOifHrxoid1uerM7Dy9v2jziFTLJEyszeg==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Configuration.CommandLine": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "rhP0mQHbP068pLYEd4UPh7RJqSXvxdSNs8jnDt2HQhRQOuZEwb3YJoA18BkcepZkqhfbcY03LVD4SrxLG3Z3xA==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "+dR14QW+gkbmxn8R0SPdc2dqpv/rKojyiIL9ac6tI9b9/53NkVvyKaapL4XnE5/iAngHvrFEKkTchDns6XPX3g==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Configuration.FileExtensions": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "asjwf33rcFzsJmDS1ZB4JnV1Usjhe7n32ZCDi5sq/e0tMWBDtjM7q4mDc6HKu7mmZFT5RBfNGYwB9p2I0+eydA==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.FileProviders.Physical": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Configuration.Json": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "qvFuqidTSVZq0J4Lf4u9ghTyu/bj9ehBmlltFKjcfNtU62m1zZjq6QyBktxqovcncwyFowEH3c0TdNyMjM4kUA==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.FileExtensions": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Configuration.UserSecrets": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "PILYK8gAWT7TjbP29z6/aMThsUUFGp0rTozTT8c7affE5BwfilNkn1D7ZfM82ZpAxjkieCq8/M2s0VYGBZagOQ==",
"dependencies": {
"Microsoft.Extensions.Configuration.Json": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.FileProviders.Physical": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.DependencyInjection": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "uAiCrVf8nZC1JDMq4e0kdgXfTmS1frxpnWVP1EacjRTXVZgyzTjirDwRKZOoG/ewsP0MJ0HnGR2ARYQ5X0MgBA=="
},
"Microsoft.Extensions.Diagnostics": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "J1fOtumS/mp3XGUQyPUwBl6o7Y3DFd1gSQj8BzMmjBlH74Kr59Sqv80t/a3Zma2GmHliRrS87zIoue5a5dHzzA==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Options.ConfigurationExtensions": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.FileProviders.Physical": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "cs1o2oQ4XC+4fD2VdMzYW/ZZq95bN5Dy2UrRVw8aVZfZ93A/Fy6NN/tEMUVx+PxxvGJ3U4foOWC0MocY7V/aBg==",
"dependencies": {
"Microsoft.Extensions.FileSystemGlobbing": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.FileSystemGlobbing": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "r06T2D3sxcAb66nhN8m+0WCsRWq+1F9FRjQ6Jpupey9Z9y/MtSgFNCcjNhhaMgwJphmplPj8o90GHsczJ5JsCQ=="
},
"Microsoft.Extensions.Logging": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "kTJYGCZswdp7SWTnoEA51X//Z983ql2L+KW12GllaVxqWd8Y/8TVqheCBN3sjXt2aHSiQdxm7kpicGvPqqy04w==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Logging.Configuration": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "LG0SstIMdR959/6wzHGxG5CU7jn3osyrRdZvGonFVg3CNcLj1H1AyskHvQSNJvmwgPi96zXQy08oeDcNVBslXQ==",
"dependencies": {
"Microsoft.Extensions.Configuration": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Configuration.Binder": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Options.ConfigurationExtensions": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Logging.Console": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "MEQPj2Xx+XLc1iSFNjPGb8ig30HRgNRx7EO3/JBm2QQO8bTDOieWLuPi50Val7nKsqPLa9LR66HPFazi2GlLJw==",
"dependencies": {
"Microsoft.Extensions.Logging": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging.Configuration": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Logging.Debug": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "iXX4RNTQ89dIQY4rDxYLwAaNMmKQod3Sus8WQqsN+wiCA3I18uzDGdVQLwS0z29v6RM69js3SeBkUNjkTgFfwA==",
"dependencies": {
"Microsoft.Extensions.Logging": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Logging.EventLog": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "YJbaXAA6i4XV4tMqg5cQRyl0y56heV2f5r7rwMQ0k9Xv/SBHTdtfY7K+n6QVFXE+qP9vBzxDt5oYWbR2QonvmQ==",
"dependencies": {
"Microsoft.Extensions.Logging": "11.0.0-preview.5.26302.115",
"Microsoft.Extensions.Logging.Configuration": "11.0.0-preview.5.26302.115",
"System.Diagnostics.EventLog": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Logging.EventSource": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "WbRPUQ2CRcEjrMQ3KIH559vWSEZ4Zd4/cFtc5ButAPCvW4UO1yf4PfmJTaZbZ/5Md7f/VXpC3nDhuAi/4biIcw==",
"dependencies": {
"Microsoft.Extensions.Logging": "11.0.0-preview.5.26302.115"
}
},
"Microsoft.Extensions.Options.ConfigurationExtensions": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "cbCXUxc5waGVaNXeSSj3KVtrf7hRV0qhYuzUu5aSH5dsdtkEfbHuNpcn+zNr5SRt8INsiQTtSWkf3ds/qKTAdw==",
"dependencies": {
"Microsoft.Extensions.Configuration.Binder": "11.0.0-preview.5.26302.115"
}
},
"System.Diagnostics.EventLog": {
"type": "Transitive",
"resolved": "11.0.0-preview.5.26302.115",
"contentHash": "rbMn13FzntTkgxfdyDtfXwiwV1U6Biyts64lg93MvNjCM+JsmzC+e2l+KD8Mldcey6vXocjcBuopL9rT1X2MRg=="
},
"reviewer": {
"type": "Project",
"dependencies": {
"LibGit2Sharp": "[0.31.0, )"
}
},
"LibGit2Sharp": {
"type": "CentralTransitive",
"requested": "[0.31.0, )",
"resolved": "0.31.0",
"contentHash": "b3+UfV7LjKMjAHWwl7VawejiOv2gJIC6dTCA/S0puLTHACAA/Oeb5JJmWUQMeyH/T/WR/LaIK8bk2RbdFnrZvg==",
"dependencies": {
"LibGit2Sharp.NativeBinaries": "[2.0.323]"
}
}
}
}
}
\ No newline at end of file
src/Reviewer/Input.cs
+3
-0
diff --git a/src/Reviewer/Input.cs b/src/Reviewer/Input.cs
new file mode 100644
index 0000000..05e20f2
@@ -0,0 +1,3 @@
namespace Reviewer;
public sealed record Input(string RepositoryPath, string CommitHash);
src/Reviewer/LoggerExtensions.cs
+12
-0
diff --git a/src/Reviewer/LoggerExtensions.cs b/src/Reviewer/LoggerExtensions.cs
new file mode 100644
index 0000000..14ea691
@@ -0,0 +1,12 @@
using Microsoft.Extensions.Logging;
namespace Reviewer;
internal static partial class LoggerExtensions
{
[LoggerMessage(LogLevel.Warning, "No repository found at {Path}")]
public static partial void LogNoRepositoryFound(this ILogger logger, string path);
[LoggerMessage(LogLevel.Warning, "No commit found for {Hash}")]
public static partial void LogNoCommitFound(this ILogger logger, string hash);
}
src/Reviewer/ReviewService.cs
+50
-0
diff --git a/src/Reviewer/ReviewService.cs b/src/Reviewer/ReviewService.cs
new file mode 100644
index 0000000..d30c39d
@@ -0,0 +1,50 @@
using LibGit2Sharp;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Reviewer;
public sealed class ReviewService(ILogger<ReviewService> logger)
{
public void Review(Input input)
{
using var repository = OpenRepository(input.RepositoryPath);
if (repository is null)
{
logger.LogNoRepositoryFound(input.RepositoryPath);
return;
}
var commit = repository.Lookup<Commit>(input.CommitHash);
if (commit is null)
{
logger.LogNoCommitFound(input.CommitHash);
return;
}
logger.LogInformation(
"Reviewing commit \"{Message}\" ({Hash}) by {Author}",
commit.MessageShort,
commit.Id,
commit.Author.Name
);
}
private static Repository? OpenRepository(string path)
{
try
{
return new Repository(path);
}
catch (RepositoryNotFoundException)
{
return null;
}
}
}
public static class ReviewServiceServiceCollectionExtensions
{
extension(IServiceCollection services)
{
public IServiceCollection AddReviewService() => services.AddTransient<ReviewService>();
}
}
src/Reviewer/Reviewer.csproj
+9
-0
diff --git a/src/Reviewer/Reviewer.csproj b/src/Reviewer/Reviewer.csproj
new file mode 100644
index 0000000..f726b8e
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Reviewer</RootNamespace>
<AssemblyName>Reviewer</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LibGit2Sharp" />
</ItemGroup>
</Project>
src/Reviewer/packages.lock.json
+27
-0
diff --git a/src/Reviewer/packages.lock.json b/src/Reviewer/packages.lock.json
new file mode 100644
index 0000000..f2652f2
@@ -0,0 +1,27 @@
{
"version": 2,
"dependencies": {
"net11.0": {
"CSharpier.MsBuild": {
"type": "Direct",
"requested": "[1.3.0, )",
"resolved": "1.3.0",
"contentHash": "jzzLpmz7F6LyBh5FTZy8/4dEYVcAG9VjBPKryZ82LIoUuupcBkCSXzaeS/4oYcp/rBC8yVLcDstJ8CIv9n2IFw=="
},
"LibGit2Sharp": {
"type": "Direct",
"requested": "[0.31.0, )",
"resolved": "0.31.0",
"contentHash": "b3+UfV7LjKMjAHWwl7VawejiOv2gJIC6dTCA/S0puLTHACAA/Oeb5JJmWUQMeyH/T/WR/LaIK8bk2RbdFnrZvg==",
"dependencies": {
"LibGit2Sharp.NativeBinaries": "[2.0.323]"
}
},
"LibGit2Sharp.NativeBinaries": {
"type": "Transitive",
"resolved": "2.0.323",
"contentHash": "Kg+fJGWhGj5qRXG0Ilj4ddhuodGXZg57yhfX6OVUDR0M2DKg/UR42/d74+qv5l1qotc1qJilo/ho7xQnULP6yA=="
}
}
}
}
\ No newline at end of file