Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop cargo-count in make stats, replace it by tokei #4246

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

eval-exec
Copy link
Collaborator

What problem does this PR solve?

cargo-count is unmaintained, it can't be installed. So I want to replace it by tokei, and count unsafe code by rg:

$ make stats
make stats
/home/exec/.cargo/bin/tokei
===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 GNU Style Assembly      3           72           57           10            5
 BASH                    3          169          113           32           24
 Batch                   3           15           15            0            0
 C                      50         1915         1569           99          247
 Dockerfile              1           31           23            0            8
 JSON                    1          101          101            0            0
 Makefile                3          448          360           17           71
 PowerShell              1          169          145            0           24
 Python                  2          921          773           12          136
 Ruby                    1           28           20            3            5
 Shell                  12          746          653           20           73
 TOML                   85         7033         5729          312          992
 YAML                    1            8            8            0            0
-------------------------------------------------------------------------------
 Markdown               16        11106            0         7664         3442
 |- BASH                 3           38           37            0            1
 |- Shell                2            8            8            0            0
 (Total)                          11152           45         7664         3443
-------------------------------------------------------------------------------
 Rust                  712       152428       136158         2984        13286
 |- Markdown           308        11299         2485         7224         1590
 (Total)                         163727       138643        10208        14876
===============================================================================
 Total                 894       175190       145724        11153        18313
===============================================================================
# count lines of unsafe code
# ===============================================================================
tx-pool/src/component/recent_reject.rs                                1
Makefile                                                              2
db/src/snapshot.rs                                                    6
db/src/db.rs                                                          1
sync/src/relayer/tests/helper.rs                                      2
util/jsonrpc-types/src/fixed_bytes.rs                                 1
util/jsonrpc-types/src/bytes.rs                                       1
util/jsonrpc-types/src/alert.rs                                       4
util/light-client-protocol-server/src/tests/utils/network_context.rs  2
util/fixed-hash/core/src/serde.rs                                     1
util/jsonrpc-types/src/proposal_short_id.rs                           1
util/stop-handler/src/tests.rs                                        1
util/crypto/src/secp/privkey.rs                                       1
util/gen-types/src/conversion/primitive.rs                            2
util/memory-tracker/src/process.rs                                    2
util/memory-tracker/src/jemalloc.rs                                   1

Related changes

  • Remove cargo-count in make stats, replace it by tokei

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • None

Release note

None: Exclude this PR from the release note.

@eval-exec eval-exec requested a review from a team as a code owner November 25, 2023 04:46
@eval-exec eval-exec requested review from quake and removed request for a team November 25, 2023 04:46
@doitian doitian added this pull request to the merge queue Nov 27, 2023
Merged via the queue into nervosnetwork:develop with commit 17abfa5 Nov 27, 2023
32 checks passed
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