diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index eeb2ff729..823c32140 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,3 @@ -ARG VARIANT="buster" +ARG VARIANT="bookworm" FROM mcr.microsoft.com/devcontainers/rust:1-${VARIANT} RUN sudo apt update && sudo apt install -y cmake diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 41211582b..3987b13c3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "Rust", "build": { "dockerfile": "Dockerfile", - "args": { "VARIANT": "buster" } + "args": { "VARIANT": "bookworm" } }, "postCreateCommand": "git config --global --add safe.directory $PWD && cargo install cargo-insta", "extensions": ["EditorConfig.EditorConfig"], diff --git a/.github/wiki/Command-line-options.md b/.github/wiki/Command-line-options.md index da83e822c..758d8074b 100644 --- a/.github/wiki/Command-line-options.md +++ b/.github/wiki/Command-line-options.md @@ -63,7 +63,7 @@ INFO: -T, --type ... Filters output by language type - [default: programming markup] + [default: programming markup query] [possible values: programming, markup, prose, data] TEXT FORMATTING: diff --git a/Cargo.lock b/Cargo.lock index ada89cb1c..7127e664d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -47,15 +47,6 @@ dependencies = [ "zerocopy", ] -[[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.3" @@ -71,36 +62,12 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[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 = "anes" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" -[[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.15" @@ -187,17 +154,6 @@ dependencies = [ "zstd", ] -[[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.3.0" @@ -395,40 +351,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "windows-targets", -] - -[[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 = "ciborium" version = "0.2.2" @@ -456,21 +378,6 @@ dependencies = [ "half", ] -[[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.17" @@ -490,7 +397,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] @@ -499,7 +406,7 @@ version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b378c786d3bde9442d2c6dd7e6080b2a818db2b96e30d6e7f1b6d224eb617d3" dependencies = [ - "clap 4.5.17", + "clap", ] [[package]] @@ -559,12 +466,6 @@ dependencies = [ "windows-sys 0.52.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.14" @@ -607,7 +508,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.17", + "clap", "criterion-plot", "is-terminal", "itertools", @@ -684,17 +585,6 @@ dependencies = [ "typenum", ] -[[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 = "dashmap" version = "6.1.0" @@ -706,7 +596,7 @@ dependencies = [ "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.10", + "parking_lot_core", ] [[package]] @@ -718,12 +608,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "deunicode" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" - [[package]] name = "digest" version = "0.10.7" @@ -734,26 +618,6 @@ dependencies = [ "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-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dunce" version = "1.0.5" @@ -790,28 +654,6 @@ 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 = "equivalent" version = "1.0.1" @@ -859,6 +701,9 @@ name = "faster-hex" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" +dependencies = [ + "serde", +] [[package]] name = "fastrand" @@ -1039,6 +884,25 @@ dependencies = [ "version_check", ] +[[package]] +name = "gengo" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "124a47a1ad9ec2a4f48cf20bcfd07a95228380c150c4dccbac725af436507fa1" +dependencies = [ + "gix", + "glob", + "ignore", + "indexmap", + "proc-macro2", + "quote", + "rayon", + "regex", + "serde", + "serde_json", + "serde_yaml", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -1068,48 +932,48 @@ checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "gix" -version = "0.66.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9048b8d1ae2104f045cb37e5c450fc49d5d8af22609386bfc739c11ba88995eb" +checksum = "c7d3e78ddac368d3e3bfbc2862bc2aafa3d89f1b15fed898d9761e1ec6f3f17f" dependencies = [ - "gix-actor 0.32.0", - "gix-attributes", + "gix-actor 0.33.0", + "gix-attributes 0.23.0", "gix-command", - "gix-commitgraph", + "gix-commitgraph 0.25.0", "gix-config", - "gix-date 0.9.0", + "gix-date 0.9.1", "gix-diff", "gix-dir", - "gix-discover 0.35.0", - "gix-features", + "gix-discover 0.36.0", + "gix-features 0.39.0", "gix-filter", - "gix-fs", - "gix-glob", - "gix-hash", - "gix-hashtable", - "gix-ignore", - "gix-index 0.35.0", - "gix-lock", + "gix-fs 0.12.0", + "gix-glob 0.17.0", + "gix-hash 0.15.0", + "gix-hashtable 0.6.0", + "gix-ignore 0.12.0", + "gix-index 0.36.0", + "gix-lock 15.0.0", "gix-mailmap", - "gix-object 0.44.0", + "gix-object 0.45.0", "gix-odb", "gix-pack", "gix-path", "gix-pathspec", - "gix-ref 0.47.0", + "gix-ref 0.48.0", "gix-refspec", "gix-revision", - "gix-revwalk 0.15.0", + "gix-revwalk 0.16.0", "gix-sec", "gix-status", "gix-submodule", - "gix-tempfile", + "gix-tempfile 15.0.0", "gix-trace", - "gix-traverse 0.41.0", + "gix-traverse 0.42.0", "gix-url", "gix-utils", - "gix-validate 0.9.0", - "gix-worktree 0.36.0", + "gix-validate 0.9.1", + "gix-worktree 0.37.0", "once_cell", "smallvec", "thiserror", @@ -1131,12 +995,12 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc19e312cd45c4a66cd003f909163dc2f8e1623e30a0c0c6df3776e89b308665" +checksum = "59226ef06661c756e664b46b1d3b2c198f6adc5407a484c086d0171108a70027" dependencies = [ "bstr", - "gix-date 0.9.0", + "gix-date 0.9.1", "gix-utils", "itoa", "thiserror", @@ -1150,7 +1014,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebccbf25aa4a973dd352564a9000af69edca90623e8a16dad9cbc03713131311" dependencies = [ "bstr", - "gix-glob", + "gix-glob 0.16.5", + "gix-path", + "gix-quote", + "gix-trace", + "kstring", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-attributes" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31a102d201ef0e5a848458a82292581e7641e52f0f52e693b6cbdd05a652c029" +dependencies = [ + "bstr", + "gix-glob 0.17.0", "gix-path", "gix-quote", "gix-trace", @@ -1162,27 +1043,27 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a371db66cbd4e13f0ed9dc4c0fea712d7276805fccc877f77e96374d317e87ae" +checksum = "10f78312288bd02052be5dbc2ecbc342c9f4eb791986d86c0a5c06b92dc72efa" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c8751169961ba7640b513c3b24af61aa962c967aaf04116734975cd5af0c52" +checksum = "6c28b58ba04f0c004722344390af9dbc85888fbb84be1981afb934da4114d4cf" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff2e692b36bbcf09286c70803006ca3fd56551a311de450be317a0ab8ea92e7" +checksum = "c201d2b9e9cce2365a6638fd0a966f751ed92d74be5c0727ac331e6a29ef5846" dependencies = [ "bstr", "gix-path", @@ -1198,24 +1079,38 @@ checksum = "133b06f67f565836ec0c473e2116a60fb74f80b6435e21d88013ac0e3c60fc78" dependencies = [ "bstr", "gix-chunk", - "gix-features", - "gix-hash", + "gix-features 0.38.2", + "gix-hash 0.14.2", + "memmap2", + "thiserror", +] + +[[package]] +name = "gix-commitgraph" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41db900b189e62dc61575f06fdf1a3b6901d264a99be9d32b286af6b2e3984e1" +dependencies = [ + "bstr", + "gix-chunk", + "gix-features 0.39.0", + "gix-hash 0.15.0", "memmap2", "thiserror", ] [[package]] name = "gix-config" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78e797487e6ca3552491de1131b4f72202f282fb33f198b1c34406d765b42bb0" +checksum = "0bedd1bf1c7b994be9d57207e8e0de79016c05e2e8701d3015da906e65ac445e" dependencies = [ "bstr", "gix-config-value", - "gix-features", - "gix-glob", + "gix-features 0.39.0", + "gix-glob 0.17.0", "gix-path", - "gix-ref 0.47.0", + "gix-ref 0.48.0", "gix-sec", "memchr", "once_cell", @@ -1227,9 +1122,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" +checksum = "f3de3fdca9c75fa4b83a76583d265fa49b1de6b088ebcd210749c24ceeb74660" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1252,9 +1147,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c84b7af01e68daf7a6bb8bb909c1ff5edb3ce4326f1f43063a5a96d3c3c8a5" +checksum = "d10d543ac13c97292a15e8e8b7889cd006faf739777437ed95362504b8fe81a0" dependencies = [ "bstr", "itoa", @@ -1264,41 +1159,42 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c9afd80fff00f8b38b1c1928442feb4cd6d2232a6ed806b6b193151a3d336c" +checksum = "c9850fd0c15af113db6f9e130d13091ba0d3754e570a2afdff9e2f3043da260e" dependencies = [ "bstr", "gix-command", "gix-filter", - "gix-fs", - "gix-hash", - "gix-object 0.44.0", + "gix-fs 0.12.0", + "gix-hash 0.15.0", + "gix-object 0.45.0", "gix-path", - "gix-tempfile", + "gix-tempfile 15.0.0", "gix-trace", - "gix-worktree 0.36.0", + "gix-traverse 0.42.0", + "gix-worktree 0.37.0", "imara-diff", "thiserror", ] [[package]] name = "gix-dir" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed3a9076661359a1c5a27c12ad6c3ebe2dd96b8b3c0af6488ab7c128b7bdd98" +checksum = "bbf6c29bf17baf3996d4925fad5e10c1a12eac9b3a0d8475d89292e0e5ba34a3" dependencies = [ "bstr", - "gix-discover 0.35.0", - "gix-fs", - "gix-ignore", - "gix-index 0.35.0", - "gix-object 0.44.0", + "gix-discover 0.36.0", + "gix-fs 0.12.0", + "gix-ignore 0.12.0", + "gix-index 0.36.0", + "gix-object 0.45.0", "gix-path", "gix-pathspec", "gix-trace", "gix-utils", - "gix-worktree 0.36.0", + "gix-worktree 0.37.0", "thiserror", ] @@ -1310,8 +1206,8 @@ checksum = "fc27c699b63da66b50d50c00668bc0b7e90c3a382ef302865e891559935f3dbf" dependencies = [ "bstr", "dunce", - "gix-fs", - "gix-hash", + "gix-fs 0.11.3", + "gix-hash 0.14.2", "gix-path", "gix-ref 0.44.1", "gix-sec", @@ -1320,16 +1216,16 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0577366b9567376bc26e815fd74451ebd0e6218814e242f8e5b7072c58d956d2" +checksum = "c522e31f458f50af09dfb014e10873c5378f702f8049c96f508989aad59671f6" dependencies = [ "bstr", "dunce", - "gix-fs", - "gix-hash", + "gix-fs 0.12.0", + "gix-hash 0.15.0", "gix-path", - "gix-ref 0.47.0", + "gix-ref 0.48.0", "gix-sec", "thiserror", ] @@ -1339,17 +1235,32 @@ name = "gix-features" version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" +dependencies = [ + "gix-hash 0.14.2", + "gix-trace", + "gix-utils", + "libc", + "prodash 28.0.0", + "sha1_smol", + "walkdir", +] + +[[package]] +name = "gix-features" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e0eb9efdf96c35c0bed7596d1bef2d4ce6360a1d09738001f9d3e402aa7ba3e" dependencies = [ "crc32fast", "crossbeam-channel", "flate2", - "gix-hash", + "gix-hash 0.15.0", "gix-trace", "gix-utils", "libc", "once_cell", - "parking_lot 0.12.3", - "prodash", + "parking_lot", + "prodash 29.0.0", "sha1_smol", "thiserror", "walkdir", @@ -1357,16 +1268,16 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4121790ae140066e5b953becc72e7496278138d19239be2e63b5067b0843119e" +checksum = "6b37f82359a4485770ed8993ae715ced1bf674f2a63e45f5a0786d38310665ea" dependencies = [ "bstr", "encoding_rs", - "gix-attributes", + "gix-attributes 0.23.0", "gix-command", - "gix-hash", - "gix-object 0.44.0", + "gix-hash 0.15.0", + "gix-object 0.45.0", "gix-packetline-blocking", "gix-path", "gix-quote", @@ -1383,7 +1294,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2bfe6249cfea6d0c0e0990d5226a4cb36f030444ba9e35e0639275db8f98575" dependencies = [ "fastrand", - "gix-features", + "gix-features 0.38.2", + "gix-utils", +] + +[[package]] +name = "gix-fs" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34740384d8d763975858fa2c176b68652a6fcc09f616e24e3ce967b0d370e4d8" +dependencies = [ + "fastrand", + "gix-features 0.39.0", "gix-utils", ] @@ -1395,7 +1317,19 @@ checksum = "74908b4bbc0a0a40852737e5d7889f676f081e340d5451a16e5b4c50d592f111" dependencies = [ "bitflags 2.6.0", "bstr", - "gix-features", + "gix-features 0.38.2", + "gix-path", +] + +[[package]] +name = "gix-glob" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "254b5101cf7facc00d9b5ff564cf46302ca76695cca23d33bc958a707b6fc857" +dependencies = [ + "bitflags 2.6.0", + "bstr", + "gix-features 0.39.0", "gix-path", ] @@ -1409,15 +1343,36 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-hash" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "952c3a29f1bc1007cc901abce7479943abfa42016db089de33d0a4fa3c85bfe8" +dependencies = [ + "faster-hex", + "thiserror", +] + [[package]] name = "gix-hashtable" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" dependencies = [ - "gix-hash", + "gix-hash 0.14.2", + "hashbrown 0.14.5", + "parking_lot", +] + +[[package]] +name = "gix-hashtable" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef65b256631078ef733bc5530c4e6b1c2e7d5c2830b75d4e9034ab3997d18fe" +dependencies = [ + "gix-hash 0.15.0", "hashbrown 0.14.5", - "parking_lot 0.12.3", + "parking_lot", ] [[package]] @@ -1427,7 +1382,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e447cd96598460f5906a0f6c75e950a39f98c2705fc755ad2f2020c9e937fab7" dependencies = [ "bstr", - "gix-glob", + "gix-glob 0.16.5", + "gix-path", + "gix-trace", + "unicode-bom", +] + +[[package]] +name = "gix-ignore" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba55a9b582dc26a639875497615959a8127ac5c37b2426dc50f037fada33a4b7" +dependencies = [ + "bstr", + "gix-glob 0.17.0", "gix-path", "gix-trace", "unicode-bom", @@ -1444,10 +1412,10 @@ dependencies = [ "filetime", "fnv", "gix-bitmap", - "gix-features", - "gix-fs", - "gix-hash", - "gix-lock", + "gix-features 0.38.2", + "gix-fs 0.11.3", + "gix-hash 0.14.2", + "gix-lock 14.0.0", "gix-object 0.42.3", "gix-traverse 0.39.2", "gix-utils", @@ -1463,23 +1431,23 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd4203244444017682176e65fd0180be9298e58ed90bd4a8489a357795ed22d" +checksum = "27619009ca1ea33fd885041273f5fa5a09163a5c1d22a913b28d7b985e66fe29" dependencies = [ "bitflags 2.6.0", "bstr", "filetime", "fnv", "gix-bitmap", - "gix-features", - "gix-fs", - "gix-hash", - "gix-lock", - "gix-object 0.44.0", - "gix-traverse 0.41.0", + "gix-features 0.39.0", + "gix-fs 0.12.0", + "gix-hash 0.15.0", + "gix-lock 15.0.0", + "gix-object 0.45.0", + "gix-traverse 0.42.0", "gix-utils", - "gix-validate 0.9.0", + "gix-validate 0.9.1", "hashbrown 0.14.5", "itoa", "libc", @@ -1495,20 +1463,31 @@ version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bc7fe297f1f4614774989c00ec8b1add59571dc9b024b4c00acb7dedd4e19d" dependencies = [ - "gix-tempfile", + "gix-tempfile 14.0.2", + "gix-utils", + "thiserror", +] + +[[package]] +name = "gix-lock" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5102acdf4acae2644e38dbbd18cdfba9597a218f7d85f810fe5430207e03c2de" +dependencies = [ + "gix-tempfile 15.0.0", "gix-utils", "thiserror", ] [[package]] name = "gix-mailmap" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d522c8ec2501e1a5b2b4cb54e83cb5d9a52471c9d23b3a1e8dadaf063752f7" +checksum = "27d6ac205276a817b6efec0fdb6c62861d01d71f344dc7e5ebe81ab2907ebd0a" dependencies = [ "bstr", - "gix-actor 0.32.0", - "gix-date 0.9.0", + "gix-actor 0.33.0", + "gix-date 0.9.1", "thiserror", ] @@ -1521,8 +1500,8 @@ dependencies = [ "bstr", "gix-actor 0.31.5", "gix-date 0.8.7", - "gix-features", - "gix-hash", + "gix-features 0.38.2", + "gix-hash 0.14.2", "gix-utils", "gix-validate 0.8.5", "itoa", @@ -1533,17 +1512,18 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5b801834f1de7640731820c2df6ba88d95480dc4ab166a5882f8ff12b88efa" +checksum = "2a77b6e7753d298553d9ae8b1744924481e7a49170983938bb578dccfbc6fc1a" dependencies = [ "bstr", - "gix-actor 0.32.0", - "gix-date 0.9.0", - "gix-features", - "gix-hash", + "gix-actor 0.33.0", + "gix-date 0.9.1", + "gix-features 0.39.0", + "gix-hash 0.15.0", + "gix-hashtable 0.6.0", "gix-utils", - "gix-validate 0.9.0", + "gix-validate 0.9.1", "itoa", "smallvec", "thiserror", @@ -1552,36 +1532,37 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.63.0" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3158068701c17df54f0ab2adda527f5a6aca38fd5fd80ceb7e3c0a2717ec747" +checksum = "0bb86aadf7f1b2f980601b4fc94309706f9700f8008f935dc512d556c9e60f61" dependencies = [ "arc-swap", - "gix-date 0.9.0", - "gix-features", - "gix-fs", - "gix-hash", - "gix-object 0.44.0", + "gix-date 0.9.1", + "gix-features 0.39.0", + "gix-fs 0.12.0", + "gix-hash 0.15.0", + "gix-hashtable 0.6.0", + "gix-object 0.45.0", "gix-pack", "gix-path", "gix-quote", - "parking_lot 0.12.3", + "parking_lot", "tempfile", "thiserror", ] [[package]] name = "gix-pack" -version = "0.53.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3223aa342eee21e1e0e403cad8ae9caf9edca55ef84c347738d10681676fd954" +checksum = "363e6e59a855ba243672408139db68e2478126cdcfeabb420777df4a1f20026b" dependencies = [ "clru", "gix-chunk", - "gix-features", - "gix-hash", - "gix-hashtable", - "gix-object 0.44.0", + "gix-features 0.39.0", + "gix-hash 0.15.0", + "gix-hashtable 0.6.0", + "gix-object 0.45.0", "gix-path", "memmap2", "smallvec", @@ -1591,9 +1572,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.17.5" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9802304baa798dd6f5ff8008a2b6516d54b74a69ca2d3a2b9e2d6c3b5556b40" +checksum = "decace940e8ba8e29d29b73b843a6cbae67503887f3e5fb7e688d0f4f6ee0757" dependencies = [ "bstr", "faster-hex", @@ -1603,9 +1584,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.11" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" +checksum = "c04e5a94fdb56b1e91eb7df2658ad16832428b8eeda24ff1a0f0288de2bce554" dependencies = [ "bstr", "gix-trace", @@ -1616,24 +1597,24 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d23bf239532b4414d0e63b8ab3a65481881f7237ed9647bb10c1e3cc54c5ceb" +checksum = "70f02bf7625dbf15bf9fedbeace2ac1ce1c5177806bdbc24c441d664c75c00e4" dependencies = [ "bitflags 2.6.0", "bstr", - "gix-attributes", + "gix-attributes 0.23.0", "gix-config-value", - "gix-glob", + "gix-glob 0.17.0", "gix-path", "thiserror", ] [[package]] name = "gix-quote" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbff4f9b9ea3fa7a25a70ee62f545143abef624ac6aa5884344e70c8b0a1d9ff" +checksum = "f89f9a1525dcfd9639e282ea939f5ab0d09d93cf2b90c1fc6104f1b9582a8e49" dependencies = [ "bstr", "gix-utils", @@ -1648,13 +1629,13 @@ checksum = "3394a2997e5bc6b22ebc1e1a87b41eeefbcfcff3dbfa7c4bd73cb0ac8f1f3e2e" dependencies = [ "gix-actor 0.31.5", "gix-date 0.8.7", - "gix-features", - "gix-fs", - "gix-hash", - "gix-lock", + "gix-features 0.38.2", + "gix-fs 0.11.3", + "gix-hash 0.14.2", + "gix-lock 14.0.0", "gix-object 0.42.3", "gix-path", - "gix-tempfile", + "gix-tempfile 14.0.2", "gix-utils", "gix-validate 0.8.5", "memmap2", @@ -1664,20 +1645,20 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae0d8406ebf9aaa91f55a57f053c5a1ad1a39f60fdf0303142b7be7ea44311e5" +checksum = "a47385e71fa2d9da8c35e642ef4648808ddf0a52bc93425879088c706dfeaea2" dependencies = [ - "gix-actor 0.32.0", - "gix-features", - "gix-fs", - "gix-hash", - "gix-lock", - "gix-object 0.44.0", + "gix-actor 0.33.0", + "gix-features 0.39.0", + "gix-fs 0.12.0", + "gix-hash 0.15.0", + "gix-lock 15.0.0", + "gix-object 0.45.0", "gix-path", - "gix-tempfile", + "gix-tempfile 15.0.0", "gix-utils", - "gix-validate 0.9.0", + "gix-validate 0.9.1", "memmap2", "thiserror", "winnow", @@ -1685,30 +1666,32 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb005f82341ba67615ffdd9f7742c87787544441c88090878393d0682869ca6" +checksum = "0022038a09d80d9abf773be8efcbb502868d97f6972b8633bfb52ab6edaac442" dependencies = [ "bstr", - "gix-hash", + "gix-hash 0.15.0", "gix-revision", - "gix-validate 0.9.0", + "gix-validate 0.9.1", "smallvec", "thiserror", ] [[package]] name = "gix-revision" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4621b219ac0cdb9256883030c3d56a6c64a6deaa829a92da73b9a576825e1e" +checksum = "4ee8eb4088fece3562af4a5d751e069f90e93345524ad730512185234c4b55f1" dependencies = [ + "bitflags 2.6.0", "bstr", - "gix-date 0.9.0", - "gix-hash", - "gix-hashtable", - "gix-object 0.44.0", - "gix-revwalk 0.15.0", + "gix-commitgraph 0.25.0", + "gix-date 0.9.1", + "gix-hash 0.15.0", + "gix-hashtable 0.6.0", + "gix-object 0.45.0", + "gix-revwalk 0.16.0", "gix-trace", "thiserror", ] @@ -1719,10 +1702,10 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b030ccaab71af141f537e0225f19b9e74f25fefdba0372246b844491cab43e0" dependencies = [ - "gix-commitgraph", + "gix-commitgraph 0.24.3", "gix-date 0.8.7", - "gix-hash", - "gix-hashtable", + "gix-hash 0.14.2", + "gix-hashtable 0.5.2", "gix-object 0.42.3", "smallvec", "thiserror", @@ -1730,24 +1713,24 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41e72544b93084ee682ef3d5b31b1ba4d8fa27a017482900e5e044d5b1b3984" +checksum = "e6c9a9496da98d36ff19063a8576bf09a87425583b709a56dc5594fffa9d39b2" dependencies = [ - "gix-commitgraph", - "gix-date 0.9.0", - "gix-hash", - "gix-hashtable", - "gix-object 0.44.0", + "gix-commitgraph 0.25.0", + "gix-date 0.9.1", + "gix-hash 0.15.0", + "gix-hashtable 0.6.0", + "gix-object 0.45.0", "smallvec", "thiserror", ] [[package]] name = "gix-sec" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" +checksum = "a2007538eda296445c07949cf04f4a767307d887184d6b3e83e2d636533ddc6e" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -1757,32 +1740,32 @@ dependencies = [ [[package]] name = "gix-status" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f70d35ba639f0c16a6e4cca81aa374a05f07b23fa36ee8beb72c100d98b4ffea" +checksum = "57414886e750161b4c86d8bca6b2d15bcc87f37ddc46684bb05cebbd29390543" dependencies = [ "bstr", "filetime", "gix-diff", "gix-dir", - "gix-features", + "gix-features 0.39.0", "gix-filter", - "gix-fs", - "gix-hash", - "gix-index 0.35.0", - "gix-object 0.44.0", + "gix-fs 0.12.0", + "gix-hash 0.15.0", + "gix-index 0.36.0", + "gix-object 0.45.0", "gix-path", "gix-pathspec", - "gix-worktree 0.36.0", + "gix-worktree 0.37.0", "portable-atomic", "thiserror", ] [[package]] name = "gix-submodule" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529d0af78cc2f372b3218f15eb1e3d1635a21c8937c12e2dd0b6fc80c2ca874b" +checksum = "3ed099621873cd36c580fc822176a32a7e50fef15a5c2ed81aaa087296f0497a" dependencies = [ "bstr", "gix-config", @@ -1799,16 +1782,29 @@ version = "14.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046b4927969fa816a150a0cda2e62c80016fe11fb3c3184e4dddf4e542f108aa" dependencies = [ - "dashmap 6.1.0", - "gix-fs", + "gix-fs 0.11.3", "libc", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "signal-hook", "signal-hook-registry", "tempfile", ] +[[package]] +name = "gix-tempfile" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2feb86ef094cc77a4a9a5afbfe5de626897351bbbd0de3cb9314baf3049adb82" +dependencies = [ + "dashmap", + "gix-fs 0.12.0", + "libc", + "once_cell", + "parking_lot", + "tempfile", +] + [[package]] name = "gix-testtools" version = "0.15.0" @@ -1820,16 +1816,16 @@ dependencies = [ "fastrand", "fs_extra", "gix-discover 0.32.0", - "gix-fs", - "gix-ignore", + "gix-fs 0.11.3", + "gix-ignore 0.11.4", "gix-index 0.33.1", - "gix-lock", - "gix-tempfile", + "gix-lock 14.0.0", + "gix-tempfile 14.0.2", "gix-worktree 0.34.1", "io-close", "is_ci", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "tar", "tempfile", "winnow", @@ -1837,9 +1833,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" +checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" [[package]] name = "gix-traverse" @@ -1848,10 +1844,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e499a18c511e71cf4a20413b743b9f5bcf64b3d9e81e9c3c6cd399eae55a8840" dependencies = [ "bitflags 2.6.0", - "gix-commitgraph", + "gix-commitgraph 0.24.3", "gix-date 0.8.7", - "gix-hash", - "gix-hashtable", + "gix-hash 0.14.2", + "gix-hashtable 0.5.2", "gix-object 0.42.3", "gix-revwalk 0.13.2", "smallvec", @@ -1860,40 +1856,39 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030da39af94e4df35472e9318228f36530989327906f38e27807df305fccb780" +checksum = "f20f1b13cc4fa6ba92b24e6aa0c2fb6a34beb4458ef88c6300212db504e818df" dependencies = [ "bitflags 2.6.0", - "gix-commitgraph", - "gix-date 0.9.0", - "gix-hash", - "gix-hashtable", - "gix-object 0.44.0", - "gix-revwalk 0.15.0", + "gix-commitgraph 0.25.0", + "gix-date 0.9.1", + "gix-hash 0.15.0", + "gix-hashtable 0.6.0", + "gix-object 0.45.0", + "gix-revwalk 0.16.0", "smallvec", "thiserror", ] [[package]] name = "gix-url" -version = "0.27.5" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd280c5e84fb22e128ed2a053a0daeacb6379469be6a85e3d518a0636e160c89" +checksum = "33e7c297c3265015c133a2c02199610b6e1373a09dc4be057d0c1b5285737f06" dependencies = [ "bstr", - "gix-features", + "gix-features 0.39.0", "gix-path", - "home", "thiserror", "url", ] [[package]] name = "gix-utils" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" +checksum = "ba427e3e9599508ed98a6ddf8ed05493db114564e338e41f6a996d2e4790335f" dependencies = [ "bstr", "fastrand", @@ -1912,9 +1907,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f2badbb64e57b404593ee26b752c26991910fd0d81fe6f9a71c1a8309b6c86" +checksum = "e187b263461bc36cea17650141567753bc6207d036cedd1de6e81a52f277ff68" dependencies = [ "bstr", "thiserror", @@ -1927,12 +1922,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26f7326ebe0b9172220694ea69d344c536009a9b98fb0f9de092c440f3efe7a6" dependencies = [ "bstr", - "gix-attributes", - "gix-features", - "gix-fs", - "gix-glob", - "gix-hash", - "gix-ignore", + "gix-attributes 0.22.5", + "gix-features 0.38.2", + "gix-fs 0.11.3", + "gix-glob 0.16.5", + "gix-hash 0.14.2", + "gix-ignore 0.11.4", "gix-index 0.33.1", "gix-object 0.42.3", "gix-path", @@ -1941,21 +1936,21 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c312ad76a3f2ba8e865b360d5cb3aa04660971d16dec6dd0ce717938d903149a" +checksum = "0d345e5b523550fe4fa0e912bf957de752011ccfc87451968fda1b624318f29c" dependencies = [ "bstr", - "gix-attributes", - "gix-features", - "gix-fs", - "gix-glob", - "gix-hash", - "gix-ignore", - "gix-index 0.35.0", - "gix-object 0.44.0", + "gix-attributes 0.23.0", + "gix-features 0.39.0", + "gix-fs 0.12.0", + "gix-glob 0.17.0", + "gix-hash 0.15.0", + "gix-ignore 0.12.0", + "gix-index 0.36.0", + "gix-object 0.45.0", "gix-path", - "gix-validate 0.9.0", + "gix-validate 0.9.1", ] [[package]] @@ -1970,7 +1965,7 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "bstr", "log", "regex-automata", @@ -1988,30 +1983,6 @@ dependencies = [ "walkdir", ] -[[package]] -name = "grep-matcher" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3141a10a43acfedc7c98a60a834d7ba00dfe7bec9071cbfc19b55b292ac02" -dependencies = [ - "memchr", -] - -[[package]] -name = "grep-searcher" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b6c14b3fc2e0a107d6604d3231dec0509e691e62447104bc385a46a7892cda" -dependencies = [ - "bstr", - "encoding_rs", - "encoding_rs_io", - "grep-matcher", - "log", - "memchr", - "memmap2", -] - [[package]] name = "half" version = "2.4.1" @@ -2047,21 +2018,6 @@ 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.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hermit-abi" version = "0.4.0" @@ -2093,44 +2049,6 @@ dependencies = [ "uuid", ] -[[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.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "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 = "idna" version = "0.5.0" @@ -2193,6 +2111,8 @@ checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", + "rayon", + "serde", ] [[package]] @@ -2210,15 +2130,6 @@ dependencies = [ "similar", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "inventory" version = "0.3.15" @@ -2241,7 +2152,7 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi", "libc", "windows-sys 0.52.0", ] @@ -2352,12 +2263,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - [[package]] name = "libredox" version = "0.1.3" @@ -2366,7 +2271,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.4", + "redox_syscall", ] [[package]] @@ -2477,16 +2382,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - [[package]] name = "num_threads" version = "0.1.7" @@ -2518,13 +2413,14 @@ dependencies = [ "anyhow", "askalono", "byte-unit", - "clap 4.5.17", + "clap", "clap_complete", "criterion", "crossbeam-channel", "enable-ansi-support", + "gengo", "gix", - "gix-features", + "gix-features 0.39.0", "gix-testtools", "globset", "human-panic", @@ -2545,7 +2441,6 @@ dependencies = [ "tera", "time", "time-humanize", - "tokei", "typetag", "winres", ] @@ -2563,7 +2458,7 @@ version = "2.22.0" dependencies = [ "anyhow", "base64", - "clap 4.5.17", + "clap", "color_quant", "image", "libc", @@ -2602,17 +2497,6 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[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 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -2620,21 +2504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[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 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -2645,20 +2515,11 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.4", + "redox_syscall", "smallvec", "windows-targets", ] -[[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" @@ -2716,44 +2577,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] - [[package]] name = "pin-project-lite" version = "0.2.14" @@ -2881,6 +2704,16 @@ version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "744a264d26b88a6a7e37cbad97953fa233b94d585236310bcbc88474b4092d79" +[[package]] +name = "prodash" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a266d8d6020c61a437be704c5e618037588e1985c7dbb7bf8d265db84cffe325" +dependencies = [ + "log", + "parking_lot", +] + [[package]] name = "ptr_meta" version = "0.1.4" @@ -2975,15 +2808,6 @@ dependencies = [ "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_syscall" version = "0.5.4" @@ -2993,24 +2817,13 @@ dependencies = [ "bitflags 2.6.0", ] -[[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.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "memchr", "regex-automata", "regex-syntax", @@ -3022,7 +2835,7 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "memchr", "regex-syntax", ] @@ -3332,12 +3145,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "slab" version = "0.4.9" @@ -3347,16 +3154,6 @@ dependencies = [ "autocfg", ] -[[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.13.2" @@ -3378,12 +3175,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[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" @@ -3481,50 +3272,16 @@ version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab9d851b45e865f178319da0abdbfe6acbc4328759ff18dafc3a41c16b4cd2ee" dependencies = [ - "chrono", - "chrono-tz", "globwalk", - "humansize", "lazy_static", - "percent-encoding", "pest", "pest_derive", - "rand", "regex", "serde", "serde_json", - "slug", "unic-segment", ] -[[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.63" @@ -3623,34 +3380,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[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 4.0.2", - "dirs", - "encoding_rs_io", - "env_logger", - "grep-searcher", - "ignore", - "log", - "num-format", - "once_cell", - "parking_lot 0.11.2", - "rayon", - "regex", - "serde", - "serde_json", - "tera", - "term_size", - "toml 0.5.11", -] - [[package]] name = "toml" version = "0.5.11" @@ -3822,12 +3551,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -3866,12 +3589,6 @@ dependencies = [ "getrandom", ] -[[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" @@ -3996,15 +3713,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.42.0" diff --git a/Cargo.toml b/Cargo.toml index f19bcdaeb..d43a0fa24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,14 +36,15 @@ byte-unit = "5.1.4" clap.workspace = true clap_complete = "4.5.26" crossbeam-channel = "0.5.13" -gix = { version = "0.66.0", default-features = false, features = [ +gengo = { version = "0.11.5", default-features = false, features = ["max-performance-safe"] } +gix = { version = "0.67.0", default-features = false, features = [ "max-performance-safe", "blob-diff", "mailmap", "index", "status", ] } -gix-features = { version = "0.38.0", features = ["zlib-ng"] } +gix-features = { version = "0.39.0", features = ["zlib-ng"] } globset = "0.4.15" human-panic = "2.0.1" image.workspace = true @@ -61,7 +62,6 @@ serde_yaml = "0.9.34" strum.workspace = true time = { version = "0.3.36", features = ["formatting"] } time-humanize = { version = "0.1.3", features = ["time"] } -tokei = "12.1.2" typetag = "0.2" [dev-dependencies] diff --git a/docs/onefetch.1 b/docs/onefetch.1 index 9988621e7..c701ee1d2 100644 --- a/docs/onefetch.1 +++ b/docs/onefetch.1 @@ -87,7 +87,7 @@ Count hidden files and directories .IP Filters output by language type .IP -[default: programming markup] +[default: programming markup query] [possible values: programming, markup, prose, data] .SS "TEXT FORMATTING:" .HP diff --git a/languages.yaml b/languages.yaml index 68d19df57..feeedf182 100644 --- a/languages.yaml +++ b/languages.yaml @@ -16,7 +16,7 @@ Abap: - "#1B387D" - "#EEEEEE" chip: "#E8274B" -ABNF: +Abnf: type: data ascii: | {0} ______ @@ -141,7 +141,7 @@ Assembly: - green chip: "#6E4C13" icon: '\u{E6AB}' -AutoHotKey: +Autohotkey: type: programming ascii: | {1} .----------------. @@ -163,32 +163,6 @@ AutoHotKey: - "#FFFFFF" - "#119810" chip: "#6594B9" -Bash: - type: programming - ascii: | - {0} _._ - {0} _.-' '-._ - {0} _.-' '-._ - {0} _.-' '-._ - {0}| _,-| - {0}| _,-'+++| - {0}| _,-'+++++++| - {0}| ,-'+++++++++++| - {0}| |++++ ++++++++| - {0}| |+++ +++++++| - {0}| |++ +++++++++| - {0}| |++++ +++{1}**{0}++| - {0}| |++ ++{1}**{0}++++| - {0}'-,_ |+++ ++++++_,-' - {0} '-,_ |++++++_,-' - {0} '-,_ |++_,-' - {0} '-|-' - colors: - ansi: - - white - - green - chip: "#89E051" - icon: '\u{EBCA}' C: type: programming ascii: | @@ -287,7 +261,7 @@ Clojure: - green chip: "#DB5855" icon: '\u{E768}' -CMake: +Cmake: type: programming ascii: | {0} ;e{2}` @@ -310,7 +284,7 @@ CMake: - red - black chip: "#DA3434" -CoffeeScript: +Coffeescript: type: programming ascii: | {0} ##### ###### @@ -332,7 +306,7 @@ CoffeeScript: - red chip: "#244776" icon: '\u{E751}' -ColdFusion: +Coldfusion: type: programming ascii: | {0}CfCfCfCfCfCfCfCfCfCfCfCfCfCfCfCfCfCf @@ -360,6 +334,34 @@ ColdFusion: - "#274550" chip: "#ed2cd6" icon: '\u{E645}' +CommonLisp: + type: programming + ascii: | + {0} ............ + {0} ********.............. + {0} *************............. + {0} ****************.............. + {0} *******************...***......... + {0} **...********...*****...***......... + {0} ***...*******...******....***......... + {0}****...******...*******....****......... + {0}*****...****...*******.....*****........ + {0}******...**...******.......******....... + {0}*******......******.......***..***...... + {0}********.....*****.......***....***..... + {0}*********....****.......***......***.... + {0} *********...****......***.......***... + {0} *********...***.....***........***.. + {0} *********...***................... + {0} **************................ + {0} *************............. + {0} **************........ + {0} ************ + colors: + ansi: + - white + chip: "#3FB68B" + icon: '\u{E6B0}' Coq: type: programming ascii: | @@ -388,7 +390,7 @@ Coq: - "#BF8C5E" - "#D5BE99" chip: "#D0B68C" -Cpp: +CPlusPlus: type: programming ascii: | {0} ++++++ @@ -582,7 +584,7 @@ Dart: - "#01597D" chip: "#00B4AB" icon: '\u{E64C}' -Dockerfile: +Docker: type: programming ascii: | {2} ## {0} . @@ -600,7 +602,7 @@ Dockerfile: - cyan chip: "#384D54" icon: '\u{F308}' -Elisp: +EmacsLisp: type: programming ascii: | {0} ':r\iv7i|r:' @@ -883,7 +885,7 @@ FSharp: chip: "#B845FC" icon: '\u{E7A7}' serialization: f# -GdScript: +Gdscript: type: programming ascii: | {0} _.aMb dMe._ @@ -1167,7 +1169,7 @@ Hlsl: - "#FFBB00" chip: "#AACE60" icon: '\u{229E}' -HolyC: +Holyc: type: programming ascii: | {0} ======== @@ -1294,7 +1296,7 @@ Java: - "#1665C0" chip: "#B07219" icon: '\u{E738}' -JavaScript: +Javascript: type: programming ascii: | {0}JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS @@ -1382,38 +1384,6 @@ Jsonnet: - white - black chip: "#0064BD" -Jsx: - type: programming - ascii: | - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJSX{1}JSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJS{1}XJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJ{1}SXJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJSX{1}JSXJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJS{1}XJSXJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJSXJ{1}SXJSXJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJSX{1}JSXJSXJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJS{1}XJSXJSXJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSXJ{1}SXJSXJSXJSX - {0}JSXJSXJSXJSXJSXJSXJSXJSXJSX{1}JSXJSXJSXJSX - {0}JSXJSXJ SXJS XJSXJS{1}X{2}JSX{1}JSX{2}JSX{1}JSX - {0}JSXJSXJ SXJ SXJSXJSXJ{1}SXJ{2}SXJ{1}S{2}XJS{1}XJSX - {0}JSXJSXJ SXJS XJSXJSX{1}JSXJSX{2}JSX{1}JSXJSX - {0}JSXJSXJ SXJSX JSXJS{1}XJSXJS{2}XJSXJ{1}SXJSX - {0}JS XJ SXJSXJ SXJ{1}SXJSXJ{2}SXJ{1}S{2}XJS{1}XJSX - {0}JSX JS XJS{1}XJSXJS{2}XJS{1}XJS{2}XJS{1}XJS - {0}JSXJSXJSXJSXJSXJSXJS{1}XJSXJSXJSXJSXJSXJSX - {0}JSXJSXJSXJSXJSXJSXJ{1}SXJSXJSXJSXJSXJSXJSX - colors: - ansi: - - yellow - - magenta - - white - hex: - - "#ECE653" - - "#B684D3" - - "#FFFFFF" - chip: "#F1E05A" - icon: '\u{F2EE}' Julia: type: programming ascii: | @@ -1434,7 +1404,7 @@ Julia: - magenta chip: "#A270BA" icon: '\u{E624}' -Jupyter: +JupyterNotebook: type: programming ascii: | {0} +%%%+ @@ -1501,35 +1471,7 @@ Kotlin: - magenta chip: "#A97BFF" icon: '\u{E634}' -Lisp: - type: programming - ascii: | - {0} ............ - {0} ********.............. - {0} *************............. - {0} ****************.............. - {0} *******************...***......... - {0} **...********...*****...***......... - {0} ***...*******...******....***......... - {0}****...******...*******....****......... - {0}*****...****...*******.....*****........ - {0}******...**...******.......******....... - {0}*******......******.......***..***...... - {0}********.....*****.......***....***..... - {0}*********....****.......***......***.... - {0} *********...****......***.......***... - {0} *********...***.....***........***.. - {0} *********...***................... - {0} **************................ - {0} *************............. - {0} **************........ - {0} ************ - colors: - ansi: - - white - chip: "#3FB68B" - icon: '\u{E6B0}' -LLVM: +Llvm: type: programming ascii: | {0}KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK @@ -1723,7 +1665,7 @@ ObjectiveC: - blue chip: "#438EFF" serialization: objective-c -OCaml: +Ocaml: type: programming ascii: | {0}/////////////////////////////////////// @@ -1879,42 +1821,6 @@ Perl: - cyan chip: "#0298C3" icon: '\u{E67E}' -Perl6: - type: programming - ascii: | - {0} +@8DM#8W, - {0}#DM"{1},ypy,{0}"8# - {0}DDU {1}8M]N8u{0} DM - {0}8DD {1}TMD8M,{0}8M {4}8 - {0} 8D#=e@8MM^ {4}8 - {0} *MDw {4},.,+#M` - {0} "8# {0},e88DDDD8m, - {0} "8 {3}x33#, {0}z8D#M`9Dw "9DW - {3} JE E {2}BBW. {0}DM {1}p#Kw {0}D8 {0}JDM - {1} #pp#pr {3} JRFMy{2}#EEF{3}y#Rr, {0}DM{1} MD]8 {0}9DM {4}`N - {1}Z#{0}8#D]{1}D# {2}EE#EEEEE{3}`EW E {0}8M,{1}"RM`{0} 8DM {4}D - {1}88{0}8]D]{1}D8 {2}EEM{1}#{2}EEE{1}E{2}Bp{3}TFF^ {0}*M888#` {4}#M - {1}*#88EE8 {2} RRk{1}8BMM{2}#EEE, {4}'^' - {1} `` {2}'"F*FFF* {1},yw, - {1} ,#]{0}[D8{1}8W - {1} k8{0}]DDN8{1}8L - {1} '8E{0}$DE8{1}8M - {1} R#E#R^ - colors: - ansi: - - blue - - red - - yellow - - white - - green - hex: - - "#5B00FD" - - "#FF005E" - - "#F3FF27" - - "#FFFFFF" - - "#00FF39" - chip: "#0000FB" - serialization: raku Php: type: programming ascii: | @@ -1937,7 +1843,7 @@ Php: - "#FFFFFF" chip: "#4F5D95" icon: '\u{f031f}' -PowerShell: +Powershell: type: programming ascii: | {0} ######################### @@ -2012,7 +1918,7 @@ Prolog: - white chip: "#74283C" icon: '\u{E7A1}' -Protobuf: +ProtocolBuffer: type: programming ascii: | {0} ;;;;;;;; {2}:::::::: @@ -2036,7 +1942,7 @@ Protobuf: - yellow chip: "#74283C" serialization: protocol-buffers -PureScript: +Purescript: type: programming ascii: | {0} \\\\\\\\\\\\\\ \\\\\ @@ -2171,7 +2077,43 @@ Racket: - white - blue chip: "#3C5CAA" -Renpy: +Raku: + type: programming + ascii: | + {0} +@8DM#8W, + {0}#DM"{1},ypy,{0}"8# + {0}DDU {1}8M]N8u{0} DM + {0}8DD {1}TMD8M,{0}8M {4}8 + {0} 8D#=e@8MM^ {4}8 + {0} *MDw {4},.,+#M` + {0} "8# {0},e88DDDD8m, + {0} "8 {3}x33#, {0}z8D#M`9Dw "9DW + {3} JE E {2}BBW. {0}DM {1}p#Kw {0}D8 {0}JDM + {1} #pp#pr {3} JRFMy{2}#EEF{3}y#Rr, {0}DM{1} MD]8 {0}9DM {4}`N + {1}Z#{0}8#D]{1}D# {2}EE#EEEEE{3}`EW E {0}8M,{1}"RM`{0} 8DM {4}D + {1}88{0}8]D]{1}D8 {2}EEM{1}#{2}EEE{1}E{2}Bp{3}TFF^ {0}*M888#` {4}#M + {1}*#88EE8 {2} RRk{1}8BMM{2}#EEE, {4}'^' + {1} `` {2}'"F*FFF* {1},yw, + {1} ,#]{0}[D8{1}8W + {1} k8{0}]DDN8{1}8L + {1} '8E{0}$DE8{1}8M + {1} R#E#R^ + colors: + ansi: + - blue + - red + - yellow + - white + - green + hex: + - "#5B00FD" + - "#FF005E" + - "#F3FF27" + - "#FFFFFF" + - "#00FF39" + chip: "#0000FB" + serialization: raku +RenPy: type: programming ascii: | {0} ++++++ @@ -2367,7 +2309,7 @@ Scheme: - "#555555" chip: "#1E4AEC" icon: '\u{E6B1}' -Sh: +Shell: type: programming ascii: | {0} ___ ___ ___ @@ -2569,7 +2511,7 @@ Swift: - "#FD2822" chip: "#F05138" icon: '\u{E755}' -SystemVerilog: +Systemverilog: type: programming ascii: | {0} _.._ _.._ _.._ _.._ @@ -2683,39 +2625,7 @@ Toml: - "#FFFFFF" chip: "#9C4221" icon: '\u{E6B2}' -Tsx: - type: programming - ascii: | - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTSXTSXTSX{1}TSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTSXTSXTS{1}XTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTSXTSXT{1}SXTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTSXTSX{1}TSXTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTSXTS{1}XTSXTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTSXT{1}SXTSXTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTSX{1}TSXTSXTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXTS{1}XTSXTSXTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSXT{1}SXTSXTSXTSX - {0}TSXTSXTSXTSXTSXTSXTSXTSXTSX{1}TSXTSXTSXTSX - {0}TS{2}XTSXTSXTS{0}XTSX{2}TSXTSX{0}TSXTS{1}X{2}TSX{1}TSX{2}TSX{1}TSX - {0}TSXTS{2}XTS{0}XTSXTS{2}XTS{0}XTSXTSXT{1}SXT{2}SXT{1}S{2}XTS{1}XTSX - {0}TSXTS{2}XTS{0}XTSXTSX{2}TSX{0}TSXTSX{1}TSXTSX{2}TSX{1}TSXTSX - {0}TSXTS{2}XTS{0}XTSXTSXT{2}SXT{0}SXTS{1}XTSXTS{2}XTSXT{1}TSTSX - {0}TSXTS{2}XTS{0}XTSXTSXTS{2}XTS{0}XT{1}SXTSXT{2}SXT{1}S{2}XTS{1}XTSX - {0}TSXTS{2}XTS{0}XTSXT{2}SXTSXT{0}SX{1}TSXTSX{2}TSX{1}TSX{2}TSX{1}TSX - {0}TSXTSXTSXTSXTSXTSXTS{1}XTSXTSXTSXTSXTSXTSX - {0}TSXTSXTSXTSXTSXTSXT{1}SXTSXTSXTSXTSXTSXTSX - colors: - ansi: - - cyan - - magenta - - white - hex: - - "#007ACC" - - "#8A53A6" - - "#FFFFFF" - chip: "#2B7489" - icon: '\u{E69D}' -TypeScript: +Typescript: type: programming ascii: | {0}TSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTS @@ -2903,7 +2813,7 @@ Vue: - blue chip: "#199F4B" icon: '\u{E6A0}' -WebAssembly: +Webassembly: type: programming ascii: | {0}::::::::::: :::::::::::: @@ -3007,7 +2917,7 @@ Xml: - green chip: "#0060AC" icon: '\u{f05c0}' -XSL: +Xsl: type: programming ascii: | {0} ::: @@ -3067,24 +2977,3 @@ Zig: - yellow chip: "#EC915C" icon: '\u{E6A9}' -Zsh: - type: programming - ascii: | - {0}ZSHZSHZSHZSHZSHZSHZSHZSHZSHZSHZS - {0}ZSHZSHZSHZSHZSHZSHZSHZSHZSHZSHZS - {0}ZSHZ ZSHZSHZSHZSHZSHZSHZSHZS - {0}ZSHZSH SHZSHZSHZSHZSHZSHZSHZ - {0}ZSHZSHZS SHZSHZSHZSHZSHZSHZS - {0}ZSHZSHZSHZ HZSHZSHZSHZSHZSHZ - {0}ZSHZSHZSHZSH ZSHZSHZSHZSHZSH - {0}ZSHZSHZSHZ SHZSHZSHZSHZSHZSH - {0}ZSHZSHZS ZSHZSHZSHZSHZSHZSHZ - {0}ZSHZSH SHZSHZSHZSHZSHZSHZSHZ - {0}ZSHZ ZSHZSH SHZS - {0}ZSHZSHZSHZSHZSHZSHZSHZSHZSHZSHZS - {0}ZSHZSHZSHZSHZSHZSHZSHZSHZSHZSHZS - colors: - ansi: - - white - chip: "#89E051" - icon: '\u{f1183}' diff --git a/src/cli.rs b/src/cli.rs index df2e481ff..15c66f905 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -104,7 +104,7 @@ pub struct InfoCliOptions { #[arg( long, num_args = 1.., - default_values = &["programming", "markup"], + default_values = &["programming", "markup", "query"], short = 'T', value_enum, )] @@ -264,7 +264,7 @@ impl Default for InfoCliOptions { http_url: Default::default(), hide_token: Default::default(), include_hidden: Default::default(), - r#type: vec![LanguageType::Programming, LanguageType::Markup], + r#type: LanguageType::DEFAULT_ARGS.to_vec(), disabled_fields: Vec::default(), no_title: Default::default(), } @@ -393,7 +393,7 @@ mod test { }, ascii: AsciiCliOptions { ascii_colors: vec![5, 0], - ascii_language: Some(Language::Lisp), + ascii_language: Some(Language::CommonLisp), ..Default::default() }, visuals: VisualsCliOptions { @@ -419,7 +419,7 @@ mod test { "url", "--no-art", "--ascii-language", - "lisp" + "commonlisp" ]) ); } diff --git a/src/info/git/mod.rs b/src/info/git/mod.rs index 8645b8c0b..78ecec0e5 100644 --- a/src/info/git/mod.rs +++ b/src/info/git/mod.rs @@ -4,10 +4,11 @@ use crate::cli::MyRegex; use anyhow::Result; use gix::bstr::ByteSlice; use gix::bstr::{BString, Utf8Error}; -use gix::object::tree::diff::change::Event; use gix::object::tree::diff::Action; +use gix::object::tree::diff::Change; use gix::prelude::ObjectIdExt; -use gix::traverse::commit::simple::Sorting; +use gix::revision::walk::Sorting; +use gix::traverse::commit::simple::CommitTimeOrder; use gix::{Commit, ObjectId}; use std::collections::HashMap; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; @@ -41,7 +42,7 @@ pub fn traverse_commit_graph( .head_commit()? .id() .ancestors() - .sorting(Sorting::ByCommitTimeNewestFirst) + .sorting(Sorting::ByCommitTime(CommitTimeOrder::NewestFirst)) .use_commit_graph(can_use_author_threads) .with_commit_graph(commit_graph) .all()?; @@ -260,17 +261,17 @@ fn compute_diff_with_parent( .object()? .into_tree() .changes()? - .track_path() - .track_rewrites(None) + .options(|options| { + options.track_path().track_rewrites(None); + }) .for_each_to_obtain_tree(&commit.tree()?, |change| { - let is_file_change = match change.event { - Event::Addition { entry_mode, .. } | Event::Modification { entry_mode, .. } => { - entry_mode.is_blob() - } - Event::Deletion { .. } | Event::Rewrite { .. } => false, + let is_file_change = match change { + Change::Addition { entry_mode, .. } + | Change::Modification { entry_mode, .. } => entry_mode.is_blob(), + Change::Deletion { .. } | Change::Rewrite { .. } => false, }; if is_file_change { - let path = change.location; + let path = change.location(); *change_map.entry(path.to_owned()).or_insert(0) += 1; } diff --git a/src/info/langs/language.rs b/src/info/langs/language.rs index 11d1952ba..766164362 100644 --- a/src/info/langs/language.rs +++ b/src/info/langs/language.rs @@ -1,10 +1,49 @@ use crate::info::utils::info_field::InfoField; +use clap::builder::PossibleValue; +use gengo::language::Category; use owo_colors::OwoColorize; use serde::Serialize; -use tokei; include!(concat!(env!("OUT_DIR"), "/language.rs")); +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct LanguageType(pub Category); + +impl LanguageType { + pub(crate) const DEFAULT_ARGS: [Self; 3] = [ + Self(Category::Programming), + Self(Category::Markup), + Self(Category::Query), + ]; + // pub(crate) const VARIANTS: [Self;5] +} + +impl clap::ValueEnum for LanguageType { + fn value_variants<'a>() -> &'a [Self] { + use Category::*; + &[ + Self(Programming), + Self(Markup), + Self(Prose), + Self(Data), + Self(Query), + ] + } + + fn to_possible_value(&self) -> Option { + use Category::*; + let possible_value = match self.0 { + Programming => "programming", + Markup => "markup", + Prose => "prose", + Data => "data", + Query => "query", + _ => return None, + }; + Some(PossibleValue::new(possible_value)) + } +} + const LANGUAGES_BAR_LENGTH: usize = 26; #[derive(Serialize)] @@ -29,15 +68,15 @@ pub struct LanguagesInfo { impl LanguagesInfo { pub fn new( - loc_by_language: &[(Language, usize)], + size_by_language: &[(Language, usize)], true_color: bool, number_of_languages_to_display: usize, info_color: DynColors, nerd_fonts: bool, ) -> Self { - let total: usize = loc_by_language.iter().map(|(_, v)| v).sum(); + let total: usize = size_by_language.iter().map(|(_, v)| v).sum(); - let weight_by_language: Vec<(Language, f64)> = loc_by_language + let weight_by_language: Vec<(Language, f64)> = size_by_language .iter() .map(|(k, v)| { let mut val = *v as f64; @@ -202,27 +241,6 @@ impl InfoField for LanguagesInfo { } } -/// Counts the lines-of-code of a tokei `Language`. Takes into -/// account that a prose language's comments *are* its code. -pub fn loc(language_type: &tokei::LanguageType, language: &tokei::Language) -> usize { - __loc(language_type, language) - + language - .children - .iter() - .fold(0, |sum, (lang_type, reports)| { - sum + reports - .iter() - .fold(0, |sum, report| sum + stats_loc(lang_type, &report.stats)) - }) -} - -/// Counts the lines-of-code of a tokei `Report`. This is the child of a -/// `tokei::CodeStats`. -pub fn stats_loc(language_type: &tokei::LanguageType, stats: &tokei::CodeStats) -> usize { - let stats = stats.summarise(); - __stats_loc(language_type, &stats) -} - #[cfg(test)] mod test { use rstest::rstest; diff --git a/src/info/langs/language.tera b/src/info/langs/language.tera index c707dba55..11e91bad2 100644 --- a/src/info/langs/language.tera +++ b/src/info/langs/language.tera @@ -2,6 +2,7 @@ use owo_colors::{ AnsiColors, DynColors::{self, Ansi, Rgb}, }; +use std::convert::TryFrom; use std::fmt; use std::fmt::Write; use strum::EnumIter; @@ -13,14 +14,6 @@ pub struct Colors { const DEFAULT_CHIP_ICON: char = '\u{25CF}'; -#[derive(Clone, PartialEq, Eq, Debug, clap::ValueEnum)] -pub enum LanguageType { - Programming, - Markup, - Prose, - Data, -} - #[derive(Clone, Copy, PartialEq, Eq, Hash, EnumIter, clap::ValueEnum, Debug, Serialize)] #[allow(clippy::upper_case_acronyms)] #[clap(rename_all = "lowercase")] @@ -35,28 +28,30 @@ impl fmt::Display for Language { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { {% for language, _ in languages -%} - Self::{{ language }} => write!(f, "{}", tokei::LanguageType::{{ language }}.name()), + Self::{{ language }} => write!(f, "{}", gengo::Language::{{ language }}.name()), {% endfor %} } } } -impl From for Language { - fn from(language: tokei::LanguageType) -> Self { +impl TryFrom for Language { + type Error = (); + + fn try_from(language: gengo::Language) -> Result { match language { {% for language, _ in languages -%} - tokei::LanguageType::{{ language }} => Self::{{ language }}, + gengo::Language::{{ language }} => Ok(Self::{{ language }}), {% endfor %} - _ => unimplemented!("Language {:?}", language), + _ => Err(()), } } } -impl From for tokei::LanguageType { +impl From for gengo::Language { fn from(language: Language) -> Self { match language { {% for language, _ in languages -%} - Language::{{ language }} => tokei::LanguageType::{{ language }}, + Language::{{ language }} => gengo::Language::{{ language }}, {% endfor %} } } @@ -93,14 +88,6 @@ impl Language { } } - pub fn get_type(&self) -> LanguageType { - match self { - {% for language, attrs in languages -%} - Language::{{ language }} => LanguageType::{{ attrs.type | title }}, - {% endfor %} - } - } - pub fn get_chip_color(&self) -> DynColors { match self { {% for language, attrs in languages -%} @@ -123,29 +110,6 @@ impl Language { } } -fn __loc(language_type: &tokei::LanguageType, language: &tokei::Language) -> usize { - match language_type { - {% for language, attrs in languages -%} - {%- set line_types = attrs.line_types | default(value=['code']) -%} - tokei::LanguageType::{{ language }} => language.{{ line_types.0 }}{% for line_type in line_types | slice(start=1) %} + language.{{ line_type }}{% endfor %}, - {% endfor %} - _ => unimplemented!("Language Type {:?}", language_type), - } -} - - -fn __stats_loc(language_type: &tokei::LanguageType, stats: &tokei::CodeStats) -> usize { - match language_type { - {% for language, attrs in languages -%} - {%- set line_types = attrs.line_types | default(value=['code']) -%} - {%- if attrs.line_types -%} - tokei::LanguageType::{{ language }} => stats.{{ line_types.0 }}{% for line_type in line_types | slice(start=1) %} + stats.{{ line_type }}{% endfor %}, - {% endif -%} - {% endfor %} - _ => stats.code - } -} - {% for language, attrs in languages -%} {% if attrs.colors.rgb %} {% set ansi_length = attrs.colors.ansi | length -%} diff --git a/src/info/langs/mod.rs b/src/info/langs/mod.rs index 932ab8774..7893bfd87 100644 --- a/src/info/langs/mod.rs +++ b/src/info/langs/mod.rs @@ -1,211 +1,95 @@ -use anyhow::{Context, Result}; +use anyhow::{anyhow, Context, Result}; +use gengo::{Builder, Git}; + +use globset::{Glob, GlobSetBuilder}; use language::{Language, LanguageType}; use std::collections::HashMap; +use std::error::Error; use std::path::Path; -use strum::IntoEnumIterator; pub mod language; -pub fn get_main_language(loc_by_language: &[(Language, usize)]) -> Language { - loc_by_language[0].0 +pub fn get_main_language(size_by_language: &[(Language, usize)]) -> Result { + // TODO This function only works with an already-sorted slice, so it doesn't have much utility + let (language, _) = size_by_language + .get(0) + .context("Could not find any source code in this repository")?; + Ok(*language) } /// Returns a vector of tuples containing all the languages detected inside the repository. -/// Each tuple is composed of the language and its corresponding loc (lines of code). -/// The vector is sorted by loc in descending order. -pub fn get_loc_by_language_sorted( +/// Each tuple is composed of the language and its corresponding blob size. +/// The vector is sorted by size in descending order. +pub fn get_size_by_language_sorted( dir: &Path, globs_to_exclude: &[String], language_types: &[LanguageType], include_hidden: bool, ) -> Result> { - let stats = get_statistics(dir, globs_to_exclude, language_types, include_hidden); - - let loc_by_language = - get_loc_by_language(&stats).context("Could not find any source code in this repository")?; - - let loc_by_language_sorted = sort_by_loc(loc_by_language); - - Ok(loc_by_language_sorted) -} - -fn sort_by_loc(map: HashMap) -> Vec<(Language, usize)> { - let mut vec: Vec<(Language, usize)> = map.into_iter().collect(); - vec.sort_by(|a, b| b.1.cmp(&a.1)); - vec -} - -fn get_loc_by_language(languages: &tokei::Languages) -> Option> { - let mut loc_by_language = HashMap::new(); - - for (language_name, language) in languages.iter() { - let loc = language::loc(language_name, language); - - if loc == 0 { - continue; - } - - loc_by_language.insert(Language::from(*language_name), loc); - } - - let total_loc: usize = loc_by_language.values().sum(); - if total_loc == 0 { - None - } else { - Some(loc_by_language) - } -} + let globset = globs_to_exclude + .iter() + .filter_map(|glob| Glob::new(glob).ok()) + .fold(GlobSetBuilder::new(), |mut builder, glob| { + builder.add(glob); + builder + }) + .build()?; + let analysis = match get_statistics(dir) { + Ok(stats) => stats, + Err(e) => return Err(anyhow!("Could not analyze repository: {}", e)), + }; -pub fn get_total_loc(loc_by_language: &[(Language, usize)]) -> usize { - let total_loc: usize = loc_by_language.iter().map(|(_, v)| v).sum(); - total_loc + // NOTE If finer control is ever needed, summary_with can be used. + let mut size_by_language: Vec<(Language, _)> = analysis + .iter() + .filter(|(path, _)| include_hidden || !is_hidden(path)) + .filter(|(path, _)| !globset.is_match(path)) + .filter(|(_, entry)| { + let lang_type = LanguageType(entry.language().category()); + language_types.contains(&lang_type) + }) + .filter_map(|(_, entry)| { + let language = *entry.language(); + let language: Option = language.try_into().ok(); + language.map(|language: Language| (language, entry.size())) + }) + .fold(HashMap::new(), |mut acc, (language, size)| { + *acc.entry(language).or_insert(0) += size; + acc + }) + .into_iter() + .collect(); + // NOTE Sort by size (descending) first, then by language name (ascending) in case the size is equal + size_by_language.sort_by_key(|(language, size)| (usize::MAX - *size, language.to_string())); + + Ok(size_by_language) } -fn get_statistics( - dir: &Path, - globs_to_exclude: &[String], - language_types: &[LanguageType], - include_hidden: bool, -) -> tokei::Languages { - let mut languages = tokei::Languages::new(); - let filtered_languages = filter_languages_on_type(language_types); - - let tokei_config = tokei::Config { - types: Some(filtered_languages), - hidden: Some(include_hidden), - ..tokei::Config::default() - }; - let ignored: Vec<&str> = globs_to_exclude.iter().map(AsRef::as_ref).collect(); - languages.get_statistics(&[&dir], &ignored, &tokei_config); - languages +fn get_statistics(dir: &Path) -> Result> { + // TODO Determine best way to ignore files (and if that should continue to be handled by onefetch) + let file_source = Git::new(dir, "HEAD")?; + let gengo = Builder::new(file_source).build()?; + gengo.analyze() } -fn filter_languages_on_type(types: &[LanguageType]) -> Vec { - Language::iter() - .filter(|language| types.contains(&language.get_type())) - .map(std::convert::Into::into) - .collect() +/// Returns `true` if the file is or any of its containing directories are hidden. +fn is_hidden(path: impl AsRef) -> bool { + path.as_ref() + .components() + .any(|c| c.as_os_str().to_string_lossy().starts_with('.')) } #[cfg(test)] -mod test { - use super::*; - use tokei; - - #[test] - fn get_loc_by_language_counts_md_comments() { - let js = tokei::Language { - blanks: 25, - comments: 50, - code: 100, - ..Default::default() - }; - let js_type = tokei::LanguageType::JavaScript; - - let md = tokei::Language { - blanks: 50, - comments: 200, - code: 100, - ..Default::default() - }; - let md_type = tokei::LanguageType::Markdown; - - let mut languages = tokei::Languages::new(); - languages.insert(js_type, js); - languages.insert(md_type, md); - - let loc_by_language = get_loc_by_language(&languages).unwrap(); - - // NOTE: JS with 100 lines of code, MD with 300 lines of code + comments - assert_eq!(loc_by_language[&Language::JavaScript], 100); - assert_eq!(loc_by_language[&Language::Markdown], 300); - } - - #[test] - fn deeply_nested_total_loc() { - let mut bash_code_stats = tokei::CodeStats::new(); - // NOTE: When inside Markdown, comments should be counted as code - bash_code_stats.code = 5; - bash_code_stats.blanks = 1; - bash_code_stats.comments = 2; - - let mut md_code_stats = tokei::CodeStats::new(); - md_code_stats.code = 10; - md_code_stats.blanks = 2; - md_code_stats.comments = 4; - md_code_stats - .blobs - .insert(tokei::LanguageType::Bash, bash_code_stats); - // NOTE: This may break if tokei ever does more than just assign `name` to a field - let mut md_report = tokei::Report::new("/tmp/file.ipynb".into()); - md_report.stats = md_code_stats; - - let mut jupyter_notebook = tokei::Language::default(); - jupyter_notebook - .children - .insert(tokei::LanguageType::Markdown, vec![md_report]); - - let mut languages = tokei::Languages::new(); - languages.insert(tokei::LanguageType::Jupyter, jupyter_notebook); - - let loc_by_language = get_loc_by_language(&languages).unwrap(); - - assert_eq!(loc_by_language[&Language::Jupyter], 21); - } - - // https://github.com/o2sh/onefetch/issues/966 - #[test] - fn get_loc_by_language_should_not_panic_when_children_language_is_not_supported() { - let mut stylus_code_stats = tokei::CodeStats::new(); - stylus_code_stats.code = 10; - stylus_code_stats.blanks = 2; - stylus_code_stats.comments = 4; - - let mut stylus_report = tokei::Report::new("/tmp/file.vue".into()); - stylus_report.stats = stylus_code_stats; - - let mut vue = tokei::Language { - blanks: 50, - comments: 200, - code: 100, - ..Default::default() - }; - - vue.children - .insert(tokei::LanguageType::Stylus, vec![stylus_report]); - - let mut languages = tokei::Languages::new(); - languages.insert(tokei::LanguageType::Vue, vue); - - let loc_by_language = get_loc_by_language(&languages).unwrap(); - - assert_eq!(loc_by_language[&Language::Vue], 110); - } - - #[test] - fn test_get_loc_by_language_sorted() { - let mut map = HashMap::new(); - map.insert(Language::Ada, 300); - map.insert(Language::Java, 40); - map.insert(Language::Rust, 1200); - map.insert(Language::Go, 8); - - let sorted_map = sort_by_loc(map); - - let expected_order = vec![ - (Language::Rust, 1200), - (Language::Ada, 300), - (Language::Java, 40), - (Language::Go, 8), - ]; - let actual_order: Vec<_> = sorted_map.into_iter().collect(); - - assert_eq!(expected_order, actual_order); - } - - #[test] - fn test_get_total_loc() { - let loc_by_language = [(Language::JavaScript, 100), (Language::Markdown, 300)]; - assert_eq!(get_total_loc(&loc_by_language), 400); +mod tests { + use rstest::rstest; + + #[rstest] + #[case("file", false)] + #[case("path/to/file", false)] + #[case(".file", true)] + #[case(".path/to/file", true)] + #[case("path/.to/file", true)] + fn test_is_hidden(#[case] path: &str, #[case] expected: bool) { + assert_eq!(super::is_hidden(path), expected); } } diff --git a/src/info/loc.rs b/src/info/loc.rs deleted file mode 100644 index fc4a71be5..000000000 --- a/src/info/loc.rs +++ /dev/null @@ -1,49 +0,0 @@ -use super::utils::format_number; -use crate::info::langs::get_total_loc; -use crate::info::langs::language::Language; -use crate::{cli::NumberSeparator, info::utils::info_field::InfoField}; -use serde::Serialize; - -#[derive(Serialize)] -#[serde(rename_all = "camelCase")] -pub struct LocInfo { - pub lines_of_code: usize, - #[serde(skip_serializing)] - number_separator: NumberSeparator, -} - -impl LocInfo { - pub fn new(loc_by_language: &[(Language, usize)], number_separator: NumberSeparator) -> Self { - let lines_of_code = get_total_loc(loc_by_language); - Self { - lines_of_code, - number_separator, - } - } -} - -#[typetag::serialize] -impl InfoField for LocInfo { - fn value(&self) -> String { - format_number(&self.lines_of_code, self.number_separator) - } - - fn title(&self) -> String { - "Lines of code".into() - } -} - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn test_display_loc_info() { - let loc_info = LocInfo { - lines_of_code: 1235, - number_separator: NumberSeparator::Plain, - }; - - assert_eq!(loc_info.value(), "1235".to_string()); - } -} diff --git a/src/info/mod.rs b/src/info/mod.rs index 1f5def4e0..f2dab10f0 100644 --- a/src/info/mod.rs +++ b/src/info/mod.rs @@ -12,7 +12,6 @@ use self::langs::language::Language; use self::langs::language::LanguagesInfo; use self::last_change::LastChangeInfo; use self::license::LicenseInfo; -use self::loc::LocInfo; use self::pending::PendingInfo; use self::project::ProjectInfo; use self::size::SizeInfo; @@ -44,7 +43,6 @@ mod head; pub mod langs; mod last_change; mod license; -mod loc; mod pending; mod project; mod size; @@ -123,13 +121,13 @@ pub fn build_info(cli_options: &CliOptions) -> Result { repo.object_cache_size_if_unset(4 * 1024 * 1024); let repo_path = get_work_dir(&repo)?; - let loc_by_language_sorted_handle = std::thread::spawn({ + let size_by_language_sorted_handle = std::thread::spawn({ let globs_to_exclude = cli_options.info.exclude.clone(); let language_types = cli_options.info.r#type.clone(); let include_hidden = cli_options.info.include_hidden; let workdir = repo_path.clone(); move || { - langs::get_loc_by_language_sorted( + langs::get_size_by_language_sorted( &workdir, &globs_to_exclude, &language_types, @@ -138,7 +136,7 @@ pub fn build_info(cli_options: &CliOptions) -> Result { } }); - let loc_by_language = loc_by_language_sorted_handle + let size_by_language = size_by_language_sorted_handle .join() .ok() .context("BUG: panic in language statistics thread")??; @@ -160,7 +158,7 @@ pub fn build_info(cli_options: &CliOptions) -> Result { When::Never => false, When::Auto => is_truecolor_terminal(), }; - let dominant_language = langs::get_main_language(&loc_by_language); + let dominant_language = langs::get_main_language(&size_by_language)?; let ascii_colors = get_ascii_colors( cli_options.ascii.ascii_language.as_ref(), &dominant_language, @@ -187,7 +185,7 @@ pub fn build_info(cli_options: &CliOptions) -> Result { .version(&repo, manifest.as_ref())? .created(&git_metrics, iso_time) .languages( - &loc_by_language, + &size_by_language, true_color, number_of_languages_to_display, &text_colors, @@ -210,7 +208,6 @@ pub fn build_info(cli_options: &CliOptions) -> Result { globs_to_exclude, number_separator, )? - .loc(&loc_by_language, number_separator) .size(&repo, number_separator) .license(&repo_path, manifest.as_ref())? .build(cli_options, text_colors, dominant_language, ascii_colors)) @@ -320,7 +317,7 @@ impl InfoBuilder { fn languages( mut self, - loc_by_language: &[(Language, usize)], + size_by_language: &[(Language, usize)], true_color: bool, number_of_languages: usize, text_colors: &TextColors, @@ -328,7 +325,7 @@ impl InfoBuilder { ) -> Self { if !self.disabled_fields.contains(&InfoType::Languages) { let languages = LanguagesInfo::new( - loc_by_language, + size_by_language, true_color, number_of_languages, text_colors.info, @@ -429,18 +426,6 @@ impl InfoBuilder { Ok(self) } - fn loc( - mut self, - loc_by_language: &[(Language, usize)], - number_separator: NumberSeparator, - ) -> Self { - if !self.disabled_fields.contains(&InfoType::LinesOfCode) { - let lines_of_code = LocInfo::new(loc_by_language, number_separator); - self.info_fields.push(Box::new(lines_of_code)); - } - self - } - fn build( self, cli_options: &CliOptions, diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 91a92abf2..690b64346 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -88,7 +88,7 @@ mod test { #[test] fn get_ascii_colors_custom_language_no_custom_colors_no_true_color() { - let colors = get_ascii_colors(Some(&Language::Sh), &Language::Rust, &[], false); + let colors = get_ascii_colors(Some(&Language::Shell), &Language::Rust, &[], false); assert_eq!(colors.len(), 1); assert_eq!(colors, vec![DynColors::Ansi(AnsiColors::Green)]); } diff --git a/tests/snapshots/repo__repo.snap b/tests/snapshots/repo__repo.snap index 57e03dd6d..095348b70 100644 --- a/tests/snapshots/repo__repo.snap +++ b/tests/snapshots/repo__repo.snap @@ -118,11 +118,6 @@ expression: info "churn_pool_size": 4 } }, - { - "LocInfo": { - "linesOfCode": 4 - } - }, { "SizeInfo": { "repoSize": "22 B",