Repository navigation
feat: add @comfyorg/code-quality #19986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: 'CI: Code Quality Package' | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'packages/code-quality/**' | ||
| - 'pnpm-lock.yaml' | ||
| - '.github/workflows/ci-code-quality.yaml' | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'packages/code-quality/**' | ||
| - 'pnpm-lock.yaml' | ||
| - '.github/workflows/ci-code-quality.yaml' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| package: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| manager: [npm, pnpm] | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: ./.github/actions/setup-frontend | ||
| - run: pnpm --filter @comfyorg/code-quality check | ||
| - run: pnpm --filter @comfyorg/code-quality test:coverage | ||
| - run: pnpm --filter @comfyorg/code-quality smoke:pack ${{ matrix.manager }} | ||
| - uses: actions/upload-artifact@v6 | ||
| if: always() | ||
| with: | ||
| name: code-quality-coverage-${{ matrix.manager }} | ||
| path: packages/code-quality/coverage | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,7 @@ set -e | |
|
|
||
| pnpm exec lint-staged | ||
| pnpm exec tsx scripts/check-unused-i18n-keys.ts | ||
| pnpm exec tsx scripts/check-frozen-dirs.ts | ||
| pnpm exec tsx scripts/check-frozen-dirs.ts | ||
| if git diff --cached --name-only | grep -q '^packages/code-quality/'; then | ||
| pnpm --filter @comfyorg/code-quality check | ||
| fi | ||
|
Comment on lines
+7
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: cat .husky/pre-commit
sed -n '27,42p' packages/code-quality/package.jsonRepository: Comfy-Org/ComfyUI_frontend Length of output: 993 🤖 get_repo_knowledge executed:
Length of output: 47586 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- PR hook diff ---'
git diff 2eeecc917a7e4ba2f38f93216b1f78f8bda8da43 1d0269e53cdbeb9a574385430f2821edb4fd8728 -- .husky/pre-commit .husky/pre-push packages/code-quality/package.json
printf '%s\n' '--- tracked hook/config/doc paths ---'
git ls-files | grep -E '(^|/)(pre-commit|pre-push|lint-staged|package.json|CONTRIBUTING|README|.*hook.*|.*commit.*)' | head -100
printf '%s\n' '--- pre-push ---'
if test -f .husky/pre-push; then cat -n .husky/pre-push; else echo 'no .husky/pre-push'; fi
printf '%s\n' '--- relevant references ---'
rg -n -i 'staged|working tree|pre-commit|pre-push|lint-staged|code-quality check' --glob '!pnpm-lock.yaml' .husky package.json packages/code-quality README.md CONTRIBUTING.md 2>/dev/null || true
printf '%s\n' '--- package check declaration ---'
sed -n '20,48p' packages/code-quality/package.jsonRepository: Comfy-Org/ComfyUI_frontend Length of output: 8726 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- lint-staged configuration ---'
cat -n lint-staged.config.ts
printf '%s\n' '--- code-quality package guidance ---'
sed -n '55,105p' packages/code-quality/README.md | nl -ba -v55
printf '%s\n' '--- partial staging and hook guidance references ---'
rg -n -i 'partial stag|staged content|staged files|staged changes|working tree|lint-staged|pre-commit|pre-push' --glob '*.md' --glob '*.ts' --glob '*.json' --glob '!pnpm-lock.yaml' --glob '!**/node_modules/**' . | head -160Repository: Comfy-Org/ComfyUI_frontend Length of output: 11940 🏁 Script executed: sed -n '100,130p' AGENTS.md | nl -ba -v100Repository: Comfy-Org/ComfyUI_frontend Length of output: 1574 Run the package check against staged content. The path filter already checks staged filenames, but 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # ADR-DEVEX-QUALITY-0040: Share a versioned code-quality package | ||
|
|
||
| Date: 2026-10-02 | ||
|
|
||
| ## Status | ||
|
|
||
| Proposed | ||
|
|
||
| ## Context | ||
|
|
||
| Platform stays in its own repository. Copying Frontend lint, formatting and audit | ||
| policy leaves consumers maintaining engine compatibility and policy drift. | ||
| Separate configuration packages alone do not give Platform a single tested update. | ||
|
|
||
| ## Decision | ||
|
|
||
| Publish `@comfyorg/code-quality` from Frontend. Pin compatible engines and common | ||
| plugins, export reusable policies, and provide thin lint/format/audit commands. | ||
| Keep native tool configuration and caching; add no task graph or build orchestration. | ||
|
|
||
| Frontend retains Oxfmt; Platform retains Prettier and Nuxt's generated ESLint | ||
| adapter. Repositories own paths, framework configuration, application restrictions, | ||
| ignore files, baselines, typechecks, builds and tests. ESLint-only use is supported; | ||
| overlapping rules may only be disabled where the same files run through Oxlint. | ||
|
|
||
| Validate the tarball in clean npm and pnpm consumers before release. Reuse the | ||
| existing version-bump PR and publication workflow. Changes that introduce failures | ||
| in passing consumers are breaking changes. Consumers pin one package version and | ||
| commit its lockfile; rollback reverts both. | ||
|
|
||
| ## Consequences | ||
|
|
||
| ### Positive | ||
|
|
||
| - Tool compatibility and common policy have one owner and a tested release unit. | ||
| - Platform can update shared guardrails without copying Frontend configuration. | ||
|
|
||
| ### Negative | ||
|
|
||
| - The package installs both formatter and linter engines even when one is unused. | ||
| - Framework adapters and local scopes still need consumer tests. | ||
| - Publishing and adoption remain ordered steps; a passing local tarball does not | ||
| establish a successful registry release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 3478
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 34803
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 31412
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 16846
Add the setup inputs to both path filters.
The package job uses
.github/actions/setup-frontendto install dependencies, then runs package checks and npm/pnpm tarball smoke tests. The package also resolves test tools frompnpm-workspace.yamlcatalogs. Changes limited to either file can skip those checks. The shared lint, typecheck, and unit workflows provide only partial coverage; the unit-package list excludes@comfyorg/code-quality.Suggested path filters
pull_request: paths: - 'packages/code-quality/**' - 'pnpm-lock.yaml' + - 'pnpm-workspace.yaml' + - '.github/actions/setup-frontend/**' - '.github/workflows/ci-code-quality.yaml' push: branches: [main] paths: - 'packages/code-quality/**' - 'pnpm-lock.yaml' + - 'pnpm-workspace.yaml' + - '.github/actions/setup-frontend/**' - '.github/workflows/ci-code-quality.yaml'🤖 Prompt for AI Agents