Skip to content

chore: qlty setup - #5

Merged
jamesbhobbs merged 15 commits into
mainfrom
qlty
Oct 7, 2025
Merged

jamesbhobbs merged 15 commits into
mainfrom
qlty

Conversation

@jamesbhobbs

@jamesbhobbs jamesbhobbs commented Sep 30, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores
    • Added Qlty static analysis to CI and pre-commit checks.
    • Introduced Qlty configuration with plugins and code-smell rules.
    • Reduced CI job timeouts for existing jobs to 3 minutes.
    • Updated .gitignore to exclude Qlty cache, logs, outputs, and results.
    • Expanded spell-check dictionary to include “qlty”.
    • Tightened lint-staged patterns to target TS/TSX/HTML/JSON/JSONC only.

@coderabbitai

coderabbitai Bot commented Sep 30, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

  • .github/workflows/ci.yml: Set timeout-minutes to 3 for Spell Check, Lint & Format, Typecheck, Build, Test, and License Check. Added a new job "Qlty Check" that checks out code, installs qlty, runs qlty check, and runs qlty smells.
  • .gitignore: Added .qlty ignore patterns: cache, logs, out, plugin_cachedir, results.
  • .qlty/qlty.toml: New Qlty config declaring plugins (actionlint, trufflehog, osv-scanner), default source, exclusions, and smells thresholds/categories.
  • cspell.json: Added the word "qlty".
  • package.json: Narrowed lint-staged patterns to target ts/tsx/html/json/jsonc.
  • .husky/pre-commit: Now runs qlty check after lint-staged on success.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant Jobs as CI Jobs
  participant Q as Qlty Check

  Dev->>GH: Push / PR open
  note over GH: CI workflow starts
  GH->>Jobs: Run Spell Check, Lint & Format, Typecheck, Build, Test, License Check (timeout-minutes=3)
  GH->>Q: Run Qlty Check (checkout → install qlty → qlty check → qlty smells)
  alt Any job exceeds 3 minutes
    GH-->>Dev: Job times out (failure)
  else All complete
    GH-->>Dev: CI results reported
  end
Loading
sequenceDiagram
  autonumber
  actor Dev as Developer
  participant Husky as .husky/pre-commit
  participant LS as lint-staged
  participant Qlty as qlty

  Dev->>Husky: git commit
  Husky->>LS: Run lint-staged
  alt lint-staged succeeds
    Husky->>Qlty: Run `qlty check`
    Qlty-->>Husky: Exit code
  else lint-staged fails
    Husky-->>Dev: Abort commit
  end
  Husky-->>Dev: Commit proceeds or aborts
Loading

Possibly related PRs

Suggested reviewers

  • Artmann
  • saltenasl

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the core purpose of the changeset, which is to introduce and configure Qlty across CI, gitignore, spellcheck, and pre-commit workflows. It is concise, specific, and accurately reflects the main work being undertaken. There is no unrelated or ambiguous content in the title.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f013cf and dfc3293.

📒 Files selected for processing (1)
  • cspell.json (1 hunks)
🔇 Additional comments (1)
cspell.json (1)

33-49: Vocabulary update acknowledged.

Adding “qlty” keeps the spell-check quiet for the new tooling.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c085c69 and d6fdc5f.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml (1 hunks)
  • .gitignore (1 hunks)
  • .qlty/qlty.toml (1 hunks)
  • cspell.json (1 hunks)
  • package.json (2 hunks)
🔇 Additional comments (8)
cspell.json (1)

21-22: LGTM.

Dictionary entries prevent false positives from spell checker.

.gitignore (1)

2-6: LGTM.

Proper exclusion of Qlty artifacts.

.qlty/qlty.toml (3)

6-25: Good plugin selection.

Security scanning (trufflehog, osv-scanner) and standard linters covered.


33-41: Exclusion patterns align with .gitignore.

Proper coverage of build artifacts and dependencies.


47-81: Verify duplicate smell configurations.

Both function_parameters (line 55) and long_parameter_list (line 79) have threshold 5. Confirm this duplication is intentional for your use case.

package.json (1)

16-17: LGTM.

Scripts provide convenient access to Qlty commands.

.github/workflows/ci.yml (2)

63-64: Consider fetch-depth for analysis.

Default shallow clone may limit Qlty's historical analysis capabilities. Verify if fetch-depth: 0 is needed.


58-75: Job structure is sound.

Parallel execution with other checks is efficient.

Comment thread .github/workflows/ci.yml Resolved
Comment thread package.json Resolved
- Add qlty configuration with prettier, eslint, markdownlint, yamllint, actionlint, trufflehog, and osv-scanner
- Configure code smells detection (boolean logic, nested control flow, function parameters, etc.)
- Add qlty check to lint-staged for pre-commit hooks on code files
- Add qlty CI job with check and smells analysis
- Add qlty to cspell dictionary
@jamesbhobbs
jamesbhobbs marked this pull request as ready for review September 30, 2025 16:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6fdc5f and 0845925.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml (1 hunks)
  • .gitignore (1 hunks)
  • .qlty/qlty.toml (1 hunks)
  • cspell.json (1 hunks)
  • package.json (1 hunks)
