Skip to content

Conversation

Teebor-Choka
Copy link
Contributor

This pull request includes changes across multiple files to improve code organization and functionality. The most important updates involve adding missing #![allow(clippy::...] attributes, updating file exclusions in flake.nix, and enhancing test imports for better modularity.

Code organization and linting:

  • chain/types/src/utils.rs: Re-added #![allow(clippy::too_many_arguments)] attribute to suppress clippy warnings for functions with numerous arguments.
  • hopli/src/methods.rs: Re-added #![allow(clippy::too_many_arguments)] attribute for methods interacting with Safe instance and other contracts.
  • db/entity/src/lib.rs: Re-added #![allow(clippy::all)] attribute to suppress clippy warnings for SeaORM-generated bindings.
  • ethereum/bindings/src/lib.rs: Re-added #![allow(clippy::all)] attribute for abigen-generated bindings.

File exclusions:

  • flake.nix: Added exclusions for specific directories and files (vendor/*, ethereum/contracts/*, ethereum/bindings/src/codegen*, .gcloudignore) to streamline tooling configurations.

Test enhancements:

@Teebor-Choka Teebor-Choka added this to the 3.0.0 milestone Jul 1, 2025
@Teebor-Choka Teebor-Choka requested review from ausias-armesto and a team July 1, 2025 21:58
@Teebor-Choka Teebor-Choka self-assigned this Jul 1, 2025
Copy link
Contributor

coderabbitai bot commented Jul 1, 2025

📝 Walkthrough

Walkthrough

This update primarily relocates Clippy lint suppression attributes in several Rust source files to immediately follow module-level documentation comments. It also introduces an excludes attribute to the pre-commit-check configuration in flake.nix, modifies the pre-commit invocation in the GitHub workflow, adds a module import within a test module for improved scope access, and updates a shell script shebang. No logic or exported entities are modified.

Changes

File(s) Change Summary
chain/types/src/utils.rs,
hopli/src/methods.rs
Moved #![allow(clippy::too_many_arguments)] attribute below documentation comments.
db/entity/src/lib.rs,
ethereum/bindings/src/lib.rs
Moved #![allow(clippy::all)] attribute below documentation comments.
flake.nix Updated pre-commit input URL; added excludes attribute to pre-commit-check configuration.
.github/workflows/checks-pre-commit.yaml Changed pre-commit check step from nix develop + command to nix build with target .#pre-commit-check.
transport/network/src/network.rs Added use super::*; import inside the tests module for broader scope access.
deploy/nfpm/package-pre-uninstall.sh Changed shebang from #!/bin/sh to #!/usr/bin/env sh.

Possibly related PRs

Suggested labels

testing

Suggested reviewers

  • Teebor-Choka

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b2a5d0 and 3ff0934.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .github/workflows/checks-pre-commit.yaml (1 hunks)
  • deploy/nfpm/package-pre-uninstall.sh (1 hunks)
  • flake.nix (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • deploy/nfpm/package-pre-uninstall.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • flake.nix
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: mjadach-iv
PR: hoprnet/hoprnet#6663
File: deploy/compose/.env.sample:57-57
Timestamp: 2024-11-21T13:58:22.345Z
Learning: In code reviews for this project, focus comments on the changes made in the PR, and avoid discussing unrelated code.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6630
File: crypto/packet/src/por.rs:84-84
Timestamp: 2024-11-13T17:56:37.536Z
Learning: In PR #6630, the changes include the removal of ticket validation from the last hop and fixes for Index Offset handling as specified in the PR objectives.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6545
File: transport/p2p/src/swarm.rs:491-494
Timestamp: 2024-10-11T10:43:34.869Z
Learning: When reviewing revert pull requests in the `hoprnet/hoprnet` repository, avoid making code recommendations or suggestions.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:34-43
Timestamp: 2025-06-30T08:33:20.991Z
Learning: In the hoprnet repository, the maintainer ausias-armesto prefers to add commit types to the semantic PR validation workflow incrementally as needed, rather than preemptively adding all possible types. This conservative approach keeps the workflow configuration lean.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6795
File: Cargo.toml:62-64
Timestamp: 2025-01-22T09:55:51.820Z
Learning: The axum WebSocket message handling changes for version 0.8.2 (switching from Vec<u8> to Bytes for binary messages) are covered by end-to-end tests in the hoprnet project.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#7231
File: flake.nix:599-608
Timestamp: 2025-06-11T13:34:45.385Z
Learning: The repository intentionally relies on Commitizen’s default configuration; absence of a `.cz.*` file or `[tool.commitizen]` section is expected and should not be flagged in future reviews.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-07-28T07:26:06.634Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
.github/workflows/checks-pre-commit.yaml (5)
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.718Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: Lint / Lint
  • GitHub Check: Audit / Audit
  • GitHub Check: Pre-commit / Pre-commit
  • GitHub Check: Zizmor / Zizmor
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust
  • GitHub Check: Build Candidate Binaries (hopli)
  • GitHub Check: Build Candidate Binaries (hoprd)
  • GitHub Check: tests-smart-contracts
  • GitHub Check: tests-unit
  • GitHub Check: tests-unit-nightly
🔇 Additional comments (1)
.github/workflows/checks-pre-commit.yaml (1)

49-51: Pre-commit execution via flake output looks solid

Switching to nix build -L .#pre-commit-check delegates hook logic to the flake, giving deterministic builds and letting the job fail fast if any hook fails. Nice simplification.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Teebor-Choka Teebor-Choka marked this pull request as ready for review July 1, 2025 21:58
@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 21:58
@Teebor-Choka Teebor-Choka enabled auto-merge (squash) July 1, 2025 21:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR restores missing Clippy allow attributes, updates tooling exclusions, and refines test imports to satisfy pre-commit checks.

  • Re-adds #![allow(clippy::...)] attributes across several modules for generated or complex code.
  • Adds file and directory exclusions in flake.nix to streamline linting and builds.
  • Introduces use super::* in a test module to simplify access to parent items.

Reviewed Changes

Copilot reviewed 6 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
transport/network/src/network.rs Added use super::* to simplify test module imports
hopli/src/methods.rs Re-added Clippy allow attribute for functions with many args
flake.nix Added excludes entries for vendor, contracts, codegen, etc.
ethereum/bindings/src/lib.rs Re-added Clippy allow attribute for abigen-generated code
db/entity/src/lib.rs Re-added Clippy allow attribute for SeaORM bindings
chain/types/src/utils.rs Re-added Clippy allow attribute for test utility functions

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
db/entity/src/lib.rs (1)

3-3: Consider narrowing the Clippy suppression scope

#![allow(clippy::all)] turns off every Clippy check for this crate. While convenient for generated code, it may also hide issues in hand-written modules that live next to the generated ones (conversions, errors, etc.).
If the intention is to silence warnings only for the generated codegen sub-module, a more targeted approach keeps the rest of the crate lint-clean:

-#![allow(clippy::all)]
+#![deny(clippy::all)]          // keep strict linting by default
+
+mod codegen {
+    #![allow(clippy::all)]     // relax only for generated code
+    #[cfg_attr(rustfmt, rustfmt_skip)]
+    pub(super) mod generated;  // or `pub use super::generated::*` if re-export is needed
+}

This preserves the original behaviour for generated artifacts while retaining Clippy’s safety net elsewhere.

ethereum/bindings/src/lib.rs (1)

3-3: Limit Clippy suppression to generated bindings

As with the database entities, disabling every Clippy lint (clippy::all) across the whole crate can hide issues in any non-generated additions that might appear later. Prefer scoping the allowance to the codegen module only:

-#![allow(clippy::all)]
+#![deny(clippy::all)]
+
+mod codegen {
+    #![allow(clippy::all)]
+    #[cfg_attr(rustfmt, rustfmt_skip)]
+    pub(super) mod generated;
+}

This keeps generated abigen! output warning-free while protecting the rest of the crate.

hopli/src/methods.rs (1)

7-9: Prefer struct/grouped-param refactor over reinstating #![allow(clippy::too_many_arguments)]

Re-enabling the global lint suppression unblocks CI but quietly accepts 10-parameter APIs that are already hard to reason about and nearly impossible to mock.
Consider encapsulating related parameters into domain structs (e.g. DeploymentContext, MultisendConfig) and converting frequently paired scalars into small value objects. This reduces call-site noise, improves testability, and lets you drop the lint allowance again.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9070827 and 4b2a5d0.

📒 Files selected for processing (6)
  • chain/types/src/utils.rs (1 hunks)
  • db/entity/src/lib.rs (1 hunks)
  • ethereum/bindings/src/lib.rs (1 hunks)
  • flake.nix (1 hunks)
  • hopli/src/methods.rs (1 hunks)
  • transport/network/src/network.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: mjadach-iv
PR: hoprnet/hoprnet#6663
File: deploy/compose/.env.sample:57-57
Timestamp: 2024-11-21T13:58:22.345Z
Learning: In code reviews for this project, focus comments on the changes made in the PR, and avoid discussing unrelated code.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6630
File: crypto/packet/src/por.rs:84-84
Timestamp: 2024-11-13T17:56:37.536Z
Learning: In PR #6630, the changes include the removal of ticket validation from the last hop and fixes for Index Offset handling as specified in the PR objectives.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6545
File: transport/p2p/src/swarm.rs:491-494
Timestamp: 2024-10-11T10:43:34.869Z
Learning: When reviewing revert pull requests in the `hoprnet/hoprnet` repository, avoid making code recommendations or suggestions.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:34-43
Timestamp: 2025-06-30T08:33:20.974Z
Learning: In the hoprnet repository, the maintainer ausias-armesto prefers to add commit types to the semantic PR validation workflow incrementally as needed, rather than preemptively adding all possible types. This conservative approach keeps the workflow configuration lean.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6795
File: Cargo.toml:62-64
Timestamp: 2025-01-22T09:55:51.820Z
Learning: The axum WebSocket message handling changes for version 0.8.2 (switching from Vec<u8> to Bytes for binary messages) are covered by end-to-end tests in the hoprnet project.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#7231
File: flake.nix:599-608
Timestamp: 2025-06-11T13:34:45.385Z
Learning: The repository intentionally relies on Commitizen’s default configuration; absence of a `.cz.*` file or `[tool.commitizen]` section is expected and should not be flagged in future reviews.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-07-28T07:26:06.634Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
db/entity/src/lib.rs (16)
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: hopr/hopr-lib/src/lib.rs:564-564
Timestamp: 2024-10-21T15:15:11.701Z
Learning: In `hopr/hopr-lib/src/lib.rs`, when adding configuration options like `fast_sync` to `IndexerConfig`, inline code comments are not necessary if the feature is documented elsewhere.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6580
File: hoprd/rest-api/src/lib.rs:2529-2530
Timestamp: 2024-10-30T11:46:41.005Z
Learning: In `hoprd/rest-api/src/lib.rs`, avoid logging connected peers to prevent potential data exposure. Remove unnecessary logging statements that might reveal sensitive information.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-09-27T08:49:03.928Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: jeandemeusy
PR: hoprnet/hoprnet#6527
File: hoprd/db/api/src/db.rs:8-8
Timestamp: 2024-10-04T09:45:55.226Z
Learning: When importing `LevelFilter` in Rust files within the database modules (e.g., `hoprd/db/api/src/db.rs`), it is acceptable to use `use tracing::log::LevelFilter;`, consistent with its usage in `db/sql/src`.
Learnt from: jeandemeusy
PR: hoprnet/hoprnet#6527
File: hoprd/db/api/src/db.rs:8-8
Timestamp: 2024-10-09T06:16:18.170Z
Learning: When importing `LevelFilter` in Rust files within the database modules (e.g., `hoprd/db/api/src/db.rs`), it is acceptable to use `use tracing::log::LevelFilter;`, consistent with its usage in `db/sql/src`.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6570
File: crypto/packet/src/packet.rs:31-31
Timestamp: 2024-10-22T09:59:33.942Z
Learning: In `crypto/packet/src/packet.rs`, the `PADDING_TAG` constant remains private, so suggestions about its documentation should consider its visibility.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6508
File: rustfmt.toml:6-6
Timestamp: 2024-09-25T14:16:43.307Z
Learning: The directory `ethereum/bindings/src/codegen` is generated and may not exist in the project structure but should still be included in the `ignore` directive in `rustfmt.toml` to prevent formatting of generated code.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6508
File: rustfmt.toml:6-6
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The directory `ethereum/bindings/src/codegen` is generated and may not exist in the project structure but should still be included in the `ignore` directive in `rustfmt.toml` to prevent formatting of generated code.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: chain/rpc/src/errors.rs:44-45
Timestamp: 2024-10-29T15:30:41.405Z
Learning: In `chain/rpc/src/errors.rs`, error variants in the `RpcError` enum are not documented separately.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6932
File: common/internal-types/src/protocol.rs:294-295
Timestamp: 2025-04-22T12:03:45.957Z
Learning: In the hoprnet codebase, `std::mem::size_of` is imported through one of the prelude modules (likely `hopr_primitive_types::prelude::*`), so explicit imports are not needed when using it.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: chain/api/Cargo.toml:50-53
Timestamp: 2024-11-01T15:26:53.058Z
Learning: In `chain/api/Cargo.toml`, it's acceptable to declare the same dependency `hopr-db-sql` in both `[dependencies]` and `[dev-dependencies]` with different features, especially when additional features are only needed for tests.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6345
File: hopr-socks/hopr-socks-server/Cargo.toml:20-20
Timestamp: 2024-06-21T20:51:35.871Z
Learning: All code and packages in the `hoprnet` project should use the workspace level dependency of `reqwest`.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6313
File: hopr/hopr-lib/src/lib.rs:0-0
Timestamp: 2024-07-28T07:26:06.634Z
Learning: The types `IndexerTransportEvent`, `Network`, `PeerEligibility`, and `PeerOrigin` in the `hopr/hopr-lib/src/lib.rs` file are internal to the transport mechanism and do not require public documentation.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6511
File: crypto/packet/src/validation.rs:43-48
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The function `f64_approx_eq` is imported from `hopr-primitive-types`.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6511
File: crypto/packet/src/validation.rs:43-48
Timestamp: 2024-09-28T21:07:53.777Z
Learning: The function `f64_approx_eq` is imported from `hopr-primitive-types`.
chain/types/src/utils.rs (13)
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-09-27T08:49:03.928Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: hopr/hopr-lib/src/lib.rs:564-564
Timestamp: 2024-10-21T15:15:11.701Z
Learning: In `hopr/hopr-lib/src/lib.rs`, when adding configuration options like `fast_sync` to `IndexerConfig`, inline code comments are not necessary if the feature is documented elsewhere.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6570
File: crypto/packet/src/packet.rs:31-31
Timestamp: 2024-10-22T09:59:33.942Z
Learning: In `crypto/packet/src/packet.rs`, the `PADDING_TAG` constant remains private, so suggestions about its documentation should consider its visibility.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: chain/rpc/src/errors.rs:44-45
Timestamp: 2024-10-29T15:30:41.405Z
Learning: In `chain/rpc/src/errors.rs`, error variants in the `RpcError` enum are not documented separately.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6619
File: crypto/packet/benches/packet_crypto.rs:74-120
Timestamp: 2024-11-11T18:29:26.659Z
Learning: In the `crypto/packet/benches/packet_crypto.rs` benchmarks, generalizing initialization code to reduce duplication is preferred, but alternative approaches are favored over the previously suggested fixture pattern.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6580
File: hoprd/rest-api/src/lib.rs:2529-2530
Timestamp: 2024-10-30T11:46:41.005Z
Learning: In `hoprd/rest-api/src/lib.rs`, avoid logging connected peers to prevent potential data exposure. Remove unnecessary logging statements that might reveal sensitive information.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: chain/rpc/src/indexer.rs:0-0
Timestamp: 2024-10-29T15:38:52.633Z
Learning: In `chain/rpc/src/indexer.rs` tests, prefer to keep the code as is, even if there is duplicated code, and not extract shared logic into helper functions.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6313
File: hopr/hopr-lib/src/lib.rs:0-0
Timestamp: 2024-07-28T07:26:06.634Z
Learning: The types `IndexerTransportEvent`, `Network`, `PeerEligibility`, and `PeerOrigin` in the `hopr/hopr-lib/src/lib.rs` file are internal to the transport mechanism and do not require public documentation.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6531
File: hopr/hopr-lib/src/lib.rs:1110-1132
Timestamp: 2024-11-03T20:57:55.015Z
Learning: In `hopr/hopr-lib/src/lib.rs`, the `establish_max_retries` field is of type `u32`, so it cannot be negative. Therefore, handling negative values for this configuration parameter is unnecessary.
Learnt from: QYuQianchen
PR: hoprnet/hoprnet#7150
File: chain/actions/src/payload.rs:347-370
Timestamp: 2025-05-28T09:12:59.636Z
Learning: In HOPR's chain actions payload generators (chain/actions/src/payload.rs), the multisend transaction methods validate input length upfront and don't require additional empty checks after filtering operations. The pattern is: check input length first, then filter without additional empty validation.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6142
File: hopr/hopr-lib/tests/chain_integration_tests.rs:40-56
Timestamp: 2024-07-28T07:26:06.634Z
Learning: The use of `unwrap` is acceptable in test scenarios within the `hoprnet` project, as it helps directly identify issues when tests fail.
Learnt from: QYuQianchen
PR: hoprnet/hoprnet#7150
File: chain/actions/src/payload.rs:294-308
Timestamp: 2025-05-28T09:13:11.370Z
Learning: In chain/actions/src/payload.rs, both BasicPayloadGenerator and SafePayloadGenerator multisend operations can skip empty batch checks after filtering self-addresses because the destinations length is already validated in the match statement before entering the multisend code path.
ethereum/bindings/src/lib.rs (11)
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: hopr/hopr-lib/src/lib.rs:564-564
Timestamp: 2024-10-21T15:15:11.701Z
Learning: In `hopr/hopr-lib/src/lib.rs`, when adding configuration options like `fast_sync` to `IndexerConfig`, inline code comments are not necessary if the feature is documented elsewhere.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-09-27T08:49:03.928Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6508
File: rustfmt.toml:6-6
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The directory `ethereum/bindings/src/codegen` is generated and may not exist in the project structure but should still be included in the `ignore` directive in `rustfmt.toml` to prevent formatting of generated code.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6508
File: rustfmt.toml:6-6
Timestamp: 2024-09-25T14:16:43.307Z
Learning: The directory `ethereum/bindings/src/codegen` is generated and may not exist in the project structure but should still be included in the `ignore` directive in `rustfmt.toml` to prevent formatting of generated code.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6580
File: hoprd/rest-api/src/lib.rs:2529-2530
Timestamp: 2024-10-30T11:46:41.005Z
Learning: In `hoprd/rest-api/src/lib.rs`, avoid logging connected peers to prevent potential data exposure. Remove unnecessary logging statements that might reveal sensitive information.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6570
File: crypto/packet/src/packet.rs:31-31
Timestamp: 2024-10-22T09:59:33.942Z
Learning: In `crypto/packet/src/packet.rs`, the `PADDING_TAG` constant remains private, so suggestions about its documentation should consider its visibility.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6619
File: crypto/packet/benches/packet_crypto.rs:74-120
Timestamp: 2024-11-11T18:29:26.659Z
Learning: In the `crypto/packet/benches/packet_crypto.rs` benchmarks, generalizing initialization code to reduce duplication is preferred, but alternative approaches are favored over the previously suggested fixture pattern.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: chain/rpc/src/errors.rs:44-45
Timestamp: 2024-10-29T15:30:41.405Z
Learning: In `chain/rpc/src/errors.rs`, error variants in the `RpcError` enum are not documented separately.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6313
File: hopr/hopr-lib/src/lib.rs:0-0
Timestamp: 2024-07-28T07:26:06.634Z
Learning: The types `IndexerTransportEvent`, `Network`, `PeerEligibility`, and `PeerOrigin` in the `hopr/hopr-lib/src/lib.rs` file are internal to the transport mechanism and do not require public documentation.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6932
File: common/internal-types/src/protocol.rs:294-295
Timestamp: 2025-04-22T12:03:45.957Z
Learning: In the hoprnet codebase, `std::mem::size_of` is imported through one of the prelude modules (likely `hopr_primitive_types::prelude::*`), so explicit imports are not needed when using it.
transport/network/src/network.rs (14)
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6932
File: common/internal-types/src/protocol.rs:294-295
Timestamp: 2025-04-22T12:03:45.957Z
Learning: In the hoprnet codebase, `std::mem::size_of` is imported through one of the prelude modules (likely `hopr_primitive_types::prelude::*`), so explicit imports are not needed when using it.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-09-27T08:49:03.928Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Removing the `#[allow(dead_code)]` attribute from the `as_str` method in `SocketAddrStr` causes issues in tests, so it should remain.
Learnt from: jeandemeusy
PR: hoprnet/hoprnet#6527
File: hoprd/db/api/src/db.rs:8-8
Timestamp: 2024-10-04T09:45:55.226Z
Learning: When importing `LevelFilter` in Rust files within the database modules (e.g., `hoprd/db/api/src/db.rs`), it is acceptable to use `use tracing::log::LevelFilter;`, consistent with its usage in `db/sql/src`.
Learnt from: jeandemeusy
PR: hoprnet/hoprnet#6527
File: hoprd/db/api/src/db.rs:8-8
Timestamp: 2024-10-09T06:16:18.170Z
Learning: When importing `LevelFilter` in Rust files within the database modules (e.g., `hoprd/db/api/src/db.rs`), it is acceptable to use `use tracing::log::LevelFilter;`, consistent with its usage in `db/sql/src`.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6313
File: hopr/hopr-lib/src/lib.rs:0-0
Timestamp: 2024-07-28T07:26:06.634Z
Learning: The types `IndexerTransportEvent`, `Network`, `PeerEligibility`, and `PeerOrigin` in the `hopr/hopr-lib/src/lib.rs` file are internal to the transport mechanism and do not require public documentation.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6580
File: hoprd/rest-api/src/lib.rs:2529-2530
Timestamp: 2024-10-30T11:46:41.005Z
Learning: In `hoprd/rest-api/src/lib.rs`, avoid logging connected peers to prevent potential data exposure. Remove unnecessary logging statements that might reveal sensitive information.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: chain/api/Cargo.toml:50-53
Timestamp: 2024-11-01T15:26:53.058Z
Learning: In `chain/api/Cargo.toml`, it's acceptable to declare the same dependency `hopr-db-sql` in both `[dependencies]` and `[dev-dependencies]` with different features, especially when additional features are only needed for tests.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6619
File: crypto/packet/benches/packet_crypto.rs:74-120
Timestamp: 2024-11-11T18:29:26.659Z
Learning: In the `crypto/packet/benches/packet_crypto.rs` benchmarks, generalizing initialization code to reduce duplication is preferred, but alternative approaches are favored over the previously suggested fixture pattern.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6345
File: hopr-socks/hopr-socks-server/Cargo.toml:20-20
Timestamp: 2024-06-21T20:51:35.871Z
Learning: All code and packages in the `hoprnet` project should use the workspace level dependency of `reqwest`.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6553
File: transport/api/src/p2p.rs:570-574
Timestamp: 2024-10-15T20:37:20.303Z
Learning: In `transport/api/src/p2p.rs`, within the `ConnectionEstablished` event handler, we follow the libp2p convention by assigning `PeerOrigin::IncomingConnection` to all peers, regardless of whether the connection was initiated by our node or by the remote peer.
Learnt from: jeandemeusy
PR: hoprnet/hoprnet#6532
File: hoprd/rest-api/src/types.rs:14-14
Timestamp: 2024-10-03T14:51:02.424Z
Learning: `PeerId` and `Address` implement the `Copy` trait.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6399
File: chain/rpc/src/indexer.rs:0-0
Timestamp: 2024-10-29T15:38:52.633Z
Learning: In `chain/rpc/src/indexer.rs` tests, prefer to keep the code as is, even if there is duplicated code, and not extract shared logic into helper functions.
Learnt from: NumberFour8
PR: hoprnet/hoprnet#6142
File: hopr/hopr-lib/tests/chain_integration_tests.rs:40-56
Timestamp: 2024-07-28T07:26:06.634Z
Learning: The use of `unwrap` is acceptable in test scenarios within the `hoprnet` project, as it helps directly identify issues when tests fail.
flake.nix (6)
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Create a Git pre-commit hook to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:29:02.123Z
Learning: Create a Git pre-commit hook to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6508
File: rustfmt.toml:6-6
Timestamp: 2024-09-25T14:16:43.307Z
Learning: The directory `ethereum/bindings/src/codegen` is generated and may not exist in the project structure but should still be included in the `ignore` directive in `rustfmt.toml` to prevent formatting of generated code.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6508
File: rustfmt.toml:6-6
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The directory `ethereum/bindings/src/codegen` is generated and may not exist in the project structure but should still be included in the `ignore` directive in `rustfmt.toml` to prevent formatting of generated code.
hopli/src/methods.rs (13)

undefined

<retrieved_learning>
Learnt from: tolbrino
PR: #6399
File: hopr/hopr-lib/src/lib.rs:564-564
Timestamp: 2024-10-21T15:15:11.701Z
Learning: In hopr/hopr-lib/src/lib.rs, when adding configuration options like fast_sync to IndexerConfig, inline code comments are not necessary if the feature is documented elsewhere.
</retrieved_learning>

<retrieved_learning>
Learnt from: NumberFour8
PR: #6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-09-27T08:49:03.928Z
Learning: Removing the #[allow(dead_code)] attribute from the as_str method in SocketAddrStr causes issues in tests, so it should remain.
</retrieved_learning>

<retrieved_learning>
Learnt from: NumberFour8
PR: #6506
File: common/network-types/src/utils.rs:50-50
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Removing the #[allow(dead_code)] attribute from the as_str method in SocketAddrStr causes issues in tests, so it should remain.
</retrieved_learning>

<retrieved_learning>
Learnt from: Teebor-Choka
PR: #6580
File: hoprd/rest-api/src/lib.rs:2529-2530
Timestamp: 2024-10-30T11:46:41.005Z
Learning: In hoprd/rest-api/src/lib.rs, avoid logging connected peers to prevent potential data exposure. Remove unnecessary logging statements that might reveal sensitive information.
</retrieved_learning>

<retrieved_learning>
Learnt from: tolbrino
PR: #6366
File: hoprd/rest-api/src/network.rs:32-49
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Error messages in the price function within hoprd/rest-api/src/network.rs must remain unchanged to maintain backwards-compatibility.
</retrieved_learning>

<retrieved_learning>
Learnt from: Teebor-Choka
PR: #6399
File: hoprd/rest-api/src/node.rs:359-359
Timestamp: 2024-10-30T16:07:23.699Z
Learning: In hoprd/rest-api/src/node.rs, within the info handler, adding detailed error context when parsing checksums is unnecessary because error messages are not effectively propagated to clients.
</retrieved_learning>

<retrieved_learning>
Learnt from: Teebor-Choka
PR: #6570
File: crypto/packet/src/packet.rs:31-31
Timestamp: 2024-10-22T09:59:33.942Z
Learning: In crypto/packet/src/packet.rs, the PADDING_TAG constant remains private, so suggestions about its documentation should consider its visibility.
</retrieved_learning>

<retrieved_learning>
Learnt from: NumberFour8
PR: #6531
File: hopr/hopr-lib/src/lib.rs:1110-1132
Timestamp: 2024-11-03T20:57:55.015Z
Learning: In hopr/hopr-lib/src/lib.rs, the establish_max_retries field is of type u32, so it cannot be negative. Therefore, handling negative values for this configuration parameter is unnecessary.
</retrieved_learning>

<retrieved_learning>
Learnt from: NumberFour8
PR: #6932
File: common/internal-types/src/protocol.rs:294-295
Timestamp: 2025-04-22T12:03:45.957Z
Learning: In the hoprnet codebase, std::mem::size_of is imported through one of the prelude modules (likely hopr_primitive_types::prelude::*), so explicit imports are not needed when using it.
</retrieved_learning>

<retrieved_learning>
Learnt from: Teebor-Choka
PR: #6619
File: crypto/packet/benches/packet_crypto.rs:74-120
Timestamp: 2024-11-11T18:29:26.659Z
Learning: In the crypto/packet/benches/packet_crypto.rs benchmarks, generalizing initialization code to reduce duplication is preferred, but alternative approaches are favored over the previously suggested fixture pattern.
</retrieved_learning>

<retrieved_learning>
Learnt from: QYuQianchen
PR: #7150
File: chain/actions/src/payload.rs:294-308
Timestamp: 2025-05-28T09:13:11.370Z
Learning: In chain/actions/src/payload.rs, both BasicPayloadGenerator and SafePayloadGenerator multisend operations can skip empty batch checks after filtering self-addresses because the destinations length is already validated in the match statement before entering the multisend code path.
</retrieved_learning>

<retrieved_learning>
Learnt from: QYuQianchen
PR: #7150
File: chain/actions/src/payload.rs:347-370
Timestamp: 2025-05-28T09:12:59.636Z
Learning: In HOPR's chain actions payload generators (chain/actions/src/payload.rs), the multisend transaction methods validate input length upfront and don't require additional empty checks after filtering operations. The pattern is: check input length first, then filter without additional empty validation.
</retrieved_learning>

<retrieved_learning>
Learnt from: NumberFour8
PR: #7174
File: chain/actions/src/payload.rs:116-131
Timestamp: 2025-05-22T23:16:12.428Z
Learning: In the transfer_tx<C: Currency> function in chain/actions/src/payload.rs, the use of unimplemented!() for unsupported currencies is intentional rather than returning an error, as this represents a programming error that should cause a panic rather than be handled gracefully.
</retrieved_learning>

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Zizmor / Zizmor
  • GitHub Check: Pre-commit / Pre-commit
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust
  • GitHub Check: Build Candidate Binaries (hoprd)
  • GitHub Check: tests-unit-nightly
  • GitHub Check: Build Candidate Binaries (hopli)
  • GitHub Check: tests-unit
🔇 Additional comments (2)
chain/types/src/utils.rs (1)

4-6: LGTM: Correct placement of lint suppression attribute.

Moving the #![allow(clippy::too_many_arguments)] attribute to after the module documentation follows Rust best practices and improves code organization without affecting functionality.

flake.nix (1)

619-624: LGTM: Appropriate exclusions for pre-commit checks.

The excluded paths correctly target generated code, vendor dependencies, and configuration files that don't require pre-commit processing. This aligns with best practices for handling generated and external code in automated checks.

@tolbrino tolbrino disabled auto-merge July 2, 2025 11:38
@tolbrino tolbrino merged commit b162864 into master Jul 2, 2025
23 of 24 checks passed
@tolbrino tolbrino deleted the kauki/ci/comply-with-pre-commit-fixes branch July 2, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants