Repository navigation
Check every file below the working directory when no paths are given - #2698
Conversation
…iven
`defaultOptions.includeGlobs` was `${process.cwd()}**`, with no `/`, so
it matched names beside the working directory rather than files in it:
running checksync with no include paths always failed with "No matching
files". It was also worked out at import, before `--cwd` changes folder.
The default is now `["."]`. getFiles expands a folder to everything below
it when files are found, so it follows `--cwd` and works on Windows.
Adds a `cli/no-paths` conformance case with its own fixture, which has
its own configuration so the repository's isn't found. Its golden comes
in the next commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
🦋 Changeset detectedLatest commit: 39c1152 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2698 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 92 93 +1
Lines 3157 3171 +14
Branches 2374 2383 +9
=========================================
+ Hits 3157 3171 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 485 bytes (0.07%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: checksync-cjsAssets Changed:
Files in
|
A configuration file found above the working directory becomes the new working directory, so the `.` default checked everything below the configuration instead. determineOptions now remembers the folder it started in, after any `--cwd`, and when neither the arguments nor the configuration give include globs, uses a glob for everything below it. defaultIncludeGlobs builds that glob relative to the new working directory, escaped with fast-glob. The default itself is now `**`, so it no longer relies on getFiles turning a bare folder into `folder/**`. Adds `cli/no-paths-below-config` and `cli/no-paths-cwd-option` conformance cases, run from below a configuration file that has a broken file beside it. Their goldens come in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
When `--config` names a file whose folder doesn't contain the starting folder, a glob for the starting folder would begin with `..`, which the configuration's exclude globs can't match. defaultIncludeGlobs now falls back to everything below the configuration's folder in that case, and the help says so. determineOptions now picks the include globs with one `??` chain, and the test mocks of loaded configurations are cast so the typecheck passes. Adds a `cli/no-paths-config-elsewhere` conformance case, and updates the help goldens and snapshots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
The no-paths-below-config fixture's configuration now excludes a folder holding a broken file, so cli/no-paths-config-elsewhere shows the exclude globs still apply when the default falls back to the configuration's folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
…72zesp-default-include # Conflicts: # src/conformance/constants.ts
Running checksync with no include paths always failed with "No matching files". The default include glob was
${process.cwd()}**, with no/, so it matched names next to the working directory instead of the files in it. It was also worked out when the module loaded, before--cwdchanges folder.Now, when neither the arguments nor the config file give include globs, checksync checks every file below the folder it started in, after any
--cwd. A config file moves the working directory to its own folder, sodetermineOptionsremembers the starting folder first.defaultIncludeGlobsthen builds an escaped glob for that folder, relative to the new working directory. If the starting folder isn't inside the config's folder (for example,--confignames a file in a folder beside it), everything below the config's folder is checked instead. That keeps the config's exclude globs working. The help text now says this.This is a patch fix for 11.x, found while porting
getFilesto Rust (#2615). It adds four conformance cases, each with its own fixture and config so the repository's config isn't used:cli/no-paths: no arguments.cli/no-paths-below-config: no arguments, run from a subfolder whose parent holds the config and a broken file.cli/no-paths-cwd-option: the same subfolder, given with--cwd.cli/no-paths-config-elsewhere:--confignames a config in a folder beside the starting folder, and that config's folder has a broken file.Test plan
package.jsonand a pair of synced files, runchecksyncwith no arguments. It reports "Everything is in sync!" instead of "No matching files"..checksyncrc.jsonand a file with a lonesync-endtag in that folder, then runchecksyncfrom a subfolder. Only the subfolder's files are checked. Run it again with--cwd <subfolder>from elsewhere, and the result is the same.🤖 Generated with Claude Code
https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn