mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 11:02:20 +00:00
Configure lefthook formatter checks (#231)
* Add lefthook formatter checks * Fix SDK mode hydration * Stabilize SDK mode integration test
This commit is contained in:
parent
0471214d65
commit
d2346bafb3
282 changed files with 5840 additions and 8399 deletions
31
.github/workflows/ci.yaml
vendored
31
.github/workflows/ci.yaml
vendored
|
|
@ -11,6 +11,8 @@ jobs:
|
|||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
|
@ -21,6 +23,35 @@ jobs:
|
|||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install
|
||||
- name: Run formatter hooks
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
git fetch origin "${{ github.base_ref }}" --depth=1
|
||||
diff_range="origin/${{ github.base_ref }}...HEAD"
|
||||
elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
|
||||
diff_range="${{ github.event.before }}...${{ github.sha }}"
|
||||
else
|
||||
diff_range="HEAD^...HEAD"
|
||||
fi
|
||||
|
||||
mapfile -t changed_files < <(
|
||||
git diff --name-only --diff-filter=ACMR "$diff_range" \
|
||||
| grep -E '\.(cjs|cts|js|jsx|json|jsonc|mjs|mts|rs|ts|tsx)$' \
|
||||
|| true
|
||||
)
|
||||
|
||||
if [ ${#changed_files[@]} -eq 0 ]; then
|
||||
echo "No formatter-managed files changed."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
args=()
|
||||
for file in "${changed_files[@]}"; do
|
||||
args+=(--file "$file")
|
||||
done
|
||||
|
||||
pnpm exec lefthook run pre-commit --no-stage-fixed --fail-on-changes "${args[@]}"
|
||||
- run: npm install -g tsx
|
||||
- name: Run checks
|
||||
run: ./scripts/release/main.ts --version 0.0.0 --only-steps run-ci-checks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue