Skip to content

chore: remove toml and json parser#8

Open
steveiliop56 wants to merge 1 commit intomainfrom
chore/remove-toml-json
Open

chore: remove toml and json parser#8
steveiliop56 wants to merge 1 commit intomainfrom
chore/remove-toml-json

Conversation

@steveiliop56
Copy link
Copy Markdown
Member

@steveiliop56 steveiliop56 commented Apr 28, 2026

Summary by CodeRabbit

  • Breaking Changes
    • Configuration file support has been updated. Only YAML files (.yml and .yaml extensions) are now supported. Previously supported TOML and JSON configuration formats are no longer accepted. Using these formats will result in an "unsupported file extension" error.

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Apr 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

This pull request removes TOML support from the codebase, consolidating file configuration parsing to YAML only. Changes include removing TOML dependency, deleting TOML fixture files, refactoring file decoding logic to reject non-YAML extensions, and updating tests and fixtures accordingly.

Changes

Cohort / File(s) Summary
CLI Configuration Migration
cli/commands_test.go, cli/fixtures/config.toml, cli/fixtures/config.yml
Test fixture references updated from TOML to YAML; original TOML config deleted and replaced with YAML equivalent.
File Decoding Implementation
file/file.go, file/file_node.go
TOML parsing support removed; extensions now limited to .yml and .yaml via supportedExtensions list; all decoding uses yaml.Unmarshal.
Test Suite Refactoring
file/file_node_test.go, file/file_test.go
TOML and JSON parsing tests removed; negative test cases updated to use YAML fixtures; test coverage reduced to YAML-only scenarios.
Test Fixtures
file/fixtures/no_conf.toml, file/fixtures/no_conf.yml, file/fixtures/sample.json, file/fixtures/sample.toml
TOML and JSON fixture files deleted; YAML fixture introduced with equivalent configuration structure.
Dependency Cleanup
go.mod
Removed github.com/BurntSushi/toml dependency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing TOML and JSON parser support while retaining only YAML parsing across the codebase.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@file/file_node.go`:
- Around line 23-33: The extension gate in file_node.go uses supportedExtensions
and slices.Contains to reject unsupported files, but cli/loader_file.go still
tries TOML first which causes premature failure; either remove "toml" from the
loader's candidate search order in cli/loader_file.go so it no longer probes
TOML before yaml/yml, or change the loader's candidate loop to check the
extension against supportedExtensions (or call the same validation used in the
FileNode code) and skip unsupported candidates (continue) instead of returning
an error—update the loader logic that iterates candidates to consult
supportedExtensions/slices.Contains before attempting to load.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b4c18a1-7ecd-4f0b-a8cc-10ac3acbbc42

📥 Commits

Reviewing files that changed from the base of the PR and between 902cee6 and c2683c7.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (13)
  • cli/commands_test.go
  • cli/fixtures/config.toml
  • cli/fixtures/config.yml
  • file/file.go
  • file/file_node.go
  • file/file_node_test.go
  • file/file_test.go
  • file/fixtures/empty.yml
  • file/fixtures/no_conf.toml
  • file/fixtures/no_conf.yml
  • file/fixtures/sample.json
  • file/fixtures/sample.toml
  • go.mod
💤 Files with no reviewable changes (6)
  • cli/fixtures/config.toml
  • file/fixtures/no_conf.toml
  • go.mod
  • file/fixtures/sample.json
  • file/fixtures/sample.toml
  • file/file_test.go

Comment thread file/file_node.go
Comment on lines +23 to +33
extension := filepath.Ext(filePath)

switch strings.ToLower(filepath.Ext(filePath)) {
case ".toml":
err = toml.Unmarshal(content, &data)
if err != nil {
return nil, err
}

case ".yml", ".yaml", ".json":
err = yaml.Unmarshal(content, data)
if err != nil {
return nil, err
}
if !slices.Contains(supportedExtensions, extension) {

default:
return nil, fmt.Errorf("unsupported file extension: %s", filePath)
}

err = yaml.Unmarshal(content, data)
if err != nil {
return nil, err
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Keep TOML discovery in sync with this extension gate.

cli/loader_file.go still searches toml ahead of yaml/yml, so a config directory with both files will now fail on the TOML hit instead of continuing to the YAML file. Please remove TOML from the search list in the same change set, or have the loader skip unsupported candidates and continue.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@file/file_node.go` around lines 23 - 33, The extension gate in file_node.go
uses supportedExtensions and slices.Contains to reject unsupported files, but
cli/loader_file.go still tries TOML first which causes premature failure; either
remove "toml" from the loader's candidate search order in cli/loader_file.go so
it no longer probes TOML before yaml/yml, or change the loader's candidate loop
to check the extension against supportedExtensions (or call the same validation
used in the FileNode code) and skip unsupported candidates (continue) instead of
returning an error—update the loader logic that iterates candidates to consult
supportedExtensions/slices.Contains before attempting to load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant