Skip to content

Commit 15e85de

Browse files
committed
feat: initial commit for Git Ranger VS extension
- Core VSIX project with VS 2022/2026 SDK support - Inline blame annotations with author coloring - Blame gutter margin with age/author visualization - LibGit2Sharp integration for Git operations - Theme-adaptive color system - Options page for user preferences - GitHub Actions CI/CD workflows - Conventional commit linting configuration
0 parents  commit 15e85de

35 files changed

+3752
-0
lines changed

.commitlintrc.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Commitlint configuration for conventional commits
2+
# Based on: https://www.conventionalcommits.org/
3+
4+
extends:
5+
- '@commitlint/config-conventional'
6+
7+
rules:
8+
# Type enum - allowed commit types
9+
type-enum:
10+
- 2 # Level: error
11+
- always
12+
- # Allowed types:
13+
- feat # New feature
14+
- fix # Bug fix
15+
- docs # Documentation only changes
16+
- style # Code style changes (formatting, missing semi-colons, etc)
17+
- refactor # Code refactoring (neither fixes a bug nor adds a feature)
18+
- perf # Performance improvements
19+
- test # Adding or updating tests
20+
- build # Changes to build system or dependencies
21+
- ci # CI/CD configuration changes
22+
- chore # Other changes that don't modify src or test files
23+
- revert # Revert a previous commit
24+
25+
# Type case should be lowercase
26+
type-case:
27+
- 2
28+
- always
29+
- lower-case
30+
31+
# Type must not be empty
32+
type-empty:
33+
- 2
34+
- never
35+
36+
# Scope case should be lowercase
37+
scope-case:
38+
- 2
39+
- always
40+
- lower-case
41+
42+
# Subject must not be empty
43+
subject-empty:
44+
- 2
45+
- never
46+
47+
# Subject must not end with a period
48+
subject-full-stop:
49+
- 2
50+
- never
51+
- '.'
52+
53+
# Disable subject-case to allow uppercase abbreviations (PR, API, CLI, etc.)
54+
subject-case:
55+
- 0
56+
57+
# Header (first line) max length
58+
header-max-length:
59+
- 2
60+
- always
61+
- 72
62+
63+
# Body should have a blank line before it
64+
body-leading-blank:
65+
- 1 # Warning level
66+
- always
67+
68+
# Footer should have a blank line before it
69+
footer-leading-blank:
70+
- 1 # Warning level
71+
- always
72+
73+
# Body max line length
74+
body-max-line-length:
75+
- 1 # Warning level
76+
- always
77+
- 100
78+
79+
# Help URL shown in error messages
80+
helpUrl: 'https://www.conventionalcommits.org/'

