Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9dc69a0
feat(ghtidyup): several improvements in the tidy up functionality and…
marc-romu May 3, 2025
0b229fa
docs: update version badge for dev
actions-user May 3, 2025
d03d28e
docs: update version badge for dev to 0.3.1-dev.250503 (#194)
marc-romu May 3, 2025
bbe9659
chore(workflows): release workflows update
marc-romu May 6, 2025
7cfc019
chore(workflows): release workflows update
marc-romu May 6, 2025
04eddab
Merge branch 'main' of https://github.com/architects-toolkit/SmartHopper
marc-romu May 6, 2025
e87e3b6
chore(workflows): update code-style fixers
marc-romu May 6, 2025
5b97d90
chore(workflows): minor fixes in header-style
marc-romu May 6, 2025
6eea98a
Update dev from main (#195)
marc-romu May 6, 2025
f2e9e01
chore(workflows): added permissions to release-1-milestone
marc-romu May 6, 2025
51a7d40
chore(workflows): minor fixes
marc-romu May 6, 2025
fc3bd35
chore(workflows): do not fix file headers by default
marc-romu May 6, 2025
08b3e60
chore(workflows): added soft-check mode
marc-romu May 6, 2025
1dea815
chore(workflows): removed fix code on release
marc-romu May 6, 2025
6e0b147
chore: minor fixes
marc-romu May 6, 2025
eed086b
chore(workflow): move pr to init
marc-romu May 6, 2025
fe1d141
chore
marc-romu May 6, 2025
19f83ef
chore
marc-romu May 6, 2025
0ec4b1e
chore
marc-romu May 6, 2025
16fb20f
chore
marc-romu May 6, 2025
486a307
chore(workflow): update pr creation
marc-romu May 6, 2025
9141dd5
chore: minor fixes
marc-romu May 6, 2025
b448a44
chore: fix milestone number
marc-romu May 6, 2025
5b161bb
chore: delete existing release branch if exists
marc-romu May 6, 2025
a8853fa
chore: remove remote branch if exists
marc-romu May 6, 2025
980b3df
chore: correct milestone id
marc-romu May 6, 2025
d3345db
chore: remove milestone
marc-romu May 6, 2025
bce2c6a
chore: prepare release 0.3.1-alpha with version update and code style…
actions-user May 6, 2025
74f7e2e
chore: prepare release 0.3.1-alpha with version update and code style…
marc-romu May 6, 2025
263f4c7
chore(workflow): create direct pr from dev to main with no commit
marc-romu May 7, 2025
d964303
chore(workflow): add manual trigger
marc-romu May 7, 2025
39451cb
chore: spelling mistake
marc-romu May 7, 2025
784a523
chore(workflow): setup manual inputs on manual trigger
marc-romu May 7, 2025
5cf8ce1
chore(workflow): incorrect permissions
marc-romu May 7, 2025
bd0f377
chore: prepare release 0.3.1-alpha with version update and code style…
marc-romu May 7, 2025
8fa38f9
chore: minor fixes
marc-romu May 7, 2025
ba6b675
UPDATE DEV FROM MAIN (#199)
marc-romu May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions .github/actions/code-style/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@ inputs:
description: "Operation mode: fix or check"
required: false
default: "check"
token:
description: "GitHub token for authentication"
required: true
commit:
description: "Commit?"
required: false
default: false
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for existing .NET SDK
id: check-dotnet
shell: bash
run: |
if dotnet --version >/dev/null 2>&1; then
echo "installed=true" >> $GITHUB_OUTPUT
else
echo "installed=false" >> $GITHUB_OUTPUT
fi
- name: Setup .NET
uses: actions/setup-dotnet@v3
if: ${{ steps.check-dotnet.outputs.installed == 'false' }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Run dotnet-format
Expand All @@ -33,7 +40,7 @@ runs:
- name: Process C# file headers
uses: ./.github/actions/code-style/header-fixer
with:
mode: ${{ inputs.mode }}
mode: soft-check
- name: Process trailing whitespace
uses: ./.github/actions/code-style/trailing-whitespace
with:
Expand All @@ -42,8 +49,12 @@ runs:
uses: ./.github/actions/code-style/using-sorter
with:
mode: ${{ inputs.mode }}
- name: Check namespaces
uses: ./.github/actions/code-style/namespace-fixer
with:
mode: soft-check
- name: Commit & push changes
if: ${{ inputs.mode == 'fix' }}
if: ${{ inputs.commit }}
shell: bash
run: |
git config user.name "github-actions"
Expand Down
47 changes: 25 additions & 22 deletions .github/actions/code-style/header-fixer/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,31 @@ name: "Header Fixer"
description: "Check or fix C# file headers to match .editorconfig header template"
inputs:
mode:
description: "Operation mode: fix or check"
description: "Operation mode: fix, check, or soft-check"
required: false
default: "check"
default: "soft-check"
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Process C# file headers
if: always()
shell: bash
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
run: |
if [ -n "${{ github.event.pull_request }}" ]; then
FILES=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" -- '*.cs')
# Determine files to process: changed in PR or all .cs in src/
if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
BASE_SHA=$(jq -r .pull_request.base.sha < "$GITHUB_EVENT_PATH")
HEAD_SHA=$(jq -r .pull_request.head.sha < "$GITHUB_EVENT_PATH")
FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" -- '*.cs' || true)
else
# Fallback to all .cs files when not a pull_request event
FILES=$(find . -type f -name '*.cs')
# Fallback to all .cs files under src/
FILES=$(find src -type f -name '*.cs')
fi
# If no files, skip
if [ -z "$FILES" ]; then
echo "No C# files to process"
exit 0
fi
ERR=0
for file in $FILES; do
Expand All @@ -35,7 +41,7 @@ runs:
HEADER_LINES=$(echo -e "$HEADER" | wc -l)
CURRENT_HEADER=$(head -n $HEADER_LINES "$file")

if [ "$(echo -e "$HEADER")" != "$CURRENT_HEADER" ]; then
if [ "$HEADER" != "$CURRENT_HEADER" ]; then
if [ "${{ inputs.mode }}" = "fix" ]; then
echo "Updating header in $file"
# Find namespace line
Expand All @@ -49,18 +55,15 @@ runs:
echo "Warning: Could not find namespace line in $file"
fi
else
echo "Header mismatch in $file"
ERR=1
if [ "${{ inputs.mode }}" = "soft-check" ]; then
# emit a non-blocking warning
echo "::warning file=$file::Header mismatch in $file (run with mode=fix to auto-fix)"
else
echo "Header mismatch in $file"
ERR=1
fi
fi
fi
fi
done
exit $ERR
- name: Commit & push changes
if: ${{ inputs.mode == 'fix' }}
shell: bash
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add .
git diff --quiet || (git commit -m "chore: automatically fixed file headers" && git push)
23 changes: 8 additions & 15 deletions .github/actions/code-style/namespace-fixer/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ name: "Namespace Fixer"
description: "Check or fix C# file namespaces to match file path"
inputs:
mode:
description: "Operation mode: fix or check"
description: "Operation mode: fix, check, or soft-check"
required: false
default: "check"
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Process C# namespaces
if: always()
shell: bash
Expand All @@ -38,18 +34,15 @@ runs:
sed -i "s/^namespace .*/namespace $ns/" "$file"
echo "WARNING: References to this file may need manual updates."
else
echo "Namespace mismatch in $file: expected $ns but found $actual"
ERR=1
if [ "${{ inputs.mode }}" = "soft-check" ]; then
# emit a non-blocking warning
echo "::warning file=$file::Namespace mismatch in $file (run with mode=fix to auto-fix)"
else
echo "Namespace mismatch in $file: expected $ns but found $actual"
ERR=1
fi
fi
fi
fi
done
exit $ERR
- name: Commit & push changes
if: ${{ inputs.mode == 'fix' }}
shell: bash
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add .
git diff --quiet || (git commit -m "chore: automatically fix namespaces" && git push)
23 changes: 8 additions & 15 deletions .github/actions/code-style/trailing-whitespace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ name: "Trailing Whitespace"
description: "Check or fix trailing whitespace and normalize line endings"
inputs:
mode:
description: "Operation mode: fix or check"
description: "Operation mode: fix, check, or soft-check"
required: false
default: "check"
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Process trailing whitespace
shell: bash
run: |
Expand All @@ -25,18 +21,15 @@ runs:
sed -i 's/\r$//' "$file"
else
if grep -qE '[ \t]+$' "$file" || file "$file" | grep -q CRLF; then
echo "Trailing whitespace or CRLF found in $file"
ERR=1
if [ "${{ inputs.mode }}" = "soft-check" ]; then
# emit a non-blocking warning
echo "::warning file=$file::Trailing whitespace or CRLF found in $file (run with mode=fix to auto-fix)"
else
echo "Trailing whitespace or CRLF found in $file"
ERR=1
fi
fi
fi
fi
done
exit $ERR
- name: Commit & push changes
if: ${{ inputs.mode == 'fix' }}
shell: bash
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add .
git diff --quiet || (git commit -m "chore: automatically fixed trailing whitespace" && git push)
28 changes: 13 additions & 15 deletions .github/actions/code-style/using-sorter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ name: "Using Sorter"
description: "Check or fix C# using directives ordering and remove unused usings"
inputs:
mode:
description: "Operation mode: fix or check"
description: "Operation mode: fix, check, or soft-check"
required: false
default: "check"
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for existing .NET SDK
id: check-dotnet
shell: bash
run: |
if dotnet --version >/dev/null 2>&1; then
echo "installed=true" >> $GITHUB_OUTPUT
else
echo "installed=false" >> $GITHUB_OUTPUT
fi
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
if: ${{ steps.check-dotnet.outputs.installed == 'false' }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Run using sorter
Expand All @@ -25,7 +31,7 @@ runs:
export PATH="$HOME/.dotnet/tools:$PATH"
for file in $FILES; do
if [ -f "$file" ]; then
if [ "${{ inputs.mode }}" = "check" ]; then
if [ "${{ inputs.mode }}" = "check" ] || [ "${{ inputs.mode }}" = "soft-check" ]; then
dotnet format "$file" --verify-no-changes --fix-analyzers
else
dotnet format "$file" --fix-analyzers
Expand All @@ -34,11 +40,3 @@ runs:
done
# fail if any check error
exit $ERR
- name: Commit & push changes
if: ${{ inputs.mode == 'fix' }}
shell: bash
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add .
git diff --quiet || (git commit -m "chore: automatically sort using directives" && git push)
Loading