Skip to content

devex(contract): fix by formatting all contracts and adding formatting checks#588

Open
Hillzo wants to merge 1 commit into
Gatheraa:mainfrom
Hillzo:feature/cargo-fmt-all-514
Open

devex(contract): fix by formatting all contracts and adding formatting checks#588
Hillzo wants to merge 1 commit into
Gatheraa:mainfrom
Hillzo:feature/cargo-fmt-all-514

Conversation

@Hillzo

@Hillzo Hillzo commented Jun 29, 2026

Copy link
Copy Markdown

closes #514

PR Description

This PR addresses formatting inconsistencies in the contracts workspace under issue #514. Previously, the contracts were formatted inconsistently (e.g., indents in function signatures and multiline comments), which caused the cargo formatting check in the CI pipeline to fail. However, because the CI check was allowed to continue on failure, it did not block PR builds.

To fix this:

  1. All Rust files under the contract/ workspace have been formatted.
  2. The GitHub action configuration has been modified to fail the build if any formatting check fails.
  3. A local git pre-commit hook is provided to run formatting checks before commits are made.

These changes prevent unformatted code from reaching the remote repository and wasting CI resources.

Changes Made

Testing

  • Verified that formatting is clean by running the check command inside the contract directory:
    cargo fmt --all -- --check
    Result: Command exited successfully with code 0 (no diff).
  • Verified the local pre-commit hook by executing the script directly:
    ./.git/hooks/pre-commit
    Result: Exited with code 0.

@Hillzo

Hillzo commented Jun 29, 2026

Copy link
Copy Markdown
Author

please kindly merge

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.

[contract][devex] Run cargo fmt on all contracts

1 participant