Skip to content

feat: support .vectorlint.ini hidden configuration file#43

Merged
oshorefueled merged 9 commits intomainfrom
ft/vectorlint-config
Dec 28, 2025
Merged

feat: support .vectorlint.ini hidden configuration file#43
oshorefueled merged 9 commits intomainfrom
ft/vectorlint-config

Conversation

@ayo6706
Copy link
Collaborator

@ayo6706 ayo6706 commented Dec 19, 2025

Add support for .vectorlint.ini as a hidden configuration file, aligning VectorLint with standard dotfile conventions used by tools like .gitignore and .eslintrc.

Changes

  • Config Loader: Added resolveConfigPath() function that checks for .vectorlint.ini first, then falls back to vectorlint.ini for backward compatibility
  • Constants: Added HIDDEN_CONFIG_FILENAME constant
  • Documentation: Updated CONFIGURATION.md and README.md to reflect the new hidden file as the primary option
  • Tests: Added 4 new test cases covering hidden file loading, fallback behavior, and precedence

Behavior

Scenario Result
Only .vectorlint.ini exists Loads hidden file
Only vectorlint.ini exists Loads visible file (backward compatible)
Both files exist Hidden file takes precedence
Neither exists Error message mentions both options

Why

Users expect configuration files to follow dotfile conventions. This change:

  • Keeps project roots clean
  • Aligns with professional tooling standards
  • Maintains full backward compatibility

Summary by CodeRabbit

  • New Features

    • Config resolution now prefers the hidden .vectorlint.ini, falls back to legacy vectorlint.ini, and reports clearer errors when missing.
  • Documentation

    • Guides, templates, examples and README updated to reference .vectorlint.ini; formatting and examples adjusted for consistency.
  • Tests

    • Tests added/updated to verify hidden-file precedence, legacy fallback, parsing of config keys, and updated validation behavior.
  • CLI

    • Help text updated to show the new default config filename.

✏️ Tip: You can customize this high-level summary in your review settings.

- Update CONFIGURATION.md to reference `.vectorlint.ini` instead of `vectorlint.ini`
- Update README.md quick start guide to use `.vectorlint.ini` filename
- Correct configuration file example comments to reflect actual filename
- Ensure consistent naming convention across all documentation
@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

📝 Walkthrough

Walkthrough

The PR renames the default config file to .vectorlint.ini, adds a legacy alias vectorlint.ini, updates the config loader to prefer the hidden file (falling back to the legacy name), and updates CLI help, schemas, tests, docs, and templates to use the new filename and behavior.

Changes

Cohort / File(s) Summary
Constants
src/config/constants.ts
DEFAULT_CONFIG_FILENAME set to '.vectorlint.ini'; added LEGACY_CONFIG_FILENAME = 'vectorlint.ini'.
Config loader
src/boundaries/config-loader.ts
Added resolveConfigPath(cwd, configPath?) to resolve explicit paths or prefer DEFAULT_CONFIG_FILENAME then LEGACY_CONFIG_FILENAME; loadConfig delegates to it, normalizes rulesPath, accepts extra keys (CONCURRENCY, DEFAULT_SEVERITY), explicitly rejects old ScanPaths=[...] syntax, and improves error messages/context.
CLI / Schemas
src/cli/commands.ts, src/schemas/config-schemas.ts
Help text and comments updated to reference DEFAULT_CONFIG_FILENAME / .vectorlint.ini; schema shape unchanged.
Tests
tests/config.test.ts, tests/config-loader-integration.test.ts, tests/eval-pack-e2e.test.ts, tests/scanpaths-refactor.test.ts, ...
Tests updated to import/use DEFAULT_CONFIG_FILENAME (and LEGACY_CONFIG_FILENAME where relevant); added/adjusted tests for hidden-file loading, legacy fallback, precedence when both exist, parsing of RulesPath/ScanPaths, and old ScanPaths syntax rejection.
Docs & templates
CONFIGURATION.md, README.md, AGENTS.md, CREATING_RULES.md, .github/CONTRIBUTING.md, .github/ISSUE_TEMPLATE/1_bug_report.yml
Replaced vectorlint.ini references with .vectorlint.ini across docs/examples/templates; formatting and example blocks adjusted (no semantic changes).

