Skip to content

fix : config test next test - #116

Closed
Dargon789 wants to merge 72 commits into
masterfrom
main-config-forge
Closed

Dargon789 wants to merge 72 commits into
masterfrom
main-config-forge

Conversation

@Dargon789

@Dargon789 Dargon789 commented Oct 14, 2025 •

Copy link
Copy Markdown
Owner

Motivation

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Summary by Sourcery

Add variant table support to documentation, refine verification provider logic, improve comparison handling, and expand CI/CD and example scaffolding across the repo.

New Features:

  • Add enum variant table rendering in the documentation writer
  • Introduce a Counter example project with Forge scripts, tests, and configuration
  • Implement conversion from Vec to Comments for improved comment filtering

Bug Fixes:

  • Fix verification provider selection to always prefer Sourcify and enforce Etherscan API key requirements
  • Ensure gas estimation output consistently displays ETH and remove outdated token symbol lookup
  • Correct parsing and return semantics for unknown comment tags

Enhancements:

  • Use partial_cmp instead of total_cmp for safe sorting and comparisons
  • Improve error messaging for configuration restriction conflicts
  • Downgrade derive_more dependency for compatibility

CI:

  • Update Nextest workflow to use actions/setup-python v4 and streamline Vyper installation
  • Add GitHub workflows for CodeQL analysis, Jekyll deployment, Foundry CI, Docker image builds, APIsec scans, and CircleCI
  • Add issue templates for bug reports and feature requests

Documentation:

  • Add README documentation for the Counter example project

Tests:

  • Update test-utils redaction patterns for ETH in gas estimation
  • Add remix-testing library and account fixtures for Solidity tests

Dargon789 and others added 30 commits October 12, 2024 01:59
     Locking 35 packages to latest compatible versions
    Updating alloy-dyn-abi v0.8.6 -> v0.8.7
    Updating alloy-json-abi v0.8.6 -> v0.8.7
    Updating alloy-primitives v0.8.6 -> v0.8.7
    Updating alloy-sol-macro v0.8.6 -> v0.8.7
    Updating alloy-sol-macro-expander v0.8.6 -> v0.8.7
    Updating alloy-sol-macro-input v0.8.6 -> v0.8.7
    Updating alloy-sol-type-parser v0.8.6 -> v0.8.7
    Updating alloy-sol-types v0.8.6 -> v0.8.7
    Updating async-compression v0.4.13 -> v0.4.14
    Updating aws-sdk-kms v1.46.0 -> v1.47.0
    Updating aws-sdk-sso v1.45.0 -> v1.46.0
    Updating aws-sdk-ssooidc v1.46.0 -> v1.47.0
    Updating aws-sdk-sts v1.45.0 -> v1.46.0
    Updating aws-smithy-runtime v1.7.1 -> v1.7.2
    Updating cc v1.1.28 -> v1.1.30
    Updating clap v4.5.19 -> v4.5.20
    Updating clap_builder v4.5.19 -> v4.5.20
    Updating clap_complete v4.5.32 -> v4.5.33
    Updating derive_builder v0.20.1 -> v0.20.2
    Updating derive_builder_core v0.20.1 -> v0.20.2
    Updating derive_builder_macro v0.20.1 -> v0.20.2
    Updating js-sys v0.3.70 -> v0.3.72
    Updating lru v0.12.4 -> v0.12.5
    Updating newtype-uuid v1.1.0 -> v1.1.2
    Updating proc-macro2 v1.0.86 -> v1.0.87
    Updating scc v2.2.0 -> v2.2.1
    Updating sdd v3.0.3 -> v3.0.4
    Updating syn-solidity v0.8.6 -> v0.8.7
    Updating wasm-bindgen v0.2.93 -> v0.2.95
    Updating wasm-bindgen-backend v0.2.93 -> v0.2.95
    Updating wasm-bindgen-futures v0.4.43 -> v0.4.45
    Updating wasm-bindgen-macro v0.2.93 -> v0.2.95
    Updating wasm-bindgen-macro-support v0.2.93 -> v0.2.95
    Updating wasm-bindgen-shared v0.2.93 -> v0.2.95
    Updating web-sys v0.3.70 -> v0.3.72
