style: fix format issues (#255)

This commit is contained in:
Carlos Florêncio
2026-02-19 22:18:01 +00:00
committed by GitHub
parent fe9298a7ad
commit 61ef224ec7
753 changed files with 35129 additions and 21169 deletions
+33
View File
@@ -45,6 +45,39 @@ jobs:
- name: Build
run: go build -v ./cmd/kandev
- name: Check gofmt
shell: bash
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE_SHA="${{ github.event.pull_request.base.sha }}"
else
BASE_SHA="${{ github.event.before }}"
fi
if [[ -z "${BASE_SHA}" || "${BASE_SHA}" == "0000000000000000000000000000000000000000" ]]; then
BASE_SHA="$(git rev-list --max-parents=0 HEAD)"
fi
CHANGED_GO_FILES="$(
git diff --name-only --diff-filter=ACMRT "${BASE_SHA}"..."${{ github.sha }}" -- apps/backend \
| grep -E '^apps/backend/.*\.go$' \
|| true
)"
if [[ -z "${CHANGED_GO_FILES}" ]]; then
echo "No backend Go files changed."
exit 0
fi
UNFORMATTED="$(echo "${CHANGED_GO_FILES}" | sed 's#^apps/backend/##' | xargs gofmt -l)"
if [[ -n "${UNFORMATTED}" ]]; then
echo "The following changed Go files are not formatted with gofmt:"
echo "${UNFORMATTED}"
exit 1
fi
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
+40
View File
@@ -4,6 +4,10 @@ on:
push:
branches: [main]
paths:
- "apps/cli/**"
- "apps/package.json"
- "apps/prettier.config.mjs"
- "apps/.prettierignore"
- "apps/web/**"
- "apps/packages/**"
- "apps/pnpm-lock.yaml"
@@ -11,6 +15,10 @@ on:
pull_request:
branches: [main]
paths:
- "apps/cli/**"
- "apps/package.json"
- "apps/prettier.config.mjs"
- "apps/.prettierignore"
- "apps/web/**"
- "apps/packages/**"
- "apps/pnpm-lock.yaml"
@@ -41,6 +49,38 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check formatting
shell: bash
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE_SHA="${{ github.event.pull_request.base.sha }}"
else
BASE_SHA="${{ github.event.before }}"
fi
if [[ -z "${BASE_SHA}" || "${BASE_SHA}" == "0000000000000000000000000000000000000000" ]]; then
BASE_SHA="$(git rev-list --max-parents=0 HEAD)"
fi
CHANGED_FILES="$(
git diff --name-only --diff-filter=ACMRT "${BASE_SHA}"..."${{ github.sha }}" \
| grep -E '^apps/(web|cli|packages)/.*\.(ts|tsx|js|jsx|mjs|cjs|json|md|mdx|yml|yaml|css|scss)$' \
|| true
)"
if [[ -z "${CHANGED_FILES}" ]]; then
echo "No Prettier-scoped files changed."
exit 0
fi
echo "Checking Prettier on changed files:"
echo "${CHANGED_FILES}"
echo "${CHANGED_FILES}" \
| sed 's#^apps/##' \
| xargs pnpm --dir apps exec prettier --check --ignore-unknown
- name: Run lint
run: pnpm --filter @kandev/web lint