From d0049ad904b3fee1eeaaed3c6b82d60fc96de19e Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Tue, 24 Mar 2026 10:48:18 +0800 Subject: [PATCH] chron(ci):setup the lint check in frontend (#1276) * chron(ci):setup the lint check in frontend * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(ci): correct lint-check.yml indentation, add Python 3.12 setup, upgrade checkout to v4 (#1277) * Initial plan * Fix lint-check.yml: fix steps indentation, add Python 3.12 setup, upgrade checkout to v4 Co-authored-by: WillemJiang <219644+WillemJiang@users.noreply.github.com> Agent-Logs-Url: https://github.com/bytedance/deer-flow/sessions/7b4d4fad-f024-453a-9f93-5fc2dd83b471 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: WillemJiang <219644+WillemJiang@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> --- .github/workflows/backend-unit-tests.yml | 7 +- .github/workflows/lint-check.yml | 71 +++++++++++++++++++ .../components/workspace/command-palette.tsx | 1 + 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/lint-check.yml diff --git a/.github/workflows/backend-unit-tests.yml b/.github/workflows/backend-unit-tests.yml index 47f2d0e..4c19662 100644 --- a/.github/workflows/backend-unit-tests.yml +++ b/.github/workflows/backend-unit-tests.yml @@ -10,6 +10,9 @@ concurrency: group: unit-tests-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: backend-unit-tests: if: github.event.pull_request.draft == false @@ -32,10 +35,6 @@ jobs: working-directory: backend run: uv sync --group dev - - name: Lint backend - working-directory: backend - run: make lint - - name: Run unit tests of backend working-directory: backend run: make test diff --git a/.github/workflows/lint-check.yml b/.github/workflows/lint-check.yml new file mode 100644 index 0000000..3bdad54 --- /dev/null +++ b/.github/workflows/lint-check.yml @@ -0,0 +1,71 @@ +name: Lint Check + +on: + push: + branches: [ 'main' ] + pull_request: + branches: [ '*' ] + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v7 + with: + version: "latest" + + - name: Install dependencies + working-directory: backend + run: | + uv sync --group dev + + - name: Lint backend + working-directory: backend + run: make lint + + lint-frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Enable Corepack + run: corepack enable + + - name: Use pinned pnpm version + run: corepack prepare pnpm@10.26.2 --activate + + - name: Install frontend dependencies + run: | + cd frontend + pnpm install --frozen-lockfile + + - name: Run frontend linting + run: | + cd frontend + pnpm lint + + - name: Check TypeScript types + run: | + cd frontend + pnpm typecheck + + - name: Build frontend + run: | + cd frontend + BETTER_AUTH_SECRET=local-dev-secret pnpm build diff --git a/frontend/src/components/workspace/command-palette.tsx b/frontend/src/components/workspace/command-palette.tsx index f1ec2e7..4f9a417 100644 --- a/frontend/src/components/workspace/command-palette.tsx +++ b/frontend/src/components/workspace/command-palette.tsx @@ -26,6 +26,7 @@ import { } from "@/components/ui/dialog"; import { useI18n } from "@/core/i18n/hooks"; import { useGlobalShortcuts } from "@/hooks/use-global-shortcuts"; + import { SettingsDialog } from "./settings"; export function CommandPalette() {