Skip to content

Commit 3c7c65f

Browse files
committed
Restructure repo for open source release
- Move source to src/git-wt/, add tests/git-wt.Tests/ with xUnit - Add slnx, Directory.Build.props, global.json, .gitattributes - Add CI and release GitHub Actions workflows - Add NuGet package metadata, README badges, tag-based versioning - Add contributing guide, issue/PR templates, editorconfig - Add install-local.sh alongside install-local.ps1
1 parent a8a7d2b commit 3c7c65f

24 files changed

Lines changed: 473 additions & 26 deletions

.editorconfig

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{csproj,props,targets,xml,slnx}]
12+
indent_size = 2
13+
14+
[*.{json,yml,yaml}]
15+
indent_size = 2
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
# C# style rules
21+
[*.cs]
22+
# Namespace and using preferences
23+
csharp_style_namespace_declarations = file_scoped:suggestion
24+
csharp_using_directive_placement = outside_namespace:suggestion
25+
dotnet_sort_system_directives_first = true
26+
27+
# var preferences
28+
csharp_style_var_when_type_is_apparent = true:suggestion
29+
csharp_style_var_for_built_in_types = false:suggestion
30+
csharp_style_var_elsewhere = false:suggestion
31+
32+
# Expression-level preferences
33+
csharp_style_prefer_switch_expression = true:suggestion
34+
csharp_style_prefer_pattern_matching = true:suggestion
35+
csharp_style_prefer_not_pattern = true:suggestion
36+
csharp_prefer_simple_using_statement = true:suggestion
37+
csharp_style_prefer_null_check_over_type_check = true:suggestion
38+
39+
# Modifier preferences
40+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
41+
42+
# New line preferences
43+
csharp_new_line_before_open_brace = all
44+
csharp_new_line_before_else = true
45+
csharp_new_line_before_catch = true
46+
csharp_new_line_before_finally = true
47+
48+
# Indentation preferences
49+
csharp_indent_case_contents = true
50+
csharp_indent_switch_labels = true
51+
52+
# Naming conventions
53+
dotnet_naming_rule.public_members_pascal_case.symbols = public_symbols
54+
dotnet_naming_rule.public_members_pascal_case.style = pascal_case_style
55+
dotnet_naming_rule.public_members_pascal_case.severity = suggestion
56+
57+
dotnet_naming_symbols.public_symbols.applicable_kinds = class,struct,interface,enum,property,method,event,delegate
58+
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public,internal
59+
60+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
61+
62+
dotnet_naming_rule.private_fields_camel_case.symbols = private_fields
63+
dotnet_naming_rule.private_fields_camel_case.style = camel_case_underscore_style
64+
dotnet_naming_rule.private_fields_camel_case.severity = suggestion
65+
66+
dotnet_naming_symbols.private_fields.applicable_kinds = field
67+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
68+
69+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
70+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
* text=auto eol=lf
2+
*.cs text eol=lf
3+
*.csproj text eol=lf
4+
*.slnx text eol=lf
5+
*.props text eol=lf
6+
*.targets text eol=lf
7+
*.xml text eol=lf
8+
*.json text eol=lf
9+
*.yml text eol=lf
10+
*.yaml text eol=lf
11+
*.md text eol=lf
12+
*.ps1 text eol=lf
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Bug report
3+
about: Report something that isn't working
4+
labels: bug
5+
---
6+
7+
**What happened?**
8+
9+
10+
**What did you expect?**
11+
12+
13+
**Steps to reproduce**
14+
15+
1.
16+
2.
17+
3.
18+
19+
**Environment**
20+
- OS:
21+
- .NET version:
22+
- git-wt version:
23+
- Git version:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea or improvement
4+
labels: enhancement
5+
---
6+
7+
**What problem does this solve?**
8+
9+
10+
**What does the solution look like?**
11+
12+
13+
**Alternatives considered**
14+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## What
2+
3+
<!-- Brief description of the change -->
4+
5+
## Why
6+
7+
<!-- What problem does this solve? Link to an issue if applicable -->
8+
9+
## Testing
10+
11+
<!-- How did you verify this works? -->

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-dotnet@v4
15+
with:
16+
dotnet-version: '10.0.x'
17+
- run: dotnet restore
18+
- run: dotnet build --no-restore
19+
- run: dotnet format --verify-no-changes --no-restore
20+
- run: dotnet test --no-build

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
environment: nuget
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: '10.0.x'
18+
- name: Set version from tag
19+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
20+
- run: dotnet restore
21+
- run: dotnet build --no-restore -c Release -p:Version=${{ env.VERSION }}
22+
- run: dotnet test --no-build -c Release
23+
- run: dotnet pack --no-build -c Release -p:Version=${{ env.VERSION }} -o ./artifacts
24+
- name: Push to NuGet
25+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
26+
- name: Create GitHub Release
27+
uses: softprops/action-gh-release@v2
28+
with:
29+
files: artifacts/*.nupkg
30+
generate_release_notes: true

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1+
## Build output
12
bin/
23
obj/
34
nupkg/
5+
artifacts/
6+
7+
## IDE and editor
8+
.vs/
9+
.vscode/
10+
.idea/
11+
*.suo
12+
*.user
13+
*.userosscache
14+
*.sln.docstates
15+
16+
## Test results
17+
TestResults/
18+
19+
## OS files
20+
Thumbs.db
21+
.DS_Store
22+
23+
## Project specific
424
.claude/

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing
2+
3+
Thanks for your interest in contributing to git-wt!
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Clone your fork and create a branch for your change
9+
3. Make your changes
10+
4. Open a pull request against `main`
11+
12+
## Building
13+
14+
Requires [.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) or later.
15+
16+
```
17+
dotnet build
18+
dotnet test
19+
```
20+
21+
To install locally as a global tool:
22+
23+
```bash
24+
# Linux / macOS
25+
./install-local.sh
26+
27+
# Windows (PowerShell)
28+
./install-local.ps1
29+
```
30+
31+
## Guidelines
32+
33+
- Keep changes focused, one feature or fix per PR
34+
- Follow the existing code style
35+
- Test your changes against a real bare worktree setup before submitting
36+
37+
## Reporting Issues
38+
39+
Open an issue on GitHub with steps to reproduce the problem and the output you see.

Directory.Build.props

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project>
2+
<PropertyGroup>
3+
<TargetFramework>net10.0</TargetFramework>
4+
<LangVersion>latest</LangVersion>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
9+
<AnalysisLevel>latest</AnalysisLevel>
10+
</PropertyGroup>
11+
<PropertyGroup Condition="'$(CI)' == 'true'">
12+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
13+
</PropertyGroup>
14+
</Project>

0 commit comments

Comments
 (0)