🔇 Additional comments (5)
cspell.json (1)

21-22: LGTM. Word additions are appropriate.

Both "repo" and "qlty" are valid additions to the spell-check dictionary.

.gitignore (1)

1-6: LGTM. Ignore patterns are complete.

Covers Qlty artifacts and normalizes node_modules entry.

package.json (1)

25-31: Verify qlty availability in pre-commit context.

lint-staged runs in the pre-commit hook via husky, but there's no setup step to ensure qlty is in PATH. Developers will need to install qlty locally for these commands to succeed.

Consider documenting the qlty installation requirement in the README or adding an installation check to the prepare script.

Additionally, note that JS/TS files lack formatting checks (only qlty check), while HTML/MD/YAML run both formatting and qlty. Confirm this is intentional.

.qlty/qlty.toml (2)

27-41: LGTM. Exclusion patterns align with .gitignore.

Standard patterns for node projects.


43-81: LGTM. Reasonable smell thresholds for initial rollout.

Mode "comment" is appropriate for non-blocking feedback. Thresholds follow industry standards, though you may want to tune based on actual results.

Note: duplicate_code threshold of 6 lines can be noisy; consider increasing if you get false positives.

Comment thread .github/workflows/ci.yml Resolved
Comment thread .qlty/qlty.toml Resolved
Comment thread .github/workflows/ci.yml Resolved

@saltenasl saltenasl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single nit

Comment thread .qlty/qlty.toml Resolved
# Conflicts:
#	.github/workflows/ci.yml
#	.gitignore
#	cspell.json
#	package.json
@codecov

codecov Bot commented Oct 2, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.67%. Comparing base (d9bc0a0) to head (dfc3293).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #5   +/-   ##
=======================================
  Coverage   92.67%   92.67%           
=======================================
  Files          16       16           
  Lines         505      505           
  Branches      110      167   +57     
=======================================
  Hits          468      468           
  Misses         37       37           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jamesbhobbs
jamesbhobbs marked this pull request as draft October 2, 2025 10:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.qlty/qlty.toml (1)

73-75: Lower threshold to distinguish from function_parameters.

Matching function_parameters threshold (5) means both smells trigger simultaneously. long_parameter_list detects when parameters should be grouped into objects—a different concern than raw count. Consider threshold 2-3 to catch this smell earlier.

Apply this diff:

 [smells.long_parameter_list]
 enabled = true
-threshold = 5  # When parameters should be grouped/refactored into objects
+threshold = 2  # When parameters should be grouped/refactored into objects
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fcadb0b and 1bd71c1.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • .qlty/qlty.toml (1 hunks)
  • .yamllint (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-30T16:47:46.420Z
Learnt from: jamesbhobbs
PR: deepnote/deepnote#5
File: .qlty/qlty.toml:5-26
Timestamp: 2025-09-30T16:47:46.420Z
Learning: In the deepnote/deepnote repository, for .qlty/qlty.toml configuration, the team prefers to use latest plugin versions rather than pinning versions to ensure the most current scans are used.

Applied to files:

  • .qlty/qlty.toml
🔇 Additional comments (5)
.yamllint (1)

1-7: LGTM!

Clean yamllint config. The 120-char limit aligns well with the broader quality tooling setup.

.qlty/qlty.toml (4)

5-20: LGTM!

Plugin configuration is clean. No version pinning is intentional per team preference for latest scans.

Based on learnings.


21-25: LGTM!

Default source configuration is correct.


26-35: LGTM!

Exclusion patterns cover typical build artifacts and generated code appropriately.


37-72: LGTM!

Smells configuration thresholds are reasonable defaults. Mode "comment" is appropriate for initial rollout.

@jamesbhobbs
jamesbhobbs requested a review from saltenasl October 2, 2025 15:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1bd71c1 and bac411e.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml (1 hunks)
  • .qlty/qlty.toml (1 hunks)
  • cspell.json (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-30T16:47:46.420Z
Learnt from: jamesbhobbs
PR: deepnote/deepnote#5
File: .qlty/qlty.toml:5-26
Timestamp: 2025-09-30T16:47:46.420Z
Learning: In the deepnote/deepnote repository, for .qlty/qlty.toml configuration, the team prefers to use latest plugin versions rather than pinning versions to ensure the most current scans are used.

Applied to files:

  • .qlty/qlty.toml

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread package.json Resolved
@jamesbhobbs
jamesbhobbs marked this pull request as ready for review October 2, 2025 17:06
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 7, 2025
@jamesbhobbs
jamesbhobbs disabled auto-merge October 7, 2025 11:49
@jamesbhobbs
jamesbhobbs enabled auto-merge (squash) October 7, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants