Skip to content

Implement rux fmt --manifest (TOML Formatter)#139

Merged
spatulari merged 2 commits into
rux-lang:devfrom
BibhabenduMukherjee:feat/fmt-manifest
Jun 14, 2026
Merged

Implement rux fmt --manifest (TOML Formatter)#139
spatulari merged 2 commits into
rux-lang:devfrom
BibhabenduMukherjee:feat/fmt-manifest

Conversation

@BibhabenduMukherjee

Copy link
Copy Markdown

Feature: Implement rux fmt --manifest (TOML Formatter)

This Pull Request implements the package manifest formatting (rux fmt --manifest) feature, resolving the existing placeholder in the compiler CLI.

Description

The rux fmt --manifest command allows developers to format and standardize their Rux.toml files, ensuring clean formatting, indentation, and key-value alignment. It also supports dry-run checking (--check) to validate if a manifest conforms to standard formatting without writing changes.

Key Features

  1. Manifest Formatting: Overwrites Rux.toml with a clean, standardized format (spacing, indentation, section ordering).
  2. Formatting Check (--check):
    • Returns exit code 0 if the manifest is already formatted.
    • Returns exit code 1 and prints an error message if formatting discrepancies are found (ideal for CI/CD pipelines).
  3. No-Op Safety: Does not perform disk writes if the file is already formatted correctly.

Changes Made

  • UtilityCmd.cpp: Implemented the manifestOnly branch in the Cli::RunFmt command to handle manifest loading, temporary serialization comparison, formatting, and verification.

Verification & Testing

1. Dry Run Verification (--check on unformatted manifest)

$ rux fmt --manifest --check
error: manifest '/path/to/hello_rux/Rux.toml' is not formatted
$ echo $?
1

@spatulari spatulari merged commit 1ab22c8 into rux-lang:dev Jun 14, 2026
9 checks passed
@BibhabenduMukherjee BibhabenduMukherjee deleted the feat/fmt-manifest branch June 15, 2026 02:28
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