diff options
33 files changed, 694 insertions, 821 deletions
diff --git a/.all-contributorsrc b/.all-contributorsrc index 58b4b124..0580c1ca 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -463,6 +463,24 @@ "contributions": [ "doc" ] + }, + { + "login": "MichalBryxi", + "name": "Michal Bryxí", + "avatar_url": "https://avatars.githubusercontent.com/u/847473?v=4", + "profile": "https://github.com/MichalBryxi", + "contributions": [ + "doc" + ] + }, + { + "login": "TheSkyentist", + "name": "Raphael Erik Hviding", + "avatar_url": "https://avatars.githubusercontent.com/u/17031860?v=4", + "profile": "http://mpia.de/~hviding/", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index d86b0627..7f12510a 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -27,6 +27,11 @@ env: COMPLETION_DIR: "target/tmp/bottom/completion/" MANPAGE_DIR: "target/tmp/bottom/manpage/" +permissions: + id-token: write + contents: read + attestations: write + # TODO: Maybe add retry job in case of timeouts? jobs: build-binaries: @@ -177,6 +182,11 @@ jobs: tar -czvf bottom_${{ matrix.info.target }}${{ matrix.info.suffix }}.tar.gz btm completion echo "ASSET=bottom_${{ matrix.info.target }}${{ matrix.info.suffix }}.tar.gz" >> $GITHUB_ENV + - name: Generate artifact attestation for file + uses: actions/attest-build-provenance@v1 + with: + subject-path: ${{ env.ASSET }} + - name: Create release directory for artifact, move file shell: bash run: | @@ -241,10 +251,14 @@ jobs: env: BTM_GENERATE: "" run: | - cargo install cargo-wix --version 0.3.1 --locked - cargo wix init + cargo install cargo-wix --version 0.3.8 --locked cargo wix + - name: Generate artifact attestation for file + uses: actions/attest-build-provenance@v1 + with: + subject-path: "bottom_x86_64_installer.msi" + - name: Create release directory for artifact, move files shell: bash run: | @@ -284,6 +298,11 @@ jobs: fi python ./scripts/cirrus/build.py "$BRANCH" "release/" "${{ inputs.caller }}" + - name: Generate artifact attestation for file + uses: actions/attest-build-provenance@v1 + with: + subject-path: "release/**/*.tar.gz" + - name: Save release as artifact uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: @@ -364,7 +383,7 @@ jobs: env: BTM_GENERATE: true run: | - cargo install cargo-deb --version 2.1.0 --locked + cargo install cargo-deb --version 2.2.0 --locked cargo deb --no-build --target ${{ matrix.info.target }} cp ./target/${{ matrix.info.target }}/debian/bottom_*.deb . @@ -400,6 +419,11 @@ jobs: sudo chown $USER ./target/${{ matrix.info.target }}/debian/ 2>/dev/null || true rm -r ./target/${{ matrix.info.target }}/debian/ + - name: Generate artifact attestation for file + uses: actions/attest-build-provenance@v1 + with: + subject-path: ${{ steps.verify.outputs.DEB_FILE }} + - name: Create release directory for artifact, move file shell: bash run: | @@ -485,6 +509,11 @@ jobs: sudo chown $USER ./target/${{ matrix.info.target }}/generate-rpm/ 2>/dev/null || true rm -r ./target/${{ matrix.info.target }}/generate-rpm/ + - name: Generate artifact attestation for file + uses: actions/attest-build-provenance@v1 + with: + subject-path: ${{ steps.verify.outputs.RPM_FILE }} + - name: Create release directory for artifact, move file shell: bash run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d8cf656e..335bd124 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,10 +19,23 @@ env: CARGO_HUSKY_DONT_INSTALL_HOOKS: true jobs: - # TODO: Add a pre-job check to skip if no change; may want to add something to check if there is a new rust version/week limit of skips? + # Check if things should be skipped. + pre-job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - name: Check if this action should be skipped + id: skip_check + uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1 + with: + skip_after_successful_duplicate: "true" + do_not_skip: '["workflow_dispatch"]' initialize-job: name: initialize-job + needs: pre-job + if: ${{ needs.pre-job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest steps: - name: Check if mock @@ -37,7 +50,7 @@ jobs: fi build-release: - needs: [initialize-job] + needs: initialize-job uses: ./.github/workflows/build_releases.yml with: caller: "nightly" @@ -45,8 +58,8 @@ jobs: upload-release: name: upload-release + needs: build-release runs-on: ubuntu-latest - needs: [build-release] steps: - name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -24,9 +24,6 @@ rust-unmangle # For testing sample_configs/testing*.toml -# Wix -/wix/ - # Cargo-deny deny.toml @@ -31,18 +31,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" @@ -142,9 +142,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bottom" @@ -172,7 +172,6 @@ dependencies = [ "indexmap", "indoc", "itertools", - "kstring", "libc", "log", "mach2", @@ -190,6 +189,7 @@ dependencies = [ "thiserror", "time", "toml_edit", + "unicode-ellipsis", "unicode-segmentation", "unicode-width", "windows 0.56.0", @@ -235,9 +235,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" [[package]] name = "cfg-if" @@ -390,7 +390,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "crossterm_winapi", "libc", "mio", @@ -498,15 +498,15 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "enum-as-inner" @@ -573,9 +573,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -652,18 +652,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "kstring" -version = "2.0.0" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" -dependencies = [ - "static_assertions", -] +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "lazy_static" @@ -685,23 +676,22 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2caa5afb8bf9f3a2652760ce7d4f62d21c4d5a423e68466fca30df82f2330164" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -712,9 +702,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -746,9 +736,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" @@ -800,7 +790,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "cfg_aliases", "libc", @@ -851,7 +841,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c9bff0aa1d48904a1385ea2a8b97576fbdcbc9a3cfccd0d31fe978e1c4038c5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libloading", "nvml-wrapper-sys", "static_assertions", @@ -891,9 +881,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -901,15 +891,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -983,18 +973,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1005,7 +995,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a564a852040e82671dc50a37d88f3aa83bbc690dfc6844cfe7a2591620206a80" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cassowary", "compact_str", "crossterm", @@ -1021,9 +1011,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -1041,18 +1031,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -1084,9 +1074,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "roff" @@ -1106,7 +1096,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1115,9 +1105,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" @@ -1261,18 +1251,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "stability" @@ -1321,18 +1311,18 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", @@ -1343,9 +1333,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -1358,7 +1348,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7dddc5f0fee506baf8b9fdb989e242f17e4b11c61dfbb0635b705217199eea" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "enum-as-inner", "libc", @@ -1488,6 +1478,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] +name = "unicode-ellipsis" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c05e96c2778c2a4df66c381f3d68d143a7c863e6b7573c3654e116d4788c943" +dependencies = [ + "unicode-segmentation", + "unicode-width", +] + +[[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1570,11 +1570,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1796,9 +1796,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" dependencies = [ "memchr", ] @@ -86,7 +86,6 @@ humantime = "2.1.0" indexmap = "2.2.6" indoc = "2.0.5" itertools = "0.12.1" -kstring = { version = "2.0.0", features = ["arc"] } log = { version = "0.4.21", optional = true } nvml-wrapper = { version = "0.10.0", optional = true, features = ["legacy-functions"] } regex = "1.10.4" @@ -97,6 +96,7 @@ thiserror = "1.0.59" time = { version = "0.3.36", features = ["formatting", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } tui = { version = "0.26.2", package = "ratatui" } +unicode-ellipsis = "0.1.4" unicode-segmentation = "1.11.0" unicode-width = "0.1.12" @@ -208,17 +208,15 @@ assets = [ { source = "desktop/bottom.desktop", dest = "/usr/share/applications/bottom.desktop", mode = "644" }, ] -# Activate whenever we bump the unofficial MSRV to 1.74, I guess? -# [lints.rust] -# rust_2018_idioms = "deny" +[lints.rust] +rust_2018_idioms = "deny" # missing_docs = "deny" -# unused_extern_crates = "deny" -# [lints.rustdoc] -# broken_intra_doc_links = "deny" -# missing_crate_level_docs = "deny" +[lints.rustdoc] +broken_intra_doc_links = "deny" +missing_crate_level_docs = "deny" -# [lints.clippy] -# todo = "deny" -# unimplemented = "deny" -# missing_safety_doc = "deny" +[lints.clippy] +todo = "deny" +unimplemented = "deny" +missing_safety_doc = "deny" @@ -472,6 +472,8 @@ Thanks to all contributors: </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://www.davlgd.fr"><img src="https://avatars.githubusercontent.com/u/1110600?v=4?s=100" width="100px;" alt="David Legrand"/><br /><sub><b>David Legrand</b></sub></a><br /><a href="https://github.com/ClementTsang/bottom/commits?author=davlgd" title="Documentation">📖</a></td> + <td align="center" valign="top" width="14.28%"><a href="https://github.com/MichalBryxi"><img src="https://avatars.githubusercontent.com/u/847473?v=4?s=100" width="100px;" alt="Michal Bryxí"/><br /><sub><b>Michal Bryxí</b></sub></a><br /><a href="https://github.com/ClementTsang/bottom/commits?author=MichalBryxi" title="Documentation">📖</a></td> + <td align="center" valign="top" width="14.28%"><a href="http://mpia.de/~hviding/"><img src="https://avatars.githubusercontent.com/u/17031860?v=4?s=100" width="100px;" alt="Raphael Erik Hviding"/><br /><sub><b>Raphael Erik Hviding</b></sub></a><br /><a href="https://github.com/ClementTsang/bottom/commits?author=TheSkyentist" title="Code">💻</a></td> </tr> </tbody> </table> diff --git a/docs/content/configuration/config-file/flags.md b/docs/content/configuration/config-file/flags.md index 90a8d59f..4b6792cb 100644 --- a/docs/content/configuration/config-file/flags.md +++ b/docs/content/configuration/config-file/flags.md @@ -4,6 +4,13 @@ This section is in progress, and is just copied from the old documentation. +You can configure flags by putting them in `[flags]` table. Example: + +```toml +[flags] +color = "nord-light" +``` + Most of the [command line flags](../command-line-options.md) have config file equivalents to avoid having to type them out each time: diff --git a/src/app/data_farmer.rs b/src/app/data_farmer.rs index 3ad819be..f04408eb 100644 --- a/src/app/data_farmer.rs +++ b/src/app/data_farmer.rs @@ -21,7 +21,7 @@ use hashbrown::HashMap; use crate::data_collection::batteries; use crate::{ data_collection::{cpu, disks, memory, network, processes::ProcessHarvest, temperature, Data}, - utils::{data_prefixes::*, general::get_decimal_bytes}, + utils::data_prefixes::*, Pid, }; diff --git a/src/app/states.rs b/src/app/states.rs index 8b5f0ce8..0088e53d 100644 --- a/src/app/states.rs +++ b/src/app/states.rs @@ -2,12 +2,12 @@ use std::{ops::Range, time::Instant}; use hashbrown::HashMap; use indexmap::IndexMap; +use unicode_ellipsis::grapheme_width; use unicode_segmentation::{GraphemeCursor, GraphemeIncomplete, UnicodeSegmentation}; use crate::{ app::{layout_manager::BottomWidgetType, query::*}, constants, - utils::general::str_width, widgets::{ BatteryWidgetState, CpuWidgetState, DiskTableWidget, MemWidgetState, NetWidgetState, ProcWidgetState, TempWidgetState, @@ -250,7 +250,7 @@ impl AppSearchState { for (index, grapheme) in UnicodeSegmentation::grapheme_indices(self.current_search_query.as_str(), true) { - let width = str_width(grapheme); + let width = grapheme_width(grapheme); let end = curr_offset + width; self.size_mappings.insert(index, curr_offset..end); diff --git a/src/bin/main.rs b/src/bin/main.rs index 0ee3289f..c7841b4d 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -208,11 +208,10 @@ fn main() -> Result<()> { } if !app.frozen_state.is_frozen() { - // Convert all data into tui-compliant components + // Convert all data into data for the displayed widgets. - // Network if app.used_widgets.use_net { - let network_data = convert_network_data_points( + let network_data = convert_network_points( &app.data_collection, app.app_config_fields.use_basic_mode || app.app_config_fields.use_old_network_legend, @@ -232,18 +231,16 @@ fn main() -> Result<()> { } } - // Disk if app.used_widgets.use_disk { - app.converted_data.ingest_disk_data(&app.data_collection); + app.converted_data.convert_disk_data(&app.data_collection); for disk in app.states.disk_state.widget_states.values_mut() { disk.force_data_update(); } } - // Temperatures if app.used_widgets.use_temp { - app.converted_data.ingest_temp_data( + app.converted_data.convert_temp_data( &app.data_collection, app.app_config_fields.temperature_type, ); @@ -253,22 +250,25 @@ fn main() -> Result<()> { } } - // Memory if app.used_widgets.use_mem { app.converted_data.mem_data = convert_mem_data_points(&app.data_collection); + |