From 37de1fff8f90c1b638157e82d919c164e6d27c00 Mon Sep 17 00:00:00 2001 From: JuArce <52429267+JuArce@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:31:00 -0300 Subject: [PATCH 1/5] feat: send loc reports to slack --- .github/scripts/public_loc.sh | 3 + .github/workflows/daily_loc_report.yaml | 57 + .gitignore | 4 +- tooling/Cargo.lock | 1604 +++++++++++++++++++++++ tooling/Cargo.toml | 14 + tooling/loc/Cargo.toml | 15 + tooling/loc/Makefile | 17 + tooling/loc/src/main.rs | 137 ++ tooling/loc/src/report.rs | 285 ++++ 9 files changed, 2135 insertions(+), 1 deletion(-) create mode 100644 .github/scripts/public_loc.sh create mode 100644 .github/workflows/daily_loc_report.yaml create mode 100644 tooling/Cargo.lock create mode 100644 tooling/Cargo.toml create mode 100644 tooling/loc/Cargo.toml create mode 100644 tooling/loc/Makefile create mode 100644 tooling/loc/src/main.rs create mode 100644 tooling/loc/src/report.rs diff --git a/.github/scripts/public_loc.sh b/.github/scripts/public_loc.sh new file mode 100644 index 000000000..17957eb4d --- /dev/null +++ b/.github/scripts/public_loc.sh @@ -0,0 +1,3 @@ +curl -X POST $1 \ +-H 'Content-Type: application/json; charset=utf-8' \ +--data "$(cat tooling/loc/loc_report_slack.txt)" \ No newline at end of file diff --git a/.github/workflows/daily_loc_report.yaml b/.github/workflows/daily_loc_report.yaml new file mode 100644 index 000000000..5c7ef120c --- /dev/null +++ b/.github/workflows/daily_loc_report.yaml @@ -0,0 +1,57 @@ +# Acknowledgement: This workflow is inspired by Ethrex Team (https://github.com/lambdaclass/ethrex) +name: Daily Lines of Code Report + +on: + schedule: + # Every day at UTC midnight on weekdays + - cron: "0 0 * * 1,2,3,4,5" + workflow_dispatch: + +permissions: + contents: read + actions: write + +jobs: + loc: + name: Count loc and generate report + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Setup Rust Environment + uses: ./.github/actions/setup-rust + + - name: Restore cache + id: cache-loc-report + uses: actions/cache@v4 + with: + path: tooling/loc/loc_report.json + key: loc-report-${{ github.ref_name }} + restore-keys: | + loc-report- + + - name: Rename cached loc_report.json to loc_report.json.old + if: steps.cache-loc-report.outputs.cache-hit != '' + run: mv tooling/loc/loc_report.json tooling/loc/loc_report.json.old + + - name: Generate the loc report + run: | + cd tooling/loc && make loc + + - name: Save new loc_report.json to cache + if: success() + uses: actions/cache@v4 + with: + path: tooling/loc/loc_report.json + key: loc-report-${{ github.ref_name }} + + - name: Post results in summary + run: | + echo "# lines of code report" >> $GITHUB_STEP_SUMMARY + cat tooling/loc/loc_report_github.txt >> $GITHUB_STEP_SUMMARY + + - name: Post results to Slack + env: + SLACK_WEBHOOK: ${{ secrets.LOC_SLACK_WEBHOOK }} + run: | + sh .github/scripts/publish_loc.sh "$SLACK_WEBHOOK" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ea8c4bf7f..010efbf06 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/target +**/target +.idea +.vscode diff --git a/tooling/Cargo.lock b/tooling/Cargo.lock new file mode 100644 index 000000000..b6cd3ca0b --- /dev/null +++ b/tooling/Cargo.lock @@ -0,0 +1,1604 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bstr" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "cc" +version = "1.2.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +dependencies = [ + "iana-time-zone", + "num-traits", + "windows-link", +] + +[[package]] +name = "chrono-tz" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_complete" +version = "4.5.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39615915e2ece2550c0149addac32fb5bd312c657f43845bb9088cb9c8a7c992" +dependencies = [ + "clap 4.5.53", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "colored" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +dependencies = [ + "lazy_static", + "windows-sys 0.59.0", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csv" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde_core", +] + +[[package]] +name = "csv-core" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782" +dependencies = [ + "memchr", +] + +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if", + "num_cpus", + "serde", +] + +[[package]] +name = "deunicode" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abd57806937c9cc163efc8ea3910e00a62e2aeb0b8119f1793a978088f8f6b04" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "encoding_rs_io" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc3c5651fb62ab8aa3103998dade57efdd028544bd300516baa31840c252a83" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "globset" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" +dependencies = [ + "aho-corasick 1.1.4", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "globwalk" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" +dependencies = [ + "bitflags 2.10.0", + "ignore", + "walkdir", +] + +[[package]] +name = "grep-matcher" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36d7b71093325ab22d780b40d7df3066ae4aebb518ba719d38c697a8228a8023" +dependencies = [ + "memchr", +] + +[[package]] +name = "grep-searcher" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac63295322dc48ebb20a25348147905d816318888e64f531bfc2a2bc0577dc34" +dependencies = [ + "bstr", + "encoding_rs", + "encoding_rs_io", + "grep-matcher", + "log", + "memchr", + "memmap2", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + +[[package]] +name = "humantime" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" + +[[package]] +name = "iana-time-zone" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ignore" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi 0.5.2", + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libredox" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +dependencies = [ + "bitflags 2.10.0", + "libc", +] + +[[package]] +name = "loc" +version = "4.0.0" +dependencies = [ + "clap 4.5.53", + "clap_complete", + "colored", + "prettytable", + "serde", + "serde_json", + "spinoff", + "tokei", +] + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "memmap2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490" +dependencies = [ + "libc", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi 0.5.2", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parse-zoneinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +dependencies = [ + "regex", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pest" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbcfd20a6d4eeba40179f05735784ad32bdaef05ce8e8af05f180d45bb3e7e22" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f72981ade67b1ca6adc26ec221be9f463f2b5839c7508998daa17c23d94d7f" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee9efd8cdb50d719a80088b76f81aec7c41ed6d522ee750178f83883d271625" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf1d70880e76bdc13ba52eafa6239ce793d85c8e43896507e43dd8984ff05b82" +dependencies = [ + "pest", + "sha2", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettytable" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46480520d1b77c9a3482d39939fcf96831537a250ec62d4fd8fbdf8e0302e781" +dependencies = [ + "csv", + "encode_unicode", + "is-terminal", + "lazy_static", + "term", + "unicode-width", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +dependencies = [ + "aho-corasick 1.1.4", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +dependencies = [ + "aho-corasick 1.1.4", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slug" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882a80f72ee45de3cc9a5afeb2da0331d58df69e4e7d8eeb5d3c7784ae67e724" +dependencies = [ + "deunicode", + "wasm-bindgen", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "spinoff" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20aa2ed67fbb202e7b716ff8bfc6571dd9301617767380197d701c31124e88f6" +dependencies = [ + "colored", + "once_cell", + "paste", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tera" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8004bca281f2d32df3bacd59bc67b312cb4c70cea46cbd79dbe8ac5ed206722" +dependencies = [ + "chrono", + "chrono-tz", + "globwalk", + "humansize", + "lazy_static", + "percent-encoding", + "pest", + "pest_derive", + "rand", + "regex", + "serde", + "serde_json", + "slug", + "unicode-segmentation", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "term_size" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokei" +version = "12.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41f915e075a8a98ad64a5f7be6b7cc1710fc835c5f07e4a3efcaeb013291c00" +dependencies = [ + "aho-corasick 0.7.20", + "clap 2.34.0", + "crossbeam-channel", + "dashmap", + "dirs", + "encoding_rs_io", + "env_logger", + "grep-searcher", + "ignore", + "log", + "num-format", + "once_cell", + "parking_lot", + "rayon", + "regex", + "serde", + "serde_json", + "tera", + "term_size", + "toml", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/tooling/Cargo.toml b/tooling/Cargo.toml new file mode 100644 index 000000000..5fc9fc6bb --- /dev/null +++ b/tooling/Cargo.toml @@ -0,0 +1,14 @@ +# Acknowledgement: Lambdaclass Ethrex Team (https://github.com/lambdaclass/ethrex) +[workspace] +resolver = "3" +members = ["loc"] + +[workspace.package] +version = "4.0.0" +edition = "2024" + +[workspace.dependencies] +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.117" +clap = { version = "4.3", features = ["derive", "env"] } +clap_complete = "4.5.17" \ No newline at end of file diff --git a/tooling/loc/Cargo.toml b/tooling/loc/Cargo.toml new file mode 100644 index 000000000..2309a11c9 --- /dev/null +++ b/tooling/loc/Cargo.toml @@ -0,0 +1,15 @@ +# Acknowledgement: Lambdaclass Ethrex Team (https://github.com/lambdaclass/ethrex) +[package] +name = "loc" +version.workspace = true +edition.workspace = true + +[dependencies] +tokei = "12.1.2" +serde.workspace = true +serde_json.workspace = true +clap.workspace = true +clap_complete.workspace = true +colored = "2.1.0" +spinoff = "0.8.0" +prettytable = "0.10.0" diff --git a/tooling/loc/Makefile b/tooling/loc/Makefile new file mode 100644 index 000000000..4112b6a17 --- /dev/null +++ b/tooling/loc/Makefile @@ -0,0 +1,17 @@ +.PHONY: loc loc-stats loc-detailed loc-compare-detailed + +loc: + cargo run + +loc-stats: + if [ "$(QUIET)" = "true" ]; then \ + cargo run --quiet -- --summary;\ + else \ + cargo run -- --summary;\ + fi + +loc-detailed: + cargo run -- --detailed + +loc-compare-detailed: + cargo run -- --compare-detailed \ No newline at end of file diff --git a/tooling/loc/src/main.rs b/tooling/loc/src/main.rs new file mode 100644 index 000000000..dae4e1874 --- /dev/null +++ b/tooling/loc/src/main.rs @@ -0,0 +1,137 @@ +// Acknowledgement: Lambdaclass Ethrex Team (https://github.com/lambdaclass/ethrex) +use clap::Parser; +use report::{LinesOfCodeReport, LinesOfCodeReporterOptions, shell_summary}; +use spinoff::{Color, Spinner, spinners::Dots}; +use std::{collections::HashMap, fs::DirEntry, path::PathBuf}; +use tokei::{Config, Language, LanguageType, Languages}; + +mod report; + +fn count_crates_loc(crates_path: &PathBuf, config: &Config) -> Vec<(String, usize)> { + let top_level_crate_dirs = std::fs::read_dir(crates_path) + .unwrap() + .filter_map(|e| e.ok()) + .collect::>(); + + let excluded_dirs = ["tooling", "target", "tests"]; + + let mut crates_loc: Vec<(String, usize)> = top_level_crate_dirs + .into_iter() + .filter_map(|crate_dir_entry| { + let crate_path = crate_dir_entry.path(); + let crate_name = crate_path.file_name().unwrap().to_str().unwrap(); + + // Skip excluded directories + if excluded_dirs.contains(&crate_name) { + return None; + } + + if let Some(crate_loc) = count_loc(crate_path.clone(), config) { + Some(( + crate_name.to_owned(), + crate_loc.code, + )) + } else { + None + } + }) + .collect(); + + crates_loc.sort_by_key(|(_crate_name, loc)| *loc); + crates_loc.reverse(); + crates_loc +} + +fn count_loc(path: PathBuf, config: &Config) -> Option { + let mut languages = Languages::new(); + languages.get_statistics(&[path], &["tests", "*tests*", "target", "tooling"], config); + languages.get(&LanguageType::Rust).cloned() +} + +fn main() { + let opts = LinesOfCodeReporterOptions::parse(); + + let mut spinner = Spinner::new(Dots, "Counting lines of code...", Color::Cyan); + + // Find the root of the repo + let repo_path = std::env::var("CARGO_MANIFEST_DIR") + .map(PathBuf::from) + .map(|path| path.parent().unwrap().parent().unwrap().to_path_buf()) + .unwrap(); + let repo_crates_path = repo_path.join(""); // TODO: change to "crates" when crates directory exists + let config = Config::default(); + + let null_vm_loc = count_loc(repo_path, &config).unwrap(); + let crates_loc = count_crates_loc(&repo_crates_path, &config); + + spinner.success("Lines of code calculated!"); + + let mut spinner = Spinner::new(Dots, "Generating report...", Color::Cyan); + + let new_report = LinesOfCodeReport { + null_vm: null_vm_loc.code, + crates: crates_loc, + }; + + if opts.detailed { + let mut current_detailed_loc_report = HashMap::new(); + for report in null_vm_loc.reports { + let file_path = report.name; + // let file_name = file_path.file_name().unwrap().to_str().unwrap(); + // let dir_path = file_path.parent().unwrap(); + + current_detailed_loc_report + .entry(file_path.as_os_str().to_str().unwrap().to_owned()) + .and_modify(|e: &mut usize| *e += report.stats.code) + .or_insert_with(|| report.stats.code); + } + + std::fs::write( + "current_detailed_loc_report.json", + serde_json::to_string(¤t_detailed_loc_report).unwrap(), + ) + .expect("current_detailed_loc_report.json could not be written"); + } else if opts.compare_detailed { + let current_detailed_loc_report: HashMap = + std::fs::read_to_string("current_detailed_loc_report.json") + .map(|s| serde_json::from_str(&s).unwrap()) + .expect("current_detailed_loc_report.json could not be read"); + + let previous_detailed_loc_report: HashMap = + std::fs::read_to_string("previous_detailed_loc_report.json") + .map(|s| serde_json::from_str(&s).unwrap()) + .unwrap_or(current_detailed_loc_report.clone()); + + std::fs::write( + "detailed_loc_report.txt", + report::pr_message(previous_detailed_loc_report, current_detailed_loc_report), + ) + .unwrap(); + } else if opts.summary { + spinner.success("Report generated!"); + println!("{}", shell_summary(new_report)); + } else { + std::fs::write( + "loc_report.json", + serde_json::to_string(&new_report).unwrap(), + ) + .expect("loc_report.json could not be written"); + + let old_report: LinesOfCodeReport = std::fs::read_to_string("loc_report.json.old") + .map(|s| serde_json::from_str(&s).unwrap()) + .unwrap_or(new_report.clone()); + + std::fs::write( + "loc_report_slack.txt", + report::slack_message(old_report.clone(), new_report.clone()), + ) + .unwrap(); + std::fs::write( + "loc_report_github.txt", + report::github_step_summary(old_report, new_report), + ) + .unwrap(); + + spinner.success("Report generated!"); + } +} diff --git a/tooling/loc/src/report.rs b/tooling/loc/src/report.rs new file mode 100644 index 000000000..44442f84a --- /dev/null +++ b/tooling/loc/src/report.rs @@ -0,0 +1,285 @@ +// Acknowledgement: Lambdaclass Ethrex Team (https://github.com/lambdaclass/ethrex) +use clap::Parser; +use colored::Colorize; +use prettytable::{Table, row}; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +#[derive(Parser)] +pub struct LinesOfCodeReporterOptions { + #[arg(short, long, value_name = "SUMMARY", default_value = "false")] + pub summary: bool, + #[arg(short, long, value_name = "DETAILED", default_value = "false")] + pub detailed: bool, + #[arg(short, long, value_name = "PR_SUMMARY", default_value = "false")] + pub compare_detailed: bool, +} + +#[derive(Default, Serialize, Deserialize, Clone)] +pub struct LinesOfCodeReport { + pub null_vm: usize, + pub crates: Vec<(String, usize)>, +} + +pub fn pr_message( + old_report: HashMap, + new_report: HashMap, +) -> String { + let sorted_file_paths = { + let mut keys: Vec<_> = new_report.keys().collect(); + keys.sort(); + keys + }; + + let mut table = Table::new(); + + table.add_row(row!["File", "Lines", "Diff"]); + + let mut total_lines_changed: i64 = 0; + let mut total_lines_added: i64 = 0; + let mut total_lines_removed: i64 = 0; + + for file_path in sorted_file_paths { + let current_loc = *new_report.get(file_path).unwrap() as i64; + let previous_loc = *old_report.get(file_path).unwrap_or(&0) as i64; + let loc_diff = current_loc - previous_loc; + + if loc_diff == 0 { + continue; + } + + if loc_diff > 0 { + total_lines_added += loc_diff; + } else { + total_lines_removed += loc_diff.abs(); + } + + total_lines_changed += loc_diff.abs(); + + // remove "null-vm/" and everything before it + const NULL_VM_PREFIX: &str = "null-vm/"; + let file_path_printable = if let Some(idx) = file_path.find(NULL_VM_PREFIX) { + &file_path[idx + NULL_VM_PREFIX.len()..] + } else { + file_path + }; + + table.add_row(row![ + file_path_printable, + current_loc, + match current_loc.cmp(&previous_loc) { + std::cmp::Ordering::Greater => format!("+{loc_diff}"), + std::cmp::Ordering::Less => format!("{loc_diff}"), + std::cmp::Ordering::Equal => "-".to_owned(), + } + ]); + } + + if total_lines_changed == 0 { + return "".to_string(); + } + + let mut pr_message = String::new(); + + pr_message.push_str("

