Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 24 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ jobs:
qlty:
name: Qlty Check
runs-on: ubuntu-latest
timeout-minutes: 3
timeout-minutes: 10
env:
UPSTREAM_REF: origin/${{ github.base_ref }}

steps:
- name: Checkout code
Expand All @@ -77,11 +79,27 @@ jobs:
- name: Install qlty
uses: qltysh/qlty-action/install@08a0a862c159eae9b9003081da6663d96efef637 # v2.3.0

- name: Run qlty check
run: qlty check
- name: Run qlty check (pull request)
if: github.event_name == 'pull_request'
run: qlty check --upstream "$UPSTREAM_REF"

- name: Run qlty code smells analysis
run: qlty smells
- name: Run qlty code smells analysis (pull request)
# A custom `if:` still implies success(), so !cancelled() is what survives a failed check above.
if: "!cancelled() && github.event_name == 'pull_request'"
run: qlty smells --upstream "$UPSTREAM_REF"

- name: Run qlty check (full tree)
if: github.event_name != 'pull_request'
run: qlty check --all --filter=actionlint,trufflehog

- name: Run qlty code smells analysis (full tree)
if: "!cancelled() && github.event_name != 'pull_request'"
run: qlty smells --all

# osv-scanner declares skip_upstream, so only --all ever sees a lockfile; reporting-only until triaged.
- name: Run qlty dependency scan
if: '!cancelled()'
run: qlty check --all --filter=osv-scanner --no-fail

build:
name: Build & Test
Expand All @@ -105,8 +123,7 @@ jobs:
- name: Install dependencies
run: |
npm ci --prefer-offline --no-audit
# Verify Tailwind CSS native modules are installed for Linux (npm optional deps bug)
# See: https://github.com/npm/cli/issues/4828
# Workaround for the npm optional-deps bug: https://github.com/npm/cli/issues/4828
node -e "try { require('lightningcss'); } catch { process.exit(1); }" 2>/dev/null || npm install lightningcss-linux-x64-gnu
node -e "try { require('@tailwindcss/oxide'); } catch { process.exit(1); }" 2>/dev/null || npm install @tailwindcss/oxide-linux-x64-gnu

Expand Down Expand Up @@ -227,7 +244,6 @@ jobs:
run: npm ci --prefer-offline --no-audit

- name: Run audit for production dependencies
# Uses better-npm-audit with .nsprc exceptions file
run: npx better-npm-audit audit --production

audit-all:
Expand All @@ -250,5 +266,4 @@ jobs:
run: npm ci --prefer-offline --no-audit

- name: Run audit for all dependencies
# Uses better-npm-audit with .nsprc exceptions file
run: npx better-npm-audit audit
42 changes: 17 additions & 25 deletions .qlty/qlty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
# Learn more at https://docs.qlty.sh
config_version = "0"

# Exclusion patterns. Must stay above every table header: a bare key after
# `[[plugin]]`/`[[source]]` binds to that table and qlty silently drops it.
exclude_patterns = [
"**/node_modules/**",
"**/dist/**",
"**/coverage/**",
"**/*.min.js",
"**/*.min.css",
"**/*.d.ts",
]
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Plugins configuration
[[plugin]]
name = "actionlint"
Expand All @@ -17,17 +28,6 @@ name = "osv-scanner"
name = "default"
default = true

# Exclusion patterns
exclude_patterns = [
"node_modules/**",
"dist/**",
"build/**",
"coverage/**",
"**/*.min.js",
"**/*.min.css",
".git/**",
]

# Code Smells Configuration
[smells]
mode = "block"
Expand All @@ -44,26 +44,18 @@ threshold = 4
enabled = true
threshold = 5

[smells.function_length]
[smells.file_complexity]
enabled = true
threshold = 50

[smells.file_length]
[smells.function_complexity]
enabled = true
threshold = 500
threshold = 18

[smells.cognitive_complexity]
[smells.identical_code]
enabled = true
threshold = 15

[smells.duplicate_code]
enabled = true
threshold = 6

[smells.large_class]
[smells.similar_code]
enabled = true
threshold = 500

[smells.long_parameter_list]
enabled = true
threshold = 2
threshold = 15
Loading