Skip to content

fix: require config path or file names#1

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-require-config-source
Jul 9, 2026
Merged

fix: require config path or file names#1
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-require-config-source

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

This PR makes loadConfig reject calls that do not specify either a custom path or at least one configFileNames entry, avoiding silent empty configs when no search target is configured.

@chenjiahan chenjiahan marked this pull request as ready for review July 9, 2026 03:37
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d17c3fbf-0c29-4d14-81de-f668ecf59a87

📥 Commits

Reviewing files that changed from the base of the PR and between 8801408 and b354b98.

📒 Files selected for processing (3)
  • src/index.ts
  • src/types.ts
  • tests/error-handling/index.test.ts

📝 Walkthrough

Walkthrough

Added an early validation check in loadConfig that throws an error if neither a path nor at least one configFileNames entry is provided. Updated the JSDoc for LoadConfigOptions to reflect that configFileNames is required when path is absent. Added a test case verifying loadConfig rejects with the appropriate error message under these conditions, including when configFileNames is an empty array.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: requiring a config path or config file names.
Description check ✅ Passed The description accurately summarizes the loadConfig validation change and its effect.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chenjiahan/fix-require-config-source

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@chenjiahan chenjiahan merged commit 0d69167 into main Jul 9, 2026
3 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/fix-require-config-source branch July 11, 2026 09:25
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.

1 participant