Skip to content

Enhance Solidity Code Formatting for code consistency and beautification#306

Open
pankajjagtapp wants to merge 4 commits intomasterfrom
pankaj/feat/enhance-code-formatting
Open

Enhance Solidity Code Formatting for code consistency and beautification#306
pankajjagtapp wants to merge 4 commits intomasterfrom
pankaj/feat/enhance-code-formatting

Conversation

@pankajjagtapp
Copy link
Copy Markdown
Contributor

@pankajjagtapp pankajjagtapp commented Oct 30, 2025

Note

Low Risk
Low risk: changes are limited to Foundry config and a developer script; no Solidity contract logic is modified. Main risk is CI/dev workflow friction if forge fmt settings or the new script assumptions (git/jq/artifacts) don’t match environments.

Overview
Adds Foundry lint configuration and a detailed fmt configuration in foundry.toml to standardize Solidity formatting (e.g., very long line_length, import sorting, numeric underscore style).

Introduces script/verify-forge-fmt-bytecode.sh, which compiles contracts before/after forge fmt, extracts deployed bytecode from artifacts, and fails if formatting results in bytecode differences, saving per-contract comparisons under cache/bytecodeComparison/.

Written by Cursor Bugbot for commit d2aefed. This will update automatically on new commits. Configure here.

@pankajjagtapp pankajjagtapp self-assigned this Oct 30, 2025
@pankajjagtapp pankajjagtapp force-pushed the pankaj/feat/enhance-code-formatting branch from 77a5f3e to 06b611b Compare November 13, 2025 19:36
@seongyun-ko
Copy link
Copy Markdown
Contributor

Let's do this once we merge #301

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

📊 Forge Coverage Report

forge coverage failed; see logs above (tests step is the gate).

Generated by workflow run #618

…nhance bytecode verification script with working tree check
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Fuzz configuration accidentally removed in formatting PR
    • Restored the [fuzz] section with max_shrink_iters = 100 to foundry.toml, which was accidentally deleted during formatting changes.

Create PR

Or push these changes by commenting:

@cursor push b2b671e953
Preview (b2b671e953)
diff --git a/foundry.toml b/foundry.toml
--- a/foundry.toml
+++ b/foundry.toml
@@ -18,6 +18,9 @@
 solc-version = '0.8.27'
 dynamic_test_linking = true
 
+[fuzz]
+max_shrink_iters = 100
+
 ignored_warnings_from = [
     "src/archive/",
     "src/libraries/",

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

"test/"
]

[fuzz]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fuzz configuration accidentally removed in formatting PR

High Severity

The [fuzz] section with max_shrink_iters = 100 was deleted as part of this formatting-only PR. This is unrelated to code formatting and changes fuzz test behavior — without this setting, Foundry uses its default (significantly higher, likely ~5000), which can drastically slow down CI fuzz test runs and alter shrinking behavior. This appears to be an accidental deletion.

Fix in Cursor Fix in Web

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