Skip to content

chore(consensus): Add separator before type suffix in integer literals.#9429

Open
daniel-wong-dfinity-org wants to merge 1 commit intomasterfrom
separate-integer-literal-type-suffixes-consensus
Open

chore(consensus): Add separator before type suffix in integer literals.#9429
daniel-wong-dfinity-org wants to merge 1 commit intomasterfrom
separate-integer-literal-type-suffixes-consensus

Conversation

@daniel-wong-dfinity-org
Copy link
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org commented Mar 17, 2026

E.g. 42u64 is changed to 42_u64.

Fix stats: ~176 literals across 73 files.

How to re-create these changes:

  1. Build the tool. It is not in master yet; rather, it is in review in PR 9418. Until that happens, you'll first need to check out add-integer-type-suffix-separator-tool-daniel-wong. Then, bazel build //rs/tools/add-integer-type-suffix-separator.
  1. Then, check out the master commit that this is based on (originally, 40ad82dbd8) and run the tool against all directories owned by the Consensus team.
for DIRECTORY in \
    rs/artifact_pool \
    rs/backup \
    rs/canister_client \
    rs/config \
    rs/consensus \
    rs/crypto \
    rs/cup_explorer \
    rs/http_endpoints \
    rs/http_utils \
    rs/https_outcalls \
    rs/ingress_manager \
    rs/monitoring \
    rs/orchestrator \
    rs/p2p \
    rs/recovery \
    rs/replay \
    rs/replica \
    rs/rust_canisters/proxy_canister \
    rs/test_utilities/artifact_pool \
    rs/test_utilities/consensus \
    rs/test_utilities/in_memory_logger \
    rs/test_utilities/metrics \
    rs/validator \
    rs/types/exhaustive_derive \
    rs/tests/nested/nns_recovery \
    rs/ic_os/metrics/fstrim_tool
do
    ./bazel-bin/rs/tools/add-integer-type-suffix-separator/add-integer-type-suffix-separator $DIRECTORY
done

git restore rs/crypto/tree_hash

…sus-owned code

Changes 42u64 -> 42_u64, 42i32 -> 42_i32, etc.

The tool was run on the following directories:

    rs/artifact_pool
    rs/backup
    rs/canister_client
    rs/config
    rs/consensus
    rs/crypto
    rs/cup_explorer
    rs/http_endpoints
    rs/http_utils
    rs/https_outcalls
    rs/ingress_manager
    rs/monitoring
    rs/orchestrator
    rs/p2p
    rs/recovery
    rs/replay
    rs/replica
    rs/rust_canisters/proxy_canister
    rs/test_utilities/artifact_pool
    rs/test_utilities/consensus
    rs/test_utilities/in_memory_logger
    rs/test_utilities/metrics
    rs/validator
    rs/types/exhaustive_derive
@github-actions github-actions bot added the chore label Mar 17, 2026
@daniel-wong-dfinity-org daniel-wong-dfinity-org changed the title chore: Add separator before type suffix in integer literals in consen… chore(consensus): Add separator before type suffix in integer literals. Mar 17, 2026
@daniel-wong-dfinity-org daniel-wong-dfinity-org marked this pull request as ready for review March 17, 2026 18:43
@daniel-wong-dfinity-org daniel-wong-dfinity-org requested a review from a team as a code owner March 17, 2026 18:43
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.

1 participant