.github/workflows/commit-lint.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Lint Commit Messages
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
11+
jobs:
12+
lint-pr-title:
13+
name: Lint PR Title
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
24+
- name: Install commitlint
25+
run: |
26+
npm install --save-dev @commitlint/[email protected] @commitlint/[email protected]
27+
28+
- name: Validate PR title
29+
env:
30+
PR_TITLE: ${{ github.event.pull_request.title }}
31+
run: |
32+
echo "Validating PR title: $PR_TITLE"
33+
echo "$PR_TITLE" | npx commitlint --verbose
34+
35+
commitlint:
36+
name: Lint Commit Messages
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0 # Fetch all history for all branches and tags
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: '20'
48+
49+
- name: Install commitlint
50+
run: |
51+
npm install --save-dev @commitlint/[email protected] @commitlint/[email protected]
52+
53+
- name: Validate PR commits
54+
run: |
55+
# Get the base branch (usually main)
56+
BASE_SHA=$(git merge-base origin/${{ github.base_ref }} HEAD)
57+
58+
# Lint all commits in the PR
59+
npx commitlint --from $BASE_SHA --to HEAD --verbose
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Preview Changelog
2+
3+
run-name: Preview release notes for next release
4+
5+
on:
6+
workflow_dispatch:
7+
8+
jobs:
9+
generate:
10+
name: Generate
11+
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
12+
secrets: inherit
13+
14+
preview:
15+
name: Display Preview
16+
runs-on: ubuntu-latest
17+
needs: generate
18+
19+
steps:
20+
- name: Display changelog preview
21+
run: |
22+
echo "=========================================="
23+
echo "CHANGELOG PREVIEW"
24+
echo "=========================================="
25+
echo ""
26+
echo "${{ needs.generate.outputs.changelog }}"
27+
shell: bash

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Publish to VS Marketplace
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
actions: read
9+
10+
jobs:
11+
changelog:
12+
name: Generate Changelog
13+
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
14+
secrets: inherit
15+
16+
publish:
17+
needs: changelog
18+
runs-on: windows-latest
19+
outputs:
20+
version: ${{ steps.artifact_manifest.outputs.version }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: 1. Download artifact
26+
id: download-artifact
27+
uses: dawidd6/action-download-artifact@v6
28+
with:
29+
workflow: release_build_and_deploy.yml
30+
workflow_conclusion: success
31+
32+
- name: 2. Parse Artifact Manifest
33+
id: artifact_manifest
34+
uses: ActionsTools/read-json-action@main
35+
with:
36+
file_path: ./artifact/CodingWithCalvin.GitRanger.info
37+
38+
- name: 3. Create Tag & Release
39+
uses: ncipollo/[email protected]
40+
with:
41+
artifacts: ./artifact/CodingWithCalvin.GitRanger.vsix
42+
body: ${{ needs.changelog.outputs.changelog }}
43+
makeLatest: true
44+
commit: ${{ steps.artifact_manifest.outputs.sha }}
45+
tag: ${{ steps.artifact_manifest.outputs.version }}
46+
47+
- name: 4. Publish Release to Marketplace
48+
if: success()
49+
uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v1
50+
with:
51+
marketplace-pat: ${{ secrets.VS_PAT }}
52+
publish-manifest-path: ./resources/extension.manifest.json
53+
vsix-path: ./artifact/CodingWithCalvin.GitRanger.vsix
54+
55+
notify:
56+
needs: publish
57+
uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main
58+
with:
59+
post_text: |
60+
🚀 Git Ranger v${{ needs.publish.outputs.version }} for #VisualStudio has been released!
61+
62+
[Check out the release notes here!](https://github.com/${{ github.repository }}/releases/tag/${{ needs.publish.outputs.version }})
63+
64+
Marketplace: https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VS-GitRanger
65+
secrets:
66+
BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }}
67+
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Build and Deploy'
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened]
7+
push:
8+
branches:
9+
- main
10+
tags-ignore:
11+
- '[0-9]+.[0-9]+.[0-9]+.[0-9]+'
12+
13+
jobs:
14+
Release-Build-and-Deploy:
15+
runs-on: windows-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: microsoft/setup-msbuild@v2
20+
- uses: nuget/setup-nuget@v2
21+
22+
- name: 1. Versioning Release
23+
id: step-version
24+
uses: CodingWithCalvin/GHA-VSVsixVersioner@v1
25+
with:
26+
extension-manifest-file: 'src/CodingWithCalvin.GitRanger/source.extension.vsixmanifest'
27+
extension-source-file: 'src/CodingWithCalvin.GitRanger/source.extension.cs'
28+
29+
- name: 2. Restoring Packages
30+
run: nuget restore CodingWithCalvin.GitRanger.sln
31+
32+
- name: 3. Building Project
33+
run: msbuild 'src/CodingWithCalvin.GitRanger/CodingWithCalvin.GitRanger.csproj' /p:configuration='Release' /p:DeployExtension=False
34+
35+
- name: 4. Create Information File
36+
uses: jsdaniell/[email protected]
37+
with:
38+
name: 'src/CodingWithCalvin.GitRanger/bin/Release/CodingWithCalvin.GitRanger.info'
39+
json: '{"sha":"${{ github.sha }}", "version":"${{ steps.step-version.outputs.version }}"}'
40+
41+
- name: 5. Publishing Build Artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
path: |
45+
src/CodingWithCalvin.GitRanger/bin/Release/CodingWithCalvin.GitRanger.info
46+
src/CodingWithCalvin.GitRanger/bin/Release/CodingWithCalvin.GitRanger.vsix

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Build results
2+
[Dd]ebug/
3+
[Rr]elease/
4+
x64/
5+
x86/
6+
[Aa][Rr][Mm]/
7+
[Aa][Rr][Mm]64/
8+
bld/
9+
[Bb]in/
10+
[Oo]bj/
11+
[Ll]og/
12+
[Ll]ogs/
13+
14+
# Visual Studio files
15+
.vs/
16+
*.suo
17+
*.user
18+
*.userosscache
19+
*.sln.docstates
20+
*.rsuser
21+
22+
# VSIX
23+
*.vsix
24+
25+
# NuGet
26+
packages/
27+
*.nupkg
28+
**/[Pp]ackages/*
29+
!**/[Pp]ackages/build/
30+
31+
# Test results
32+
[Tt]est[Rr]esult*/
33+
[Bb]uild[Ll]og.*
34+
TestResult.xml
35+
36+
# NCrunch
37+
_NCrunch_*
38+
.*crunch*.local.xml
39+
nCrunchTemp_*
40+
41+
# Rider
42+
.idea/
43+
44+
# ReSharper
45+
_ReSharper*/
46+
*.[Rr]e[Ss]harper
47+
*.DotSettings.user
48+
49+
# JetBrains
50+
*.sln.iml
51+
52+
# Windows
53+
Thumbs.db
54+
ehthumbs.db
55+
Desktop.ini
56+
57+
# macOS
58+
.DS_Store
59+
.AppleDouble
60+
.LSOverride
61+
62+
# Backup files
63+
*~
64+
*.bak
65+
*.swp
66+
67+
# Publish output
68+
publish/
69+
70+
# Claude local settings
71+
CLAUDE.local.md
72+
.claude/
73+
74+
# Node modules (for commitlint)
75+
node_modules/

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

0 commit comments

Comments
 (0)