Skip to content

Refactor src/manifest.rs: Split module into focused submodules (≤400-line limit) #157

@coderabbitai

Description

@coderabbitai

Overview

The src/manifest.rs module currently exceeds the project's ≤400-line limit and needs to be decomposed into focused submodules to reduce complexity and improve code organization.

Proposed Submodule Decomposition

manifest/yaml_diag.rs

  • YamlDiagnostic type and implementation
  • map_yaml_error function
  • to_span utility
  • Error hints and diagnostic helpers

manifest/jinja_helpers.rs

  • env_var function
  • render_* functions (template rendering utilities)
  • eval_expression function
  • Template processing helpers

manifest/glob.rs

  • Glob normalisation utilities
  • Path validation logic
  • Glob pattern processing

Keep in src/manifest.rs

  • Main manifest structure definitions
  • Public API surface
  • Module re-exports and coordination

Benefits

  • Adherence to project's ≤400-line standard
  • Reduced module complexity
  • Improved separation of concerns by functionality
  • Enhanced maintainability and testability
  • Clearer organization of YAML diagnostics, Jinja processing, and glob handling

Context

This refactoring requirement was identified during code review of PR #152.

Reference: #152

Metadata

Metadata

Assignees

Labels

mediumCould be disruptive, but might not happen

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions