Skip to content

fix(workspace): fix format script glob missing top-level src files - #167

Merged
santi698 merged 2 commits into
mainfrom
fix/format-script-glob
Jul 29, 2026
Merged

fix(workspace): fix format script glob missing top-level src files#167
santi698 merged 2 commits into
mainfrom
fix/format-script-glob

Conversation

@santi698

Copy link
Copy Markdown
Collaborator

Problem

The format/format:check npm scripts used a shell glob:

oxfmt packages/*/src/**/*.ts

npm runs scripts via sh, not bash, so ** has no globstar behavior — it's treated like a single * and never matches files sitting directly in src/ (only nested ones like src/utils/*.ts). This silently excluded files like packages/cli/src/cli.test.ts, cli.ts, packages/sdk/src/errors.ts, etc. from formatting checks.

Fix

  • Changed format/format:check to run oxfmt / oxfmt --check with no path args, letting oxfmt do its own recursive directory scan (respecting .gitignore and ignorePatterns) instead of relying on shell globbing.
  • Updated .oxfmtrc.json ignorePatterns to exclude **/*.{md,yml,json}, since oxfmt without a path glob now also picks up non-TS files that were never part of this workspace's formatting scope.
  • Ran format to fix the newly-covered files that were previously never checked.

Testing

  • npm run format:check — passes, now covers 55 files (was 12 before, silently missing top-level src/*.ts files).
  • npm run lint — passes.

The format/format:check npm scripts used a shell glob
(packages/*/src/**/*.ts) that relies on bash's globstar behavior.
npm runs scripts via sh, which has no globstar, so `**` behaved like
a single `*` and never matched files sitting directly in src/ (e.g.
cli.test.ts, cli.ts, errors.ts), silently excluding them from
formatting checks.

Switch format/format:check to run oxfmt with no path args, so it uses
its own recursive directory scan (respecting .gitignore and
ignorePatterns) instead of relying on shell globbing.

Also update .oxfmtrc.json ignorePatterns to exclude md/yml/json files,
since oxfmt without a path glob now also picks up non-TS files that
were never part of this workspace's formatting scope.

Re-run format across the newly-covered files.
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #167   +/-   ##
=======================================
  Coverage   93.36%   93.36%           
=======================================
  Files          15       15           
  Lines        2488     2488           
  Branches      296      296           
=======================================
  Hits         2323     2323           
  Misses        163      163           
  Partials        2        2           
Flag Coverage Δ
unittests 93.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/sdk/src/errors.ts 95.74% <ø> (ø)

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Assert against the actual package.json version, read the same way
handleInfo() reads it, so the test doesn't break every time the
package version changes.
@sonarqubecloud

Copy link
Copy Markdown

@santi698
santi698 merged commit 9d7432b into main Jul 29, 2026
16 checks passed
@santi698
santi698 deleted the fix/format-script-glob branch July 29, 2026 11:52
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.

2 participants