diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ab43ec0..71992c3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,9 +16,6 @@ "seccomp=unconfined" ], "postCreateCommand": "cargo install cross typos-cli cargo-expand", - "mounts": [ - "source=/run/shm,target=/dev/shm,type=bind" - ], "customizations": { "vscode": { // Add the IDs of extensions you want installed when the container is created. @@ -48,13 +45,9 @@ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": { - "version": "latest", - "moby": true, - "dockerDashComposeVersion": "v2" - }, + "ghcr.io/devcontainers/features/docker-in-docker:2":{}, "ghcr.io/devcontainers/features/git:1": { - "version": "os-provided" - } + "version":"os-provided" + } } } \ No newline at end of file diff --git a/.github/release-body.md b/.github/release-body.md index 963245d..f03b373 100644 --- a/.github/release-body.md +++ b/.github/release-body.md @@ -1,29 +1,16 @@ -### 2024-08-01 +### 2024-09-07 ### Chores -+ .devcontainer extensions updated, [0288cbc8146cde1dd40ceaec9550198b635bb8f5] -+ dependencies updated, [1df4f78dc41013c33d901925933b1ccb29ad4bc8], [5ae253b8734ba0495e4e8149b17d5228b3d86f8d], [7a517db9f7c14c35e56ff70cf76ffb608fd30e17], [9c291cd9c81b6d9a02085878588ed3b845fd0046], [0e90f4eb55ac5fb5d45e7d212c3686027dd3913e], [fe71cbfb00f166b7c02a6e28e64650ed1b47d15d] -+ docker-compose alpine version bump, [51ceab3ebdb09356cd401d2f268840239255126f] -+ Rust 1.80 linting, [93e1279b1fc77019442a385e2e36be2fe438e828] -+ create_release v0.5.6, [f408acfe9a9f5a976735b8a8a51500fd7b865daf] ++ dependencies updated, [d6238587ffc536f1ea93a47dd4d2ee69c36f35e3], [a564ef80318adbde9f188dd2cf38626a98793c75], [1d82ff1368f7b43e6df8478d5e7b8d682320010a], [99f05f2e5b511d039804159c92ade6c77ff360b7] ++ Rust 1.81.0 linting, [372f759ca467e47c373a086c6a247c150b87d4bc] ++ .devcontainer updated, [5d77f1e02a428b4e5ee1bf5466055ad17f6e05af] ### Docs -+ screenshot updated, [6975ebe70f7058229c232e4a56b090f55247d2a2] ++ CHANGELOG.md duplicate removed, [16ecc5a51f7defcc9dd4f4c6e34fa5bbfc7fea78] ++ Readme raspberry pi fix, [baf68783929e5d6ac111a39dc62388cd24133da6] ++ Add installation guide to README for macOS installation via `brew install oxker`, thanks [miketheman](https://github.com/miketheman), [59817311baea628d2691765ff9387e055dce3307], [895ec6204cc8220be64be7622df6edb6ef6d795b] -### Features -+ left align all text, [e0d421c4918a17c9e0e21fd214edb99d71281c9d] -+ place image name in logs panel title, [12f24357a68abe871f44d871d95b6e2ef062181e] -+ distinguish between unhealthy & healthy running containers, closes #43, [de8768181631c6d961ce0e4dacb50c2ed02abc36] -+ filter containers, use `F1` or `/` to enter filter mode, closes #37, thanks to [MohammadShabaniSBU](https://github.com/MohammadShabaniSBU) for the original PR, [d5d8a0dbc5437ff3b17f34b9dbb9589bb56b4a3e], [[7ee1f06f804683e3395953a02138d4e9da115ea9]] -+ place image name in logs panel title, [ef19b9cf89a881d0a7ac818885317ce2bd683dfc] - -### Fixes -+ log_sanitizer `raw()` & `remove_ansi()` now functioning as intended, [0dc98dfc8113869b81be9d697ca77418c919e4bf] -+ Dockerfile command use uppercase, [068e4025a5d6049a9a6951a0480a6bdef7379f88] -+ heading section help margin, [0e927aae178c1d8f60561b93607a26d45a1d9331] -+ install.sh use curl, [197a031b8cf356f49f08e04472d0d1c489699415] - -### Tests -+ fix layout tests with new left alignment, [dfced564278eafdbb8a5b95badbae3a7c4bf87b3] +### Refactors ++ switch lints from `allow(x)` to `expect(x)`, [2a0ab6d81ce4062de053a92b85f8b25ea23412b6] see CHANGELOG.md for more details diff --git a/CHANGELOG.md b/CHANGELOG.md index 7baafe6..c82ad6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +# v0.7.1 +### 2024-09-07 + +### Chores ++ dependencies updated, [d6238587](https://github.com/mrjackwills/oxker/commit/d6238587ffc536f1ea93a47dd4d2ee69c36f35e3), [a564ef80](https://github.com/mrjackwills/oxker/commit/a564ef80318adbde9f188dd2cf38626a98793c75), [1d82ff13](https://github.com/mrjackwills/oxker/commit/1d82ff1368f7b43e6df8478d5e7b8d682320010a), [99f05f2e](https://github.com/mrjackwills/oxker/commit/99f05f2e5b511d039804159c92ade6c77ff360b7) ++ Rust 1.81.0 linting, [372f759c](https://github.com/mrjackwills/oxker/commit/372f759ca467e47c373a086c6a247c150b87d4bc) ++ .devcontainer updated, [5d77f1e0](https://github.com/mrjackwills/oxker/commit/5d77f1e02a428b4e5ee1bf5466055ad17f6e05af) + +### Docs ++ CHANGELOG.md duplicate removed, [16ecc5a5](https://github.com/mrjackwills/oxker/commit/16ecc5a51f7defcc9dd4f4c6e34fa5bbfc7fea78) ++ Readme raspberry pi fix, [baf68783](https://github.com/mrjackwills/oxker/commit/baf68783929e5d6ac111a39dc62388cd24133da6) ++ Add installation guide to README for macOS installation via `brew install oxker`, thanks [miketheman](https://github.com/miketheman), [59817311](https://github.com/mrjackwills/oxker/commit/59817311baea628d2691765ff9387e055dce3307), [895ec620](https://github.com/mrjackwills/oxker/commit/895ec6204cc8220be64be7622df6edb6ef6d795b) + +### Refactors ++ switch lints from `allow(x)` to `expect(x)`, [2a0ab6d8](https://github.com/mrjackwills/oxker/commit/2a0ab6d81ce4062de053a92b85f8b25ea23412b6) + # v0.7.0 ### 2024-08-01 @@ -16,7 +32,6 @@ + place image name in logs panel title, [12f24357](https://github.com/mrjackwills/oxker/commit/12f24357a68abe871f44d871d95b6e2ef062181e) + distinguish between unhealthy & healthy running containers, closes [#43](https://github.com/mrjackwills/oxker/issues/43), [de876818](https://github.com/mrjackwills/oxker/commit/de8768181631c6d961ce0e4dacb50c2ed02abc36) + filter containers, use `F1` or `/` to enter filter mode, closes [#37](https://github.com/mrjackwills/oxker/issues/37), thanks to [MohammadShabaniSBU](https://github.com/MohammadShabaniSBU) for the original PR, [d5d8a0db](https://github.com/mrjackwills/oxker/commit/d5d8a0dbc5437ff3b17f34b9dbb9589bb56b4a3e), [7ee1f06f](https://github.com/mrjackwills/oxker/commit/7ee1f06f804683e3395953a02138d4e9da115ea9) -+ place image name in logs panel title, [12f24357](https://github.com/mrjackwills/oxker/commit/12f24357a68abe871f44d871d95b6e2ef062181e) ### Fixes + log_sanitizer `raw()` & `remove_ansi()` now functioning as intended, [0dc98dfc](https://github.com/mrjackwills/oxker/commit/0dc98dfc8113869b81be9d697ca77418c919e4bf) diff --git a/Cargo.lock b/Cargo.lock index 7beacf4..872d084 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,7 +26,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" [[package]] name = "autocfg" @@ -140,9 +140,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bollard" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a063d51a634c7137ecd9f6390ec78e1c512e84c9ded80198ec7df3339a16a33" +checksum = "d41711ad46fda47cd701f6908e59d1bd6b9a2b7464c0d0aeab95c6d37096ff8a" dependencies = [ "base64", "bollard-stubs", @@ -196,9 +196,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca2be1d5c43812bae364ee3f30b3afcb7877cf59f4aeb94c66f313a41d2fac9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cansi" @@ -223,9 +223,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.7" +version = "1.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "a93fe60e2fc87b6ba2c117f67ae14f66e3fc7d6a1e612a25adb238cc980eadb3" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -248,9 +251,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.13" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -258,9 +261,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.13" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -296,38 +299,23 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "compact_str" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" dependencies = [ "castaway", "cfg-if", "itoa", + "rustversion", "ryu", "static_assertions", ] [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "crossterm" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" -dependencies = [ - "bitflags", - "crossterm_winapi", - "libc", - "mio 0.8.11", - "parking_lot", - "signal-hook", - "signal-hook-mio", - "winapi", -] +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crossterm" @@ -337,7 +325,7 @@ checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ "bitflags", "crossterm_winapi", - "mio 1.0.1", + "mio", "parking_lot", "rustix", "signal-hook", @@ -608,9 +596,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", @@ -687,15 +675,25 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", "serde", ] +[[package]] +name = "instability" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -719,9 +717,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -734,9 +732,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libredox" @@ -796,21 +794,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", @@ -846,9 +832,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -873,13 +859,13 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "oxker" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "bollard", "cansi", "clap", - "crossterm 0.28.1", + "crossterm", "directories", "futures-util", "parking_lot", @@ -966,11 +952,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy 0.6.6", + "zerocopy", ] [[package]] @@ -984,9 +970,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1023,18 +1009,18 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" +checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" dependencies = [ "bitflags", "cassowary", "compact_str", - "crossterm 0.27.0", + "crossterm", + "instability", "itertools", "lru", "paste", - "stability", "strum", "strum_macros", "unicode-segmentation", @@ -1053,9 +1039,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -1070,9 +1056,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ "bitflags", "errno", @@ -1101,18 +1087,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1121,9 +1107,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.121" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -1164,7 +1150,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.3.0", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -1180,6 +1166,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -1197,8 +1189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio 0.8.11", - "mio 1.0.1", + "mio", "signal-hook", ] @@ -1236,16 +1227,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "stability" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -1282,9 +1263,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -1369,14 +1350,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.1", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -1398,9 +1379,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -1426,15 +1407,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -1608,19 +1589,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -1633,9 +1615,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1643,9 +1625,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -1656,9 +1638,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "winapi" @@ -1830,34 +1812,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "zerocopy" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" -dependencies = [ - "byteorder", - "zerocopy-derive 0.6.6", -] - [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy-derive" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "byteorder", + "zerocopy-derive", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4255dc5..42e8c19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oxker" -version = "0.7.0" +version = "0.7.1" edition = "2021" authors = ["Jack Wills "] description = "A simple tui to view & control docker containers" @@ -34,8 +34,8 @@ crossterm = "0.28" directories = "5.0" futures-util = "0.3" parking_lot = { version = "0.12" } -ratatui = "0.27" -tokio = { version = "1.39", features = ["full"] } +ratatui = "0.28" +tokio = { version = "1.40", features = ["full"] } tokio-util = "0.7" tracing = "0.1" tracing-subscriber = "0.3" diff --git a/README.md b/README.md index 5821eba..49c2938 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ paru -S oxker ### Homebrew -oxker can be installed on macOS using Homebrew: +oxker can be installed on macOS using [Homebrew](https://formulae.brew.sh/formula/oxker): ```shell brew install oxker diff --git a/src/app_data/container_state.rs b/src/app_data/container_state.rs index 7eccb32..46df6d6 100644 --- a/src/app_data/container_state.rs +++ b/src/app_data/container_state.rs @@ -468,7 +468,7 @@ impl ByteStats { } } -#[allow(clippy::cast_precision_loss)] +#[expect(clippy::cast_precision_loss)] impl Stats for ByteStats { fn get_value(&self) -> f64 { self.0 as f64 @@ -608,7 +608,7 @@ impl fmt::Display for ContainerItem { } impl ContainerItem { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] /// Create a new container item pub fn new( created: u64, @@ -660,7 +660,7 @@ impl ContainerItem { } /// Convert cpu stats into a vec for the charts function - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] fn get_cpu_dataset(&self) -> Vec<(f64, f64)> { self.cpu_stats .iter() @@ -670,7 +670,7 @@ impl ContainerItem { } /// Convert mem stats into a Vec for the charts function - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] fn get_mem_dataset(&self) -> Vec<(f64, f64)> { self.mem_stats .iter() diff --git a/src/app_data/mod.rs b/src/app_data/mod.rs index e57f79c..d123f6f 100644 --- a/src/app_data/mod.rs +++ b/src/app_data/mod.rs @@ -151,7 +151,7 @@ impl AppData { } /// Current time as unix timestamp - #[allow(clippy::expect_used)] + #[expect(clippy::expect_used)] fn get_systemtime() -> u64 { SystemTime::now() .duration_since(UNIX_EPOCH) @@ -933,7 +933,7 @@ impl AppData { } #[cfg(test)] -#[allow(clippy::unwrap_used, clippy::many_single_char_names)] +#[expect(clippy::unwrap_used)] mod tests { use super::*; diff --git a/src/app_error.rs b/src/app_error.rs index ba0d66f..c5db695 100644 --- a/src/app_error.rs +++ b/src/app_error.rs @@ -2,7 +2,7 @@ use crate::app_data::DockerControls; use std::fmt; /// app errors to set in global state -#[allow(unused)] +#[expect(unused)] #[derive(Debug, Clone, Copy)] pub enum AppError { DockerCommand(DockerControls), diff --git a/src/docker_data/mod.rs b/src/docker_data/mod.rs index 307d058..17e4932 100644 --- a/src/docker_data/mod.rs +++ b/src/docker_data/mod.rs @@ -70,7 +70,7 @@ pub struct DockerData { impl DockerData { /// Use docker stats to calculate current cpu usage - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] // TODO FIX: this can overflow fn calculate_usage(stats: &Stats) -> f64 { let mut cpu_percentage = 0.0; @@ -349,7 +349,7 @@ impl DockerData { /// Handle incoming messages, container controls & all container information update /// Spawn Docker commands off into own thread - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] async fn message_handler(&mut self) { while let Some(message) = self.receiver.recv().await { let docker = Arc::clone(&self.docker); @@ -505,7 +505,7 @@ mod tests { use super::*; - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] fn gen_stats(x: u64, y: u64) -> Stats { Stats { read: String::new(), @@ -623,7 +623,7 @@ mod tests { } #[test] - #[allow(clippy::float_cmp)] + #[expect(clippy::float_cmp)] /// Test the stats calculator, had to cheat here to get round input/outputs fn test_calculate_usage_no_previous_cpu() { let stats = gen_stats(1_000_000_000, 900_000_000); diff --git a/src/input_handler/mod.rs b/src/input_handler/mod.rs index 3110596..5ea42ee 100644 --- a/src/input_handler/mod.rs +++ b/src/input_handler/mod.rs @@ -513,12 +513,13 @@ impl InputHandler { MouseEventKind::ScrollUp => self.previous(), MouseEventKind::ScrollDown => self.next(), MouseEventKind::Down(MouseButton::Left) => { - if let Some(header) = self.gui_state.lock().header_intersect(Rect::new( + let header = self.gui_state.lock().header_intersect(Rect::new( mouse_event.column, mouse_event.row, 1, 1, - )) { + )); + if let Some(header) = header { self.sort(header); } diff --git a/src/main.rs b/src/main.rs index aa5c2cd..e60160b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,3 @@ -// Only allow when debugging -// #![allow(unused)] - use app_data::AppData; use app_error::AppError; use bollard::{Docker, API_DEFAULT_VERSION}; @@ -139,7 +136,8 @@ async fn main() { info!("in debug mode\n"); // Debug mode for testing, less pointless now, will display some basic information while is_running.load(Ordering::SeqCst) { - if let Some(err) = app_data.lock().get_error() { + let err = app_data.lock().get_error(); + if let Some(err) = err { error!("{}", err); process::exit(1); } @@ -165,12 +163,8 @@ async fn main() { } #[cfg(test)] -#[allow(clippy::unwrap_used, clippy::many_single_char_names, unused)] +#[expect(clippy::unwrap_used)] mod tests { - use std::{ - collections::{HashSet, VecDeque}, - vec, - }; use bollard::service::{ContainerSummary, Port}; diff --git a/src/parse_args.rs b/src/parse_args.rs index e29d84c..6937ffc 100644 --- a/src/parse_args.rs +++ b/src/parse_args.rs @@ -6,7 +6,7 @@ use tracing::error; use crate::{ENV_KEY, ENV_VALUE}; #[derive(Parser, Debug, Clone)] -#[allow(clippy::struct_excessive_bools)] +#[expect(clippy::struct_excessive_bools)] #[command(version, about)] pub struct Args { /// Docker update interval in ms, minimum effectively 1000 @@ -47,7 +47,7 @@ pub struct Args { } #[derive(Debug, Clone)] -#[allow(clippy::struct_excessive_bools)] +#[expect(clippy::struct_excessive_bools)] pub struct CliArgs { pub color: bool, pub docker_interval: u32, diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index c3e5693..567cf77 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -294,7 +294,8 @@ pub fn ports( app_data: &Arc>, max_lens: (usize, usize, usize), ) { - if let Some(ports) = app_data.lock().get_selected_ports() { + let ports = app_data.lock().get_selected_ports(); + if let Some(ports) = ports { let block = Block::default() .borders(Borders::ALL) .border_type(BorderType::Rounded) @@ -344,7 +345,8 @@ pub fn ports( /// Draw the cpu + mem charts pub fn chart(f: &mut Frame, area: Rect, app_data: &Arc>) { - if let Some((cpu, mem)) = app_data.lock().get_chart_data() { + let cpu_mem = app_data.lock().get_chart_data(); + if let Some((cpu, mem)) = cpu_mem { let area = Layout::default() .direction(Direction::Horizontal) .constraints(CONSTRAINT_50_50) @@ -362,7 +364,7 @@ pub fn chart(f: &mut Frame, area: Rect, app_data: &Arc>) { .data(&mem.0)]; let cpu_stats = CpuStats::new(cpu.0.last().map_or(0.00, |f| f.1)); - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let mem_stats = ByteStats::new(mem.0.last().map_or(0, |f| f.1 as u64)); let cpu_chart = make_chart(cpu.2, "cpu", cpu_dataset, &cpu_stats, &cpu.1); let mem_chart = make_chart(mem.2, "memory", mem_dataset, &mem_stats, &mem.1); @@ -489,7 +491,6 @@ pub fn filter_bar(area: Rect, frame: &mut Frame, app_data: &Arc>) /// Draw heading bar at top of program, always visible /// TODO Should separate into loading icon/headers/help functions -#[allow(clippy::too_many_lines)] pub fn heading_bar( area: Rect, frame: &mut Frame, @@ -834,7 +835,7 @@ pub fn help_box(f: &mut Frame) { let area = popup( max_height, max_line_width, - f.size(), + f.area(), BoxLocation::MiddleCentre, ); @@ -931,7 +932,7 @@ pub fn delete_confirm(f: &mut Frame, gui_state: &Arc>, name: &Co let area = popup( lines, max_line_width.into(), - f.size(), + f.area(), BoxLocation::MiddleCentre, ); @@ -1000,7 +1001,7 @@ pub fn error(f: &mut Frame, error: AppError, seconds: Option) { .block(block) .alignment(Alignment::Center); - let area = popup(lines, max_line_width, f.size(), BoxLocation::MiddleCentre); + let area = popup(lines, max_line_width, f.area(), BoxLocation::MiddleCentre); // let (paragraph, area) = gen_error(f, error, seconds); f.render_widget(Clear, area); @@ -1027,7 +1028,7 @@ pub fn info(f: &mut Frame, text: &str, instant: Instant, gui_state: &Arc 4000 { @@ -1064,7 +1065,7 @@ fn popup(text_lines: usize, text_width: usize, r: Rect, box_location: BoxLocatio } #[cfg(test)] -#[allow(clippy::unwrap_used, clippy::many_single_char_names)] +#[expect(clippy::unwrap_used)] mod tests { use std::{ops::RangeInclusive, sync::Arc}; @@ -2109,7 +2110,7 @@ mod tests { // Charts panel // // ************ // - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] // Add fixed data to the cpu & mem vecdeques fn insert_chart_data(setup: &TuiTestSetup) { for i in 1..=10 { @@ -2833,7 +2834,7 @@ mod tests { // ********** // #[test] - #[allow(clippy::cognitive_complexity, clippy::too_many_lines)] + #[expect(clippy::cognitive_complexity, clippy::too_many_lines)] /// Filter row is drawn correctly & colors are correct /// Colours change when filter_by option is changed fn test_draw_blocks_filter_row() { @@ -3371,7 +3372,7 @@ mod tests { } #[test] - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] /// Check that the whole layout is drawn correctly fn test_draw_blocks_whole_layout_with_filter() { let (w, h) = (160, 30); diff --git a/src/ui/gui_state.rs b/src/ui/gui_state.rs index ce007e8..acd2244 100644 --- a/src/ui/gui_state.rs +++ b/src/ui/gui_state.rs @@ -58,7 +58,7 @@ pub enum DeleteButton { No, } -#[allow(unused)] +#[expect(unused)] #[derive(Debug, Clone, Copy)] pub enum BoxLocation { TopLeft, diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 99023f8..2158fef 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -7,7 +7,7 @@ use crossterm::{ use parking_lot::{Mutex, MutexGuard}; use ratatui::{ backend::CrosstermBackend, - layout::{Constraint, Direction, Layout}, + layout::{Constraint, Direction, Layout, Position}, Frame, Terminal, }; use std::{ @@ -42,7 +42,7 @@ pub struct Ui { is_running: Arc, now: Instant, terminal: Terminal>, - cursor_position: (u16, u16), + cursor_position: Position, } impl Ui { @@ -66,7 +66,7 @@ impl Ui { is_running: Arc, ) { if let Ok(mut terminal) = Self::setup_terminal() { - let cursor_position = terminal.get_cursor().unwrap_or_default(); + let cursor_position = terminal.get_cursor_position().unwrap_or_default(); let mut ui = Self { app_data, cursor_position, @@ -114,8 +114,7 @@ impl Ui { )?; disable_raw_mode()?; self.terminal.clear().ok(); - self.terminal - .set_cursor(self.cursor_position.0, self.cursor_position.1)?; + self.terminal.set_cursor_position(self.cursor_position)?; Ok(self.terminal.show_cursor()?) } @@ -276,7 +275,7 @@ fn draw_frame(f: &mut Frame, app_data: &Arc>, gui_state: &Arc