summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Gerace <nickagerace@gmail.com>2023-02-27 22:46:52 -0500
committerNick Gerace <nickagerace@gmail.com>2023-02-28 14:07:03 -0500
commite7b9531abfd20b63c0ae249fb4d0563a5ae0a0d8 (patch)
tree2830c0679208ada7d68a40e99f7b148d692f0471
parent9b6a5985b6745fbb29abcfba9ccdf4cb021abef1 (diff)
downloadgfold-e7b9531abfd20b63c0ae249fb4d0563a5ae0a0d8.zip
Add nix flake
- Add nix flake with documentation - Bump deps - Document private items by default Signed-off-by: Nick Gerace <nickagerace@gmail.com>
-rw-r--r--.cargo/config2
-rw-r--r--CHANGELOG.md15
-rw-r--r--Cargo.lock133
-rw-r--r--crates/gfold/Cargo.toml2
-rw-r--r--docs/DEVELOPING.md30
-rw-r--r--flake.lock77
-rw-r--r--flake.nix37
7 files changed, 226 insertions, 70 deletions
diff --git a/.cargo/config b/.cargo/config
new file mode 100644
index 0000000..9825746
--- /dev/null
+++ b/.cargo/config
@@ -0,0 +1,2 @@
+[build]
+rustdocflags = "--document-private-items"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 24eacae..cd8d2d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,11 +4,20 @@ For new changes prior to version 4.0.0, please see [CHANGELOG_PRE_V4](./docs/CHA
- All notable changes to this project will be documented in this file
- All changes are from [@nickgerace](https://github.com/nickgerace) unless otherwise specified
-- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
+- The format was inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+- This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
## Unreleased
-The latest version contains all changes.
+<!-- The latest version contains all changes. -->
+
+### Changed
+
+- Bump dependencies
+
+### Notes
+
+- Add `flake.nix` for more local development options
## 4.3.1 - 2023-02-05
@@ -28,7 +37,7 @@ The latest version contains all changes.
- Bump dependencies
-### Note
+### Notes
- Add demo GIF to README
- Performed significant refactor to reduce the usage of "floating" functions
diff --git a/Cargo.lock b/Cargo.lock
index ee843f1..39dcaff 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -77,9 +77,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
-version = "4.1.4"
+version = "4.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76"
+checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5"
dependencies = [
"bitflags",
"clap_derive",
@@ -92,9 +92,9 @@ dependencies = [
[[package]]
name = "clap_derive"
-version = "4.1.0"
+version = "4.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8"
+checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0"
dependencies = [
"heck",
"proc-macro-error",
@@ -105,18 +105,18 @@ dependencies = [
[[package]]
name = "clap_lex"
-version = "0.3.1"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade"
+checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09"
dependencies = [
"os_str_bytes",
]
[[package]]
name = "crossbeam-channel"
-version = "0.5.6"
+version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
+checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c"
dependencies = [
"cfg-if",
"crossbeam-utils",
@@ -124,9 +124,9 @@ dependencies = [
[[package]]
name = "crossbeam-deque"
-version = "0.8.2"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc"
+checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [
"cfg-if",
"crossbeam-epoch",
@@ -135,9 +135,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
-version = "0.9.13"
+version = "0.9.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a"
+checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695"
dependencies = [
"autocfg",
"cfg-if",
@@ -148,9 +148,9 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
-version = "0.8.14"
+version = "0.8.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
+checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b"
dependencies = [
"cfg-if",
]
@@ -230,9 +230,9 @@ dependencies = [
[[package]]
name = "fastrand"
-version = "1.8.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
+checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
@@ -279,9 +279,9 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.27.1"
+version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec"
+checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
[[package]]
name = "git2"
@@ -319,9 +319,9 @@ dependencies = [
[[package]]
name = "hermit-abi"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "856b5cb0902c2b6d65d5fd97dfa30f9b70c7538e770b98eab5ed52d8db923e01"
+checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
[[package]]
name = "humantime"
@@ -365,19 +365,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
dependencies = [
"libc",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
name = "is-terminal"
-version = "0.4.3"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef"
+checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857"
dependencies = [
- "hermit-abi 0.3.0",
+ "hermit-abi 0.3.1",
"io-lifetimes",
"rustix",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -388,9 +388,9 @@ checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
[[package]]
name = "jobserver"
-version = "0.1.25"
+version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b"
+checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
dependencies = [
"libc",
]
@@ -448,9 +448,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "memoffset"
-version = "0.7.1"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
+checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
dependencies = [
"autocfg",
]
@@ -465,15 +465,6 @@ dependencies = [
]
[[package]]
-name = "nom8"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
-dependencies = [
- "memchr",
-]
-
-[[package]]
name = "num_cpus"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -494,9 +485,9 @@ dependencies = [
[[package]]
name = "once_cell"
-version = "1.17.0"
+version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
+checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "os_str_bytes"
@@ -622,15 +613,6 @@ dependencies = [
]
[[package]]
-name = "remove_dir_all"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
-dependencies = [
- "winapi",
-]
-
-[[package]]
name = "rustc-demangle"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -647,7 +629,7 @@ dependencies = [
"io-lifetimes",
"libc",
"linux-raw-sys",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -684,9 +666,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.92"
+version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7434af0dc1cbd59268aa98b4c22c131c0584d2232f6fb166efb993e2832e896a"
+checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
dependencies = [
"itoa",
"ryu",
@@ -717,9 +699,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
-version = "1.0.107"
+version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
@@ -728,16 +710,15 @@ dependencies = [
[[package]]
name = "tempfile"
-version = "3.3.0"
+version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
+checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95"
dependencies = [
"cfg-if",
"fastrand",
- "libc",
"redox_syscall",
- "remove_dir_all",
- "winapi",
+ "rustix",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -786,9 +767,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "toml"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0"
+checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6"
dependencies = [
"serde",
"serde_spanned",
@@ -807,15 +788,15 @@ dependencies = [
[[package]]
name = "toml_edit"
-version = "0.19.1"
+version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90a238ee2e6ede22fb95350acc78e21dc40da00bb66c0334bde83de4ed89424e"
+checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825"
dependencies = [
"indexmap",
- "nom8",
"serde",
"serde_spanned",
"toml_datetime",
+ "winnow",
]
[[package]]
@@ -901,6 +882,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
+version = "0.42.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows-sys"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
@@ -966,6 +962,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
[[package]]
+name = "winnow"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "faf09497b8f8b5ac5d3bb4d05c0a99be20f26fd3d5f2db7b0716e946d5103658"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
name = "yansi"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/crates/gfold/Cargo.toml b/crates/gfold/Cargo.toml
index f591d98..2a854f0 100644
--- a/crates/gfold/Cargo.toml
+++ b/crates/gfold/Cargo.toml
@@ -22,7 +22,7 @@ log = "0.4"
rayon = "1.6"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
-termcolor = "1.1"
+termcolor = "1.2"
thiserror = "1.0"
toml = "0.7"
diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md
index 8402799..a22b7bb 100644
--- a/docs/DEVELOPING.md
+++ b/docs/DEVELOPING.md
@@ -17,10 +17,10 @@ Now, ensure that lints, tests, and builds succeed.
```shell
cargo fmt --all -- --check
+cargo build --all-targets
cargo clippy -- -D warnings
RUSTDOCFLAGS="-Dwarnings" cargo doc --all --no-deps
cargo test -- --nocapture
-cargo build --all-targets
```
If you'd like to mass "fix" everything, you should commit/save existing work and execute the following:
@@ -48,4 +48,30 @@ cargo +nightly udeps
cargo bloat --release
cargo bloat --release --crates
cargo audit
-``` \ No newline at end of file
+```
+
+## Nix Flake (macOS and Linux only)
+
+If you prefer to avoid mutating your local environment, you can use the `nix` [flake](./flake.nix)!
+
+> If you do not have `nix` installed and are unsure where to start, you can check out the
+> [Zero to Nix installation guide](https://zero-to-nix.com/start/install).
+
+You can enter a `nix` environment with everything you need.
+
+```shell
+nix develop
+```
+
+If you prefer to not enter the environment and run a single command, you can use the
+`--command` flag.
+
+```shell
+nix develop --command cargo test
+```
+
+Update dependencies with the following command:
+
+```shell
+nix flake update
+```
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..11039ef
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,77 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "locked": {
+ "lastModified": 1659877975,
+ "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1677609835,
+ "narHash": "sha256-pf6W6yDHerq1GZtM8d3ZSQMID1ICYeiv3cpPgvXpW1E=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "44e1ca49a9ed9f85603d0eb5c15e2608f63bcd95",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1665296151,
+ "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs",
+ "rust-overlay": "rust-overlay"
+ }
+ },
+ "rust-overlay": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs_2"
+ },
+ "locked": {
+ "lastModified": 1677551437,
+ "narHash": "sha256-KidNaM3fTvixGQwJPrbR4hon6FjT2Doil1Fq1GaeLpA=",
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "rev": "c1df023b1aaded1b65a1f4ad604a98a58ab4db97",
+ "type": "github"
+ },
+ "original": {
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..4519104
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,37 @@
+{
+ description = "gfold is a CLI tool to help keep track of your Git repositories";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs";
+ rust-overlay.url = "github:oxalica/rust-overlay";
+ };
+
+ outputs = { self, nixpkgs, rust-overlay }:
+ let
+ overlays = [
+ (import rust-overlay)
+ (self: super: {
+ rustToolchain = super.rust-bin.stable.latest.default;
+ })
+ ];
+
+ nameValuePair = name: value: { inherit name value; };
+ genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
+ allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
+ forAllSystems = f: genAttrs allSystems (system: f {
+ pkgs = import nixpkgs { inherit overlays system; };
+ });
+ in
+ {
+ devShells = forAllSystems ({ pkgs }: {
+ default = pkgs.mkShell {
+ buildInputs = (with pkgs; [
+ rustToolchain
+ ]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
+ libiconv
+ darwin.apple_sdk.frameworks.Security
+ ]);
+ };
+ });
+ };
+}