Sequence Diagram(s)

mermaid
sequenceDiagram
participant CLI
participant ConfigLoader
participant FS as FileSystem
participant Validator
CLI->>ConfigLoader: call loadConfig(configPath?)
alt explicit configPath provided
ConfigLoader->>FS: resolve & stat(explicit path)
FS-->>ConfigLoader: exists / not found
alt exists
ConfigLoader->>Validator: parse & validate file
Validator-->>ConfigLoader: valid / error
ConfigLoader-->>CLI: return config
else not found
ConfigLoader-->>CLI: throw ConfigError("missing file")
end
else no explicit path
ConfigLoader->>FS: stat(DEFAULT_CONFIG_FILENAME)
alt DEFAULT exists
ConfigLoader->>Validator: parse & validate DEFAULT
Validator-->>ConfigLoader: result
ConfigLoader-->>CLI: return config
else DEFAULT missing
ConfigLoader->>FS: stat(LEGACY_CONFIG_FILENAME)
alt LEGACY exists
ConfigLoader->>Validator: parse & validate LEGACY
Validator-->>ConfigLoader: result
ConfigLoader-->>CLI: return config
else both missing
ConfigLoader-->>CLI: throw ConfigError("no config found")
end
end
end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I found a dot beneath the hay tonight,

A quiet file tucked out of sight.
I nudged the old name, kept it near,
The hidden burrow now leads clear.
Small hops, same home — configs all right.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main feature: adding support for a hidden .vectorlint.ini configuration file while maintaining backward compatibility.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ft/vectorlint-config

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CONFIGURATION.md (1)

111-111: Update the filename in the directory structure example.

Line 111 still references vectorlint.ini in the example directory structure, which is inconsistent with the updated documentation that now presents .vectorlint.ini as the primary option.

🔎 Suggested fix
-└── vectorlint.ini
+└── .vectorlint.ini
🧹 Nitpick comments (1)
tests/config.test.ts (1)

80-98: Consider simplifying the inline comment.

The extensive comment (lines 81-92) explains the evolution of the test rather than documenting its current purpose. This meta-commentary is better suited for commit messages. Consider replacing it with a concise description of what the test validates.

🔎 Suggested simplification
   it('rejects unsupported extensions in ScanPaths', () => {
-    // Note: Validation logic moved to schema or file resolver, but config loader might not enforce extensions strictly anymore 
-    // unless we added that validation back. 
-    // The previous implementation had explicit extension check. 
-    // The new implementation relies on file resolver to filter extensions.
-    // So this test might be testing behavior that no longer exists in loadConfig.
-    // However, let's check if we should still test for invalid patterns if we want to enforce it.
-    // For now, I will update it to expect the new syntax error if we pass the old syntax, 
-    // OR if we want to test extension validation, we should do it on the file resolver level.
-    // But the original test was about "rejects unsupported extensions".
-    // Since we removed the explicit loop checking extensions in config-loader.ts, this test is now obsolete or needs to check something else.
-    // I will remove this test or change it to verify that valid config loads.
-
-    // Actually, let's test that it throws if we use the old syntax, which is what the previous failure showed.
+    // Verify that the old ScanPaths=[...] array syntax is rejected
     const cwd = mkdtempSync(path.join(tmpdir(), 'vlint-'));
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 659ea2e and f7fdc64.

📒 Files selected for processing (5)
  • CONFIGURATION.md (1 hunks)
  • README.md (1 hunks)
  • src/boundaries/config-loader.ts (2 hunks)
  • src/config/constants.ts (1 hunks)
  • tests/config.test.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
tests/config.test.ts (1)
src/boundaries/config-loader.ts (1)
  • loadConfig (51-165)
src/boundaries/config-loader.ts (3)
src/errors/index.ts (1)
  • ConfigError (18-23)
src/config/constants.ts (2)
  • DEFAULT_CONFIG_FILENAME (6-6)
  • LEGACY_CONFIG_FILENAME (5-5)
src/schemas/config-schemas.ts (1)
  • Config (17-17)
🔇 Additional comments (7)
CONFIGURATION.md (1)

3-3: LGTM! Documentation updated consistently.

The references to the configuration file have been properly updated to reflect .vectorlint.ini as the primary option.

Also applies to: 7-7, 12-12

src/config/constants.ts (1)

5-6: LGTM! Clear and appropriate constant naming.

The introduction of LEGACY_CONFIG_FILENAME alongside the updated DEFAULT_CONFIG_FILENAME clearly establishes the precedence order while maintaining backward compatibility.

README.md (1)

67-67: LGTM! Documentation updated correctly.

The configuration file references have been updated to reflect .vectorlint.ini as the standard option.

Also applies to: 70-70

src/boundaries/config-loader.ts (2)

24-46: LGTM! Path resolution logic is correct and well-structured.

The resolveConfigPath function properly implements the documented precedence order:

  1. Explicit path (with validation)
  2. Hidden file (.vectorlint.ini)
  3. Legacy file (vectorlint.ini)
  4. Clear error message mentioning both options

The extraction of path resolution into a dedicated function improves code organization and testability.


52-52: LGTM! Clean delegation to path resolution.

The update to delegate path determination to resolveConfigPath maintains clean separation of concerns.

tests/config.test.ts (2)

10-11: LGTM! Error expectation updated correctly.

The test now properly validates that the error message mentions both configuration file options when neither is found.


13-53: LGTM! Comprehensive test coverage for new behavior.

The new tests thoroughly cover all documented scenarios:

  • Loading .vectorlint.ini when present
  • Falling back to vectorlint.ini when hidden file is absent (backward compatibility)
  • Hidden file precedence when both exist

The test structure is clear and the assertions properly verify the expected behavior.

Copy link

@coderabbitai coderabbitai bot left a comment

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)
src/boundaries/config-loader.ts (1)

49-49: Update the comment to reflect both supported filenames.

The comment still references .vectorlint.ini specifically, but the function now supports both .vectorlint.ini and vectorlint.ini (legacy). The comment should be more generic.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7fdc64 and cd066d9.

📒 Files selected for processing (11)
  • .github/CONTRIBUTING.md (1 hunks)
  • .github/ISSUE_TEMPLATE/1_bug_report.yml (1 hunks)
  • AGENTS.md (3 hunks)
  • CREATING_RULES.md (3 hunks)
  • src/boundaries/config-loader.ts (2 hunks)
  • src/cli/commands.ts (1 hunks)
  • src/schemas/config-schemas.ts (1 hunks)
  • tests/config-loader-integration.test.ts (5 hunks)
  • tests/config.test.ts (3 hunks)
  • tests/eval-pack-e2e.test.ts (2 hunks)
  • tests/scanpaths-refactor.test.ts (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • src/cli/commands.ts
  • .github/CONTRIBUTING.md
  • .github/ISSUE_TEMPLATE/1_bug_report.yml
  • src/schemas/config-schemas.ts
🧰 Additional context used
🧬 Code graph analysis (3)
src/boundaries/config-loader.ts (2)
src/errors/index.ts (1)
  • ConfigError (18-23)
src/config/constants.ts (2)
  • DEFAULT_CONFIG_FILENAME (6-6)
  • LEGACY_CONFIG_FILENAME (5-5)
tests/config.test.ts (1)
src/boundaries/config-loader.ts (1)
  • loadConfig (51-165)
tests/scanpaths-refactor.test.ts (1)
src/boundaries/config-loader.ts (1)
  • loadConfig (51-165)
🔇 Additional comments (11)
AGENTS.md (1)

22-22: LGTM! Documentation updates align with the new hidden config file convention.

The references to .vectorlint.ini are consistent with the codebase changes.

Also applies to: 108-108, 146-146

tests/eval-pack-e2e.test.ts (1)

65-65: LGTM! Test file references updated correctly.

The config file paths now use .vectorlint.ini as expected.

Also applies to: 137-137

tests/scanpaths-refactor.test.ts (1)

170-170: LGTM! Config loading test updated correctly.

The test now verifies the old ScanPaths syntax error with the new .vectorlint.ini filename.

tests/config-loader-integration.test.ts (1)

32-32: LGTM! Integration tests updated consistently.

All test cases now correctly reference .vectorlint.ini.

Also applies to: 70-70, 84-84, 98-98, 120-120

CREATING_RULES.md (1)

54-54: LGTM! Documentation references updated correctly.

All references to the config file now use the hidden .vectorlint.ini convention.

Also applies to: 67-67, 108-108, 399-399

src/boundaries/config-loader.ts (2)

24-46: LGTM! Config path resolution logic is correct.

The precedence logic correctly implements:

  1. Explicit path (when provided) → validate and use
  2. Hidden file .vectorlint.ini (preferred)
  3. Legacy file vectorlint.ini (backward compatibility)
  4. Descriptive error when neither exists

52-52: LGTM! Good refactoring to delegate path resolution.

Using the dedicated resolveConfigPath function improves code organization and makes the precedence logic reusable.

tests/config.test.ts (4)

7-7: LGTM! Test suite updates align with the new convention.

The describe block name and error message expectation correctly reflect support for both .vectorlint.ini and vectorlint.ini.

Also applies to: 10-10


13-23: LGTM! Test correctly verifies hidden file loading.

The test validates that .vectorlint.ini is loaded when present.


37-53: LGTM! Test correctly verifies precedence behavior.

The test validates that .vectorlint.ini (hidden) takes precedence over vectorlint.ini (visible) when both files exist, which aligns with the documented behavior.


68-68: LGTM! Remaining test files updated correctly.

Config file references updated to use the new hidden filename convention.

Also applies to: 96-96

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/config.test.ts (1)

80-98: LGTM! Old syntax rejection test correctly updated.

The test now writes to .vectorlint.ini (line 96) and continues to validate that the deprecated ScanPaths=[...] syntax is properly rejected.

Optional: Consider trimming the comment block.

The comment block on lines 81-93 provides useful historical context but could be condensed or removed since the test now clearly validates the old syntax rejection behavior.

🔎 Suggested simplification
   it('rejects unsupported extensions in ScanPaths', () => {
-    // Note: Validation logic moved to schema or file resolver, but config loader might not enforce extensions strictly anymore 
-    // unless we added that validation back. 
-    // The previous implementation had explicit extension check. 
-    // The new implementation relies on file resolver to filter extensions.
-    // So this test might be testing behavior that no longer exists in loadConfig.
-    // However, let's check if we should still test for invalid patterns if we want to enforce it.
-    // For now, I will update it to expect the new syntax error if we pass the old syntax, 
-    // OR if we want to test extension validation, we should do it on the file resolver level.
-    // But the original test was about "rejects unsupported extensions".
-    // Since we removed the explicit loop checking extensions in config-loader.ts, this test is now obsolete or needs to check something else.
-    // I will remove this test or change it to verify that valid config loads.
-
-    // Actually, let's test that it throws if we use the old syntax, which is what the previous failure showed.
+    // Tests that the old ScanPaths=[...] syntax is properly rejected
     const cwd = mkdtempSync(path.join(tmpdir(), 'vlint-'));
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd066d9 and 16c3967.

📒 Files selected for processing (1)
  • tests/config.test.ts (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/config.test.ts (1)
src/boundaries/config-loader.ts (1)
  • loadConfig (51-165)
🔇 Additional comments (5)
tests/config.test.ts (5)

7-11: LGTM! Error message correctly references both config filenames.

The suite description and error test properly reflect the new behavior where both .vectorlint.ini (primary) and vectorlint.ini (legacy fallback) are mentioned when neither file is found.


13-23: LGTM! Hidden file loading test correctly implemented.

The test properly verifies that .vectorlint.ini is loaded when present, matching the documented primary behavior.


25-35: ✅ Previous critical issue resolved! Fallback test now correct.

The fallback test now correctly writes vectorlint.ini (legacy filename) on line 32, properly testing the backward compatibility scenario. This fixes the critical bug identified in the previous review where .vectorlint.ini was mistakenly written instead.


37-53: LGTM! Precedence test correctly validates hidden file priority.

The test properly verifies that .vectorlint.ini takes precedence over vectorlint.ini when both files exist, using distinct RulesPath values to unambiguously confirm which file was loaded.


55-78: LGTM! Parsing test correctly updated to use hidden config file.

The test now writes to .vectorlint.ini (line 68) while maintaining the same validation logic for parsing and trimming configuration values.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
tests/config.test.ts (2)

33-33: Consider using the LEGACY_CONFIG_FILENAME constant for consistency.

Line 33 hardcodes 'vectorlint.ini' while the precedence test (line 51) correctly uses LEGACY_CONFIG_FILENAME. Using the constant here would improve maintainability and ensure consistency across the test suite.

🔎 Proposed refactor
-    writeFileSync(path.join(cwd, 'vectorlint.ini'), ini);
+    writeFileSync(path.join(cwd, LEGACY_CONFIG_FILENAME), ini);

81-99: Consider simplifying the verbose comment block.

The extensive commentary (lines 81-94) discusses extension validation and test evolution, but the actual test validates old ScanPaths syntax rejection. While the context may be helpful, the comment could be simplified or removed since the test itself is clear and self-documenting.

The updates to use DEFAULT_CONFIG_FILENAME (lines 69, 97) are good for consistency.

🔎 Suggested simplification
-  it('rejects unsupported extensions in ScanPaths', () => {
-    // Note: Validation logic moved to schema or file resolver, but config loader might not enforce extensions strictly anymore 
-    // unless we added that validation back. 
-    // The previous implementation had explicit extension check. 
-    // The new implementation relies on file resolver to filter extensions.
-    // So this test might be testing behavior that no longer exists in loadConfig.
-    // However, let's check if we should still test for invalid patterns if we want to enforce it.
-    // For now, I will update it to expect the new syntax error if we pass the old syntax, 
-    // OR if we want to test extension validation, we should do it on the file resolver level.
-    // But the original test was about "rejects unsupported extensions".
-    // Since we removed the explicit loop checking extensions in config-loader.ts, this test is now obsolete or needs to check something else.
-    // I will remove this test or change it to verify that valid config loads.
-
-    // Actually, let's test that it throws if we use the old syntax, which is what the previous failure showed.
+  it('rejects old ScanPaths syntax', () => {
     const cwd = mkdtempSync(path.join(tmpdir(), 'vlint-'));
     const ini = `RulesPath=prompts\nScanPaths=[src/**/*.js]\n`;
     writeFileSync(path.join(cwd, DEFAULT_CONFIG_FILENAME), ini);
     expect(() => loadConfig(cwd)).toThrow(/Old ScanPaths=\[\.\.\.\] syntax no longer supported/i);
   });
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16c3967 and e503028.

📒 Files selected for processing (5)
  • src/cli/commands.ts (2 hunks)
  • tests/config-loader-integration.test.ts (6 hunks)
  • tests/config.test.ts (3 hunks)
  • tests/eval-pack-e2e.test.ts (3 hunks)
  • tests/scanpaths-refactor.test.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/scanpaths-refactor.test.ts
  • tests/eval-pack-e2e.test.ts
  • tests/config-loader-integration.test.ts
  • src/cli/commands.ts
🧰 Additional context used
🧬 Code graph analysis (1)
tests/config.test.ts (2)
src/boundaries/config-loader.ts (1)
  • loadConfig (51-165)
src/config/constants.ts (2)
  • DEFAULT_CONFIG_FILENAME (6-6)
  • LEGACY_CONFIG_FILENAME (5-5)
🔇 Additional comments (2)
tests/config.test.ts (2)

6-12: LGTM! Good use of constants and comprehensive error checking.

The import of configuration filename constants promotes maintainability, and the updated error expectation correctly validates that both filename options are mentioned in the error message when neither config file exists.


14-54: Excellent test coverage for configuration file resolution.

The three new tests comprehensively verify the documented behavior:

  • Hidden file loading (lines 14-24)
  • Fallback to legacy file (lines 26-36) — correctly fixed per past review
  • Precedence when both exist (lines 38-54)

Each test is properly isolated with temp directories and validates the expected behavior.

Copy link
Collaborator

@hurshore hurshore left a comment

Choose a reason for hiding this comment

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

Can you apply the suggestion here about removing the AI's thought proces, and making the comment more concise?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 584bb50 and 84ffbef.

📒 Files selected for processing (3)
  • CONFIGURATION.md
  • README.md
  • src/boundaries/config-loader.ts
🧰 Additional context used
📓 Path-based instructions (1)
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Use TypeScript ESM with explicit imports and narrow types
Use 2-space indentation; avoid trailing whitespace
Use strict TypeScript with no any types; use unknown + schema validation for external data
Use custom error types with proper inheritance; catch blocks should use unknown type

Files:

  • src/boundaries/config-loader.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Copy `vectorlint.example.ini` → `vectorlint.ini`; set `RulesPath`, `ScanPaths`, `Concurrency`
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to vectorlint.ini : Use `[glob/pattern]` sections in `vectorlint.ini` to specify which packs run on which files
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Copy `vectorlint.example.ini` → `vectorlint.ini`; set `RulesPath`, `ScanPaths`, `Concurrency`

Applied to files:

  • src/boundaries/config-loader.ts
  • CONFIGURATION.md
  • README.md
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to vectorlint.ini : Use `[glob/pattern]` sections in `vectorlint.ini` to specify which packs run on which files

Applied to files:

  • CONFIGURATION.md
  • README.md
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to .env : Copy `.env.example` → `.env` for provider credentials (OpenAI, Anthropic, Azure, Gemini, Perplexity)

Applied to files:

  • CONFIGURATION.md
  • README.md
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Add providers by implementing `LLMProvider` or `SearchProvider` interfaces; add evaluators via registry pattern

Applied to files:

  • CONFIGURATION.md
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to evals/**/*.md : All rules must be organized into subdirectories (packs) within `RulesPath`

Applied to files:

  • CONFIGURATION.md
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Pack names are arbitrary; recommended practice is to use company names (e.g., Acme, TechCorp, Stripe) to indicate which style guide the rules implement

Applied to files:

  • CONFIGURATION.md
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to evals/**/*.md : The system recursively loads all `.md` files from within each pack

Applied to files:

  • CONFIGURATION.md
🪛 LanguageTool
CONFIGURATION.md

[uncategorized] ~119-~119: The official name of this software platform is spelled with a capital “H”.
Context: ...cks: Acme and TechCorp. - Files in .github/rules/Acme/ become rules in the Acme...

(GITHUB)

README.md

[grammar] ~46-~46: Use a hyphen to join words.
Context: ...content using error density and a rubric based system, enabling you to measure qu...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (4)
CONFIGURATION.md (1)

3-3: LGTM! Documentation correctly updated to the new default filename.

The configuration guide has been properly updated to reference .vectorlint.ini as the primary configuration file throughout all examples and explanations. The changes maintain consistency and clarity.

Also applies to: 7-7, 12-12, 55-59, 68-80, 97-99, 114-114, 119-120, 130-135, 165-167

src/boundaries/config-loader.ts (3)

31-53: LGTM! Config path resolution implements correct precedence.

The resolveConfigPath function properly implements the fallback logic:

  1. Explicit configPath takes precedence
  2. Hidden .vectorlint.ini (DEFAULT_CONFIG_FILENAME) checked first
  3. Legacy vectorlint.ini (LEGACY_CONFIG_FILENAME) as fallback
  4. Clear error when neither exists

The implementation correctly handles all cases and aligns with the PR objectives for backward compatibility.


55-62: LGTM! Function integration is clean and correct.

The loadConfig function has been properly updated to delegate path resolution to resolveConfigPath, improving separation of concerns. The JSDoc has been updated to be generic rather than filename-specific, which is appropriate given the dual-filename support.


114-116: Clear deprecation message for old ScanPaths syntax.

The error message appropriately informs users about the syntax change and provides guidance on the replacement approach.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/config.test.ts (1)

13-13: Consider adding cleanup for temporary directories.

Each test creates a temp directory but doesn't explicitly clean it up. While the OS eventually handles this, adding an afterEach hook to remove temp directories would be cleaner.

🔎 Optional improvement
+import { rmSync } from "fs";
+
 describe("Config (.vectorlint.ini)", () => {
+  const tempDirs: string[] = [];
+
+  afterEach(() => {
+    tempDirs.forEach(dir => rmSync(dir, { recursive: true, force: true }));
+    tempDirs.length = 0;
+  });
+
   it("errors when config file is missing", () => {
-    const cwd = mkdtempSync(path.join(tmpdir(), "vlint-"));
+    const cwd = mkdtempSync(path.join(tmpdir(), "vlint-"));
+    tempDirs.push(cwd);
     expect(() => loadConfig(cwd)).toThrow();
   });
   // Apply similar pattern to other tests

Also applies to: 18-18, 30-30, 42-42, 60-60, 85-85

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 84ffbef and 6c21da3.

📒 Files selected for processing (2)
  • README.md
  • tests/config.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
🧰 Additional context used
📓 Path-based instructions (1)
tests/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

tests/**/*.test.ts: Use Vitest for testing framework; locate tests under tests/ with *.test.ts naming
Use dependency injection in tests: mock providers and do not hit network in unit tests

Files:

  • tests/config.test.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Copy `vectorlint.example.ini` → `vectorlint.ini`; set `RulesPath`, `ScanPaths`, `Concurrency`
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to vectorlint.ini : Use `[glob/pattern]` sections in `vectorlint.ini` to specify which packs run on which files
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to tests/**/*.test.ts : Use Vitest for testing framework; locate tests under `tests/` with `*.test.ts` naming

Applied to files:

  • tests/config.test.ts
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Copy `vectorlint.example.ini` → `vectorlint.ini`; set `RulesPath`, `ScanPaths`, `Concurrency`

Applied to files:

  • tests/config.test.ts
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to vectorlint.ini : Use `[glob/pattern]` sections in `vectorlint.ini` to specify which packs run on which files

Applied to files:

  • tests/config.test.ts
📚 Learning: 2025-12-27T17:28:16.346Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T17:28:16.346Z
Learning: Applies to evals/**/*.md : All rules must be organized into subdirectories (packs) within `RulesPath`

Applied to files:

  • tests/config.test.ts
🧬 Code graph analysis (1)
tests/config.test.ts (2)
src/boundaries/config-loader.ts (1)
  • loadConfig (58-185)
src/config/constants.ts (2)
  • DEFAULT_CONFIG_FILENAME (6-6)
  • LEGACY_CONFIG_FILENAME (5-5)
🔇 Additional comments (1)
tests/config.test.ts (1)

1-91: Excellent test coverage for the hidden config file feature.

The test suite comprehensively covers all documented behaviors:

  • Missing config error handling
  • Hidden file loading (.vectorlint.ini)
  • Legacy fallback (vectorlint.ini)
  • Precedence when both exist
  • Parsing and validation

The constants are used consistently throughout, and each test is properly isolated. The previous review concerns have been addressed (line 36 now uses LEGACY_CONFIG_FILENAME).

@hurshore hurshore self-requested a review December 28, 2025 19:42
@oshorefueled oshorefueled merged commit e392d71 into main Dec 28, 2025
3 checks passed
oshorefueled pushed a commit that referenced this pull request Mar 2, 2026
* feat(config): add support for  .vectorlint.ini configuration file

* test(config): add comprehensive tests for .vectorlint.ini precedence

* docs: update configuration file naming references

- Update CONFIGURATION.md to reference `.vectorlint.ini` instead of `vectorlint.ini`
- Update README.md quick start guide to use `.vectorlint.ini` filename
- Correct configuration file example comments to reflect actual filename
- Ensure consistent naming convention across all documentation

* Update vectorlint.ini to .vectorlint.ini in codebase

* fix(tests): use legacy filename in config fallback test

* Update .vectorlint.ini to import defined constant

* Update config tests

* docs: update config filename to .vectorlint.ini

* test: simplify missing config test to avoid brittle message checks

---------

Co-authored-by: Jahtofunmi Osho <oshotofunmi@gmail.com>
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