Lines of code report

\n"); + pr_message.push('\n'); + + pr_message.push_str(&pr_message_summary( + total_lines_added, + total_lines_removed, + total_lines_changed, + )); + + pr_message.push('\n'); + pr_message.push_str("
\n"); + pr_message.push_str("Detailed view\n"); + pr_message.push('\n'); + pr_message.push_str("```\n"); + pr_message.push_str(&format!("{table}\n")); + pr_message.push_str("```\n"); + pr_message.push_str("
\n"); + + pr_message +} + +fn pr_message_summary( + total_lines_added: i64, + total_lines_removed: i64, + total_lines_changed: i64, +) -> String { + let mut pr_message = String::new(); + + pr_message.push_str(&format!( + "Total lines added: `{}`\n", + match total_lines_added.cmp(&0) { + std::cmp::Ordering::Greater => format!("{total_lines_added}"), + std::cmp::Ordering::Less => + unreachable!("total_lines_added should never be less than 0"), + std::cmp::Ordering::Equal => format!("{total_lines_added}"), + } + )); + pr_message.push_str(&format!( + "Total lines removed: `{}`\n", + match total_lines_removed.cmp(&0) { + std::cmp::Ordering::Greater | std::cmp::Ordering::Equal => + format!("{total_lines_removed}"), + std::cmp::Ordering::Less => + unreachable!("total_lines_removed should never be less than 0"), + } + )); + pr_message.push_str(&format!( + "Total lines changed: `{}`\n", + match total_lines_changed.cmp(&0) { + std::cmp::Ordering::Greater | std::cmp::Ordering::Equal => + format!("{total_lines_changed}"), + std::cmp::Ordering::Less => + unreachable!("total_lines_changed should never be less than 0"), + } + )); + + pr_message +} + +pub fn slack_message(old_report: LinesOfCodeReport, new_report: LinesOfCodeReport) -> String { + let diff_total = new_report.null_vm.abs_diff(old_report.null_vm); + + let crates_mrkdwn = + new_report + .crates + .iter() + .fold(String::new(), |acc, (crate_name, loc)| { + let old_loc = old_report + .crates + .iter() + .find(|(old_crate_name, _)| old_crate_name == crate_name) + .map(|(_, old_loc)| old_loc) + .unwrap_or(&0); + + let loc_diff = loc.abs_diff(*old_loc); + format!( + "{}*{}*: {} {}\\n", + acc, + crate_name, + loc, + match loc.cmp(old_loc) { + std::cmp::Ordering::Greater => format!("(+{loc_diff})"), + std::cmp::Ordering::Less => format!("(-{loc_diff})"), + std::cmp::Ordering::Equal => "".to_string(), + } + ) + }); + + format!( + r#"{{ + "blocks": [ + {{ + "type": "header", + "text": {{ + "type": "plain_text", + "text": "Daily Lines of Code Report" + }} + }}, + {{ + "type": "divider" + }}, + {{ + "type": "header", + "text": {{ + "type": "plain_text", + "text": "Summary" + }} + }}, + {{ + "type": "section", + "text": {{ + "type": "mrkdwn", + "text": "*null-vm (total):* {} {}" + }} + }}, + {{ + "type": "header", + "text": {{ + "type": "plain_text", + "text": "Crates" + }} + }}, + {{ + "type": "section", + "text": {{ + "type": "mrkdwn", + "text": "{}" + }} + }} + ] +}}"#, + new_report.null_vm, + match new_report.null_vm.cmp(&old_report.null_vm) { + std::cmp::Ordering::Greater => format!("(+{diff_total})"), + std::cmp::Ordering::Less => format!("(-{diff_total})"), + std::cmp::Ordering::Equal => "".to_string(), + }, + crates_mrkdwn + ) +} + +pub fn github_step_summary(old_report: LinesOfCodeReport, new_report: LinesOfCodeReport) -> String { + let diff_total = new_report.null_vm.abs_diff(old_report.null_vm); + + let crates_github = + new_report + .crates + .iter() + .fold(String::new(), |acc, (crate_name, loc)| { + let old_loc = old_report + .crates + .iter() + .find(|(old_crate_name, _)| old_crate_name == crate_name) + .map(|(_, old_loc)| old_loc) + .unwrap_or(&0); + + let loc_diff = loc.abs_diff(*old_loc); + format!( + "{}{}: {} {}\n", + acc, + crate_name, + loc, + match loc.cmp(old_loc) { + std::cmp::Ordering::Greater => format!("(+{loc_diff})"), + std::cmp::Ordering::Less => format!("(-{loc_diff})"), + std::cmp::Ordering::Equal => "".to_string(), + } + ) + }); + + format!( + r#"``` +null-vm loc summary +==================== +null-vm (total): {} {} + +null-vm crates loc +================= +{} +```"#, + + new_report.null_vm, + if new_report.null_vm > old_report.null_vm { + format!("(+{diff_total})") + } else { + format!("(-{diff_total})") + }, + crates_github + ) +} + +pub fn shell_summary(new_report: LinesOfCodeReport) -> String { + format!( + "{}\n{}\n{} {}\n{} {}", + "Lines of Code".bold(), + "=============".bold(), + "null-vm (total):".bold(), + new_report.null_vm, + "crates:".bold(), + new_report.crates.iter().map(|(name, loc)| format!("{}: {}", name, loc)).collect::>().join(", "), + ) +} From e1a2c3815fcaaa97625589c967623b33fb850bd5 Mon Sep 17 00:00:00 2001 From: JuArce <52429267+JuArce@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:32:45 -0300 Subject: [PATCH 2/5] missing new lines --- .github/scripts/public_loc.sh | 2 +- .github/workflows/daily_loc_report.yaml | 2 +- tooling/Cargo.toml | 2 +- tooling/loc/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/public_loc.sh b/.github/scripts/public_loc.sh index 17957eb4d..5379f3ac1 100644 --- a/.github/scripts/public_loc.sh +++ b/.github/scripts/public_loc.sh @@ -1,3 +1,3 @@ curl -X POST $1 \ -H 'Content-Type: application/json; charset=utf-8' \ ---data "$(cat tooling/loc/loc_report_slack.txt)" \ No newline at end of file +--data "$(cat tooling/loc/loc_report_slack.txt)" diff --git a/.github/workflows/daily_loc_report.yaml b/.github/workflows/daily_loc_report.yaml index 5c7ef120c..ab436f9ba 100644 --- a/.github/workflows/daily_loc_report.yaml +++ b/.github/workflows/daily_loc_report.yaml @@ -54,4 +54,4 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.LOC_SLACK_WEBHOOK }} run: | - sh .github/scripts/publish_loc.sh "$SLACK_WEBHOOK" \ No newline at end of file + sh .github/scripts/publish_loc.sh "$SLACK_WEBHOOK" diff --git a/tooling/Cargo.toml b/tooling/Cargo.toml index 5fc9fc6bb..b39aa9911 100644 --- a/tooling/Cargo.toml +++ b/tooling/Cargo.toml @@ -11,4 +11,4 @@ edition = "2024" serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.117" clap = { version = "4.3", features = ["derive", "env"] } -clap_complete = "4.5.17" \ No newline at end of file +clap_complete = "4.5.17" diff --git a/tooling/loc/Makefile b/tooling/loc/Makefile index 4112b6a17..f840b207b 100644 --- a/tooling/loc/Makefile +++ b/tooling/loc/Makefile @@ -14,4 +14,4 @@ loc-detailed: cargo run -- --detailed loc-compare-detailed: - cargo run -- --compare-detailed \ No newline at end of file + cargo run -- --compare-detailed From 9d96bb84d5c159bf158123e861d54ca1126019c8 Mon Sep 17 00:00:00 2001 From: JuArce <52429267+JuArce@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:41:18 -0300 Subject: [PATCH 3/5] add benchmarks to excluded --- tooling/loc/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tooling/loc/src/main.rs b/tooling/loc/src/main.rs index dae4e1874..e0d7696bc 100644 --- a/tooling/loc/src/main.rs +++ b/tooling/loc/src/main.rs @@ -7,14 +7,14 @@ use tokei::{Config, Language, LanguageType, Languages}; mod report; +const EXCLUDED: &[&str] = &["tooling", "target", "tests", "*tests*", "benchmarks"]; + fn count_crates_loc(crates_path: &PathBuf, config: &Config) -> Vec<(String, usize)> { let top_level_crate_dirs = std::fs::read_dir(crates_path) .unwrap() .filter_map(|e| e.ok()) .collect::>(); - let excluded_dirs = ["tooling", "target", "tests"]; - let mut crates_loc: Vec<(String, usize)> = top_level_crate_dirs .into_iter() .filter_map(|crate_dir_entry| { @@ -22,7 +22,7 @@ fn count_crates_loc(crates_path: &PathBuf, config: &Config) -> Vec<(String, usiz let crate_name = crate_path.file_name().unwrap().to_str().unwrap(); // Skip excluded directories - if excluded_dirs.contains(&crate_name) { + if EXCLUDED.contains(&crate_name) { return None; } @@ -44,7 +44,7 @@ fn count_crates_loc(crates_path: &PathBuf, config: &Config) -> Vec<(String, usiz fn count_loc(path: PathBuf, config: &Config) -> Option { let mut languages = Languages::new(); - languages.get_statistics(&[path], &["tests", "*tests*", "target", "tooling"], config); + languages.get_statistics(&[path], EXCLUDED, config); languages.get(&LanguageType::Rust).cloned() } From cbb3c019125630f27c1466d2766f22cc4b83cd20 Mon Sep 17 00:00:00 2001 From: Mauro Toscano <12560266+MauroToscano@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:38:10 -0300 Subject: [PATCH 4/5] Fix targets --- tooling/loc/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/loc/src/main.rs b/tooling/loc/src/main.rs index e0d7696bc..a80dbf31a 100644 --- a/tooling/loc/src/main.rs +++ b/tooling/loc/src/main.rs @@ -7,7 +7,7 @@ use tokei::{Config, Language, LanguageType, Languages}; mod report; -const EXCLUDED: &[&str] = &["tooling", "target", "tests", "*tests*", "benchmarks"]; +const EXCLUDED: &[&str] = &["tooling", "*target*", "*tests*", "*bench*"]; fn count_crates_loc(crates_path: &PathBuf, config: &Config) -> Vec<(String, usize)> { let top_level_crate_dirs = std::fs::read_dir(crates_path) From 2d37da864be78a5d1f5deb514a3a23667501c5e7 Mon Sep 17 00:00:00 2001 From: Mauro Toscano <12560266+MauroToscano@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:39:17 -0300 Subject: [PATCH 5/5] Remove commented code --- tooling/loc/src/main.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tooling/loc/src/main.rs b/tooling/loc/src/main.rs index a80dbf31a..36de7e201 100644 --- a/tooling/loc/src/main.rs +++ b/tooling/loc/src/main.rs @@ -77,9 +77,6 @@ fn main() { let mut current_detailed_loc_report = HashMap::new(); for report in null_vm_loc.reports { let file_path = report.name; - // let file_name = file_path.file_name().unwrap().to_str().unwrap(); - // let dir_path = file_path.parent().unwrap(); - current_detailed_loc_report .entry(file_path.as_os_str().to_str().unwrap().to_owned()) .and_modify(|e: &mut usize| *e += report.stats.code)