note: pass `--verbose` to see 10 unchanged dependencies behind latest
chore(deps): weekly `cargo update`
Signed-off-by: Legion's  <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: Legion's  <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: Legion's  <64915515+Dargon789@users.noreply.github.com>
feat(forge): allow `--verifier custom` option (foundry-rs#9311)
Dargon789 and others added 15 commits March 11, 2025 08:35
* fix deny.toml, ignore RUSTSEC-2025-0014 (foundry-rs#10052)

* fix deny.toml, ignore RUSTSEC-2025-0014

* roll back allow-git

* update derive_more to 2.0 (foundry-rs#9987)

* chore: fix ci, bump python setup version (foundry-rs#10054)

Bump gh python setup version

* feat(forge): match chain id with token symbol (foundry-rs#10043)

* feat: match chain id with token symbol

* fix: change symbol from matic to pol

* fix: use NameChain instead of manual mapping

* Fix tests, fmt and clippy

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>

* feat(cast): storage add --proxy to manually specify a proxy contract when Etherscan fails to find it (foundry-rs#10033)

* Adding a proxy parameter to the cast storage command, allowing manual selection of a proxy address to retrieve the full storage layout.

* Adding tests for the cast storage proxy optional argument.

* Using if let some else pattern.

* Improved documentation.

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>

* fix(forge): use etherscan verifier if key provided (foundry-rs#10058)

* fix(forge): use etherscan if key provided

* Changes after review: expose is_sourcify and is_etherscan fns

---------

Co-authored-by: gerald <3949379+getong@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: supamongkonR <73258014+supamongkonR@users.noreply.github.com>
Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
Co-authored-by: Cizeon <110527347+Cizeon@users.noreply.github.com>
* feat(forge): allow path in forge selectors upload (foundry-rs#10073)

* feat(forge): allow path in forge selectors upload

* Changes after review: reuse PathOrContractInfo

* feat: add `x86_64-musl` and `aarch64-musl` release targets (foundry-rs#9984)

* feat: add `x86_64` and `aarch64` musl targets

* feat: update nextest matrices

* try with aarch64 targets

* feat: define granular linux targets and restore `aarch64` one

* revert `matrices.py` file

* chore: reenable impersonate test (foundry-rs#10076)

* feat: solc 0.8.29 (foundry-rs#10078)

* feat: solc 0.8.29

* update match

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: Giovanni Napoli <giovanni.napoli@aminagroup.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Bumps the cargo group with 1 update in the / directory: [zip](https://github.com/zip-rs/zip2).


Updates `zip` from 2.2.3 to 2.4.1
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](zip-rs/zip2@v2.2.3...v2.4.1)

---
updated-dependencies:
- dependency-name: zip
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@vercel

vercel Bot commented Oct 14, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
next Ready Ready Preview Comment Oct 14, 2025 0:32am
react Ready Ready Preview Comment Oct 14, 2025 0:32am

@sourcery-ai

sourcery-ai Bot commented Oct 14, 2025 •

Copy link
Copy Markdown

Reviewer's Guide

Refactors the documentation generator to render enum variant tables, streamlines verification provider selection using pattern matching, standardizes floating‐point comparisons with partial_cmp, refines gas simulation output and redactions, enhances parser and error types, updates a dependency version, and adds example project files alongside multiple CI/CD workflows and templates.

Class diagram for BufWriter and new variant table rendering

classDiagram
    class BufWriter {
        +try_write_variant_table(params: EnumDefinition, comments: Comments): fmt::Result
        +try_write_table(...)
        +try_write_events_table(...)
        +write_bold(...)
        +write_piped(...)
        +writeln(...)
    }
    class EnumDefinition {
        +values: Vec<EnumValue>
    }
    class Comments {
        +include_tags(tags: &[CommentTag])
    }
    BufWriter --> EnumDefinition
    BufWriter --> Comments
    EnumDefinition --> "*" EnumValue
    Comments --> CommentTag
Loading

Class diagram for VerificationProviderType refactor

classDiagram
    class VerificationProviderType {
        +client(key: Option<&str>): Result<Box<dyn VerificationProvider>>
    }
    VerificationProviderType <|-- Sourcify
    VerificationProviderType <|-- Etherscan
    VerificationProviderType <|-- OtherProvider
    class VerificationProvider {
        <<interface>>
    }
    class EtherscanVerificationProvider {
        +default()
    }
    VerificationProviderType --> VerificationProvider
    EtherscanVerificationProvider ..|> VerificationProvider
Loading

Class diagram for Comments conversion and filtering

classDiagram
    class Comments {
        +from(Vec<DocCommentTag>)
        +from(Vec<Comment>)
    }
    class DocCommentTag
    class Comment {
        +tag: CommentTag
    }
    Comments --> "*" DocCommentTag
    Comments --> "*" Comment
    Comment --> CommentTag
Loading

Class diagram for Counter example contract

classDiagram
    class Counter {
        +number: uint256
        +setNumber(newNumber: uint256)
        +increment()
    }
Loading

File-Level Changes

Change Details Files
Render enum variant documentation tables
  • Defined table headers and separators for variants
  • Implemented try_write_variant_table in BufWriter
  • Filtered out variant comments in AsDoc and invoked the new table writer
crates/doc/src/writer/buf_writer.rs
crates/doc/src/writer/as_doc.rs
Simplify VerificationProviderType logic
  • Replaced custom is_sourcify/is_etherscan with matches!
  • Adjusted API key presence checks and error messages
crates/verify/src/provider.rs
Use partial_cmp for float comparisons and sorting
  • Replaced total_cmp with partial_cmp.unwrap_or(Equal) in gas snapshot sorting
  • Updated fmt_pct_change to use partial_cmp
  • Applied same change in suggestions sort and contracts min_by
crates/forge/src/cmd/snapshot.rs
crates/cli/src/utils/suggestions.rs
crates/common/src/contracts.rs
Refine gas simulation output and test redactions
  • Removed dynamic token symbol and hardcoded ‘ETH’ in messages
  • Updated redaction regex to expect ‘ETH’ unit
  • Removed token_symbol field from simulation JSON
crates/script/src/simulate.rs
crates/test-utils/src/util.rs
Enhance parser, error types, and dependencies
  • Added From<Vec> for Comments
  • Fixed missing semicolons in comment tag parser
  • Improved error message for RestrictionsError
  • Downgraded derive_more dependency
crates/parser/comment.rs
crates/config/src/compilation.rs
Cargo.toml
Introduce example Counter project and CI workflows
  • Added Counter smart contract, tests, scripts, and foundry.toml
  • Added multiple GitHub Actions, CircleCI, CodeQL, Jekyll, APIsec, and Docker workflows
  • Created issue templates and a README for the sample project
counter/**
.github/workflows/**
.github/ISSUE_TEMPLATE/**

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@snyk-io

snyk-io Bot commented Oct 14, 2025

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new, example Foundry project structure, complete with a sample Solidity contract, tests, deployment script, and a dedicated GitHub Actions CI workflow. Concurrently, it includes several internal refinements across the codebase, such as enhancing Solidity documentation generation to better handle enum variants, improving floating-point comparison reliability in Rust, and streamlining the logic for selecting external verification providers. The changes also add standard issue templates to the repository and adjust a Rust dependency version.

Highlights

  • New Foundry Project Structure: Introduced a new example Foundry project within the counter/ directory, complete with a sample Solidity Counter contract, its tests, and a deployment script. This setup includes necessary submodules for forge-std and openzeppelin-contracts.
  • GitHub Actions CI for Foundry: Added a dedicated GitHub Actions workflow (counter/.github/workflows/test.yml) to automate CI checks for the new Foundry project, including formatting, building, and testing.
  • Solidity Documentation Enhancements: Improved the documentation generation process for Solidity, specifically by adding support for rendering enum variants in a structured table and filtering custom variant tags.
  • Robust Floating-Point Comparisons: Updated several Rust crates (crates/cli, crates/common, crates/forge) to use partial_cmp().unwrap_or(Ordering::Equal) instead of total_cmp for f64 comparisons, enhancing robustness by correctly handling NaN values.
  • Streamlined Verification Provider Logic: Refactored the logic for selecting verification providers (e.g., Sourcify, Etherscan) in crates/verify, simplifying the conditional checks and removing redundant helper functions.
  • Dependency Version Adjustment: Downgraded the derive_more dependency in Cargo.toml from version 2.0 to 1.0.
  • Issue Templates Added: Added standard issue templates for bug reports, feature requests, and a custom template to the .github/ISSUE_TEMPLATE directory.
Ignored Files
  • Ignored by pattern: .github/workflows/** (5)
    • .github/workflows/apisec-scan.yml
    • .github/workflows/codeql.yml
    • .github/workflows/docker-image.yml
    • .github/workflows/jekyll.yml
    • .github/workflows/nextest.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

Blocking issues:

  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)

General comments:

  • Factor out the repeated Custom("variant") tag (and its String allocation) into a static constant to avoid duplication and improve maintainability in the variant table logic.
  • Consolidate the API key presence checks in VerificationProviderType::client (instead of re-inlining key.as_ref().is_some_and/is_none_or everywhere) to reduce duplication and ensure consistent behavior across all branches.
  • The simulation output now hardcodes “ETH” for the estimated amount, which can be misleading on non-ETH chains—consider restoring dynamic token symbol lookup or making the symbol configurable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Factor out the repeated Custom("variant") tag (and its String allocation) into a static constant to avoid duplication and improve maintainability in the variant table logic.
- Consolidate the API key presence checks in VerificationProviderType::client (instead of re-inlining key.as_ref().is_some_and/is_none_or everywhere) to reduce duplication and ensure consistent behavior across all branches.
- The simulation output now hardcodes “ETH” for the estimated amount, which can be misleading on non-ETH chains—consider restoring dynamic token symbol lookup or making the symbol configurable.

## Individual Comments

### Comment 1
<location> `crates/cli/src/utils/suggestions.rs:19-20` </location>
<code_context>
         .map(|pv| (strsim::jaro_winkler(v, pv.as_ref()), pv.as_ref().to_owned()))
         .filter(|(similarity, _)| *similarity > 0.8)
         .collect();
-    candidates.sort_by(|a, b| a.0.total_cmp(&b.0));
+    candidates.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap_or(Ordering::Equal));
     candidates.into_iter().map(|(_, pv)| pv).collect()
 }
</code_context>

<issue_to_address>
**issue:** Switching from total_cmp to partial_cmp may affect ordering in edge cases.

Using unwrap_or(Ordering::Equal) with partial_cmp may hide cases like NaN where values aren't comparable. Please review if this fallback suits your requirements, or consider explicit handling for non-comparable values to prevent silent ordering issues.
</issue_to_address>

### Comment 2
<location> `crates/common/src/contracts.rs:166` </location>
<code_context>
                     None
                 }
             })
-            .min_by(|(score1, _), (score2, _)| score1.total_cmp(score2))
+            .min_by(|(score1, _), (score2, _)| score1.partial_cmp(score2).unwrap_or(std::cmp::Ordering::Equal))
             .map(|(_, data)| data)
     }
</code_context>

<issue_to_address>
**issue (bug_risk):** Using partial_cmp with unwrap_or(Ordering::Equal) may hide non-comparable cases.

Explicitly handle cases where scores are NaN or non-comparable to avoid unexpected results.
</issue_to_address>

### Comment 3
<location> `crates/forge/src/cmd/snapshot.rs:401-403` </location>
<code_context>

 fn fmt_pct_change(change: f64) -> String {
     let change_pct = change * 100.0;
-    match change.total_cmp(&0.0) {
+    match change.partial_cmp(&0.0).unwrap_or(Ordering::Equal) {
         Ordering::Less => format!("{change_pct:.3}%").green().to_string(),
         Ordering::Equal => {
</code_context>

<issue_to_address>
**issue:** Using partial_cmp with unwrap_or(Ordering::Equal) may mask non-comparable floating point values.

NaN values will be treated as equal to zero, which could lead to incorrect results. Explicitly handle NaN or other non-comparable cases to ensure accurate output.
</issue_to_address>

### Comment 4
<location> `crates/doc/src/writer/buf_writer.rs:189` </location>
<code_context>

+    /// Tries to write the variant table to the buffer.
+    /// Doesn't write anything if either params or comments are empty.
+    pub fn try_write_variant_table(
+        &mut self,
+        params: &EnumDefinition,
</code_context>

<issue_to_address>
**issue (complexity):** Consider refactoring variant table writing by generalizing the table helper and implementing a trait for enum definitions.

Consider merging `try_write_variant_table` into your existing `try_write_table` helper by:

1. Generalizing `try_write_table` to accept multiple comment‐tags.
2. Implementing `ParamLike` for `EnumDefinition` so its `.values` get treated like other params.
3. Calling the generalized helper from `try_write_variant_table` with minimal code.

For example:

```rust
// 1. Change signature to take &[CommentTag] instead of a single tag:
pub fn try_write_table<T: ParamLike>(
    &mut self,
    tags: &[CommentTag],
    params: &T,
    comments: &Comments,
    title: &str,
) -> fmt::Result {
    let comments = comments.include_tags(tags);
    if comments.is_empty() {
        return Ok(());
    }

    self.write_bold(title)?;
    self.writeln()?;

    self.write_piped(&T::HEADERS.join("|"))?;
    self.write_piped(&T::SEPARATOR)?;

    for param in params.params() {
        let msg = comments
            .iter()
            .find_map(|c| c.match_first_word(&param.name))
            .unwrap_or_default()
            .replace('\n', " ");
        let row = [
            Markdown::Code(&param.name).as_doc()?,
            msg,
        ];
        self.write_piped(&row.join("|"))?;
    }
    self.writeln()
}
```

```rust
// 2. Implement ParamLike for EnumDefinition:
impl ParamLike for EnumDefinition {
    const HEADERS: &'static [&'static str] = &["Name", "Description"];
    const SEPARATOR: &'static str = "|---|---|";

    fn params(&self) -> Vec<crate::writer::Parameter> {
        self.values.iter().map(|v_opt| {
            let name = v_opt.as_ref().map(|v| v.name.clone()).unwrap_or_default();
            crate::writer::Parameter {
                name,
                // other fields unused by this table
                ..Default::default()
            }
        }).collect()
    }
}
```

```rust
// 3. Shrink your variant writer to a one-liner:
pub fn try_write_variant_table(
    &mut self,
    params: &EnumDefinition,
    comments: &Comments,
) -> fmt::Result {
    self.try_write_table(
        &[CommentTag::Param, CommentTag::Custom("variant".into())],
        params,
        comments,
        "Variants",
    )
}
```

This keeps all behavior intact but centralizes table logic.
</issue_to_address>

### Comment 5
<location> `counter/.github/workflows/test.yml:24` </location>
<code_context>
        uses: foundry-rs/foundry-toolchain@v1
</code_context>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread crates/cli/src/utils/suggestions.rs
Comment thread crates/common/src/contracts.rs
Comment thread crates/forge/src/cmd/snapshot.rs
Comment thread crates/doc/src/writer/buf_writer.rs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a wide range of improvements and additions. A new counter example project provides excellent scaffolding for new users. The documentation generation is enhanced to support enum variants, and several parts of the Rust codebase are refactored for improved safety and clarity, such as using partial_cmp for float comparisons. My review includes suggestions for improving the new Solidity example contracts by adhering to licensing best practices and removing redundant code. I've also pointed out a small efficiency improvement in the documentation writer.

Comment thread counter/script/Counter.s.sol
Comment thread counter/script/Counter.s.sol
Comment thread counter/src/Counter.sol
Comment thread counter/test/Counter.t.sol
Comment thread counter/test/Counter.t.sol
Comment thread crates/doc/src/writer/buf_writer.rs Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@vercel
vercel Bot temporarily deployed to Preview – react October 14, 2025 12:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – next October 14, 2025 12:32 Inactive
@Dargon789
Dargon789 enabled auto-merge (squash) October 14, 2025 13:34

@Dargon789 Dargon789 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

fix : config test next test#116

@Dargon789 Dargon789 self-assigned this Oct 14, 2025
@Dargon789 Dargon789 closed this Oct 14, 2025
auto-merge was automatically disabled October 14, 2025 13:47

Pull request was closed

@Dargon789
Dargon789 deleted the main-config-forge branch October 14, 2025 20:05

This branch was previously deployed

2 inactive deployments
Preview – react — 9c9343ad Deployed Oct 14, 2025 by vercel[bot]
Preview – next — 9c9343ad Deployed Oct 14, 2025 by vercel[bot]
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