Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
hooks: Enable typos, fix reported errors
Merged lorenz opened 2 months ago
6 files changed +30 -7 5fa68ed8 0e9d7607
modified .codespellrc
@@ -1,4 +1,4 @@
[codespell]
-
skip = .git*,*.lock,.codespellrc
+
skip = .git*,*.lock,.codespellrc,target,.jj
check-hidden = true
-
ignore-words-list = ser,noes
+
ignore-words-list = set,noes
added .typos.toml
@@ -0,0 +1,16 @@
+
[default]
+
extend-ignore-re = [
+
    "[0-9a-f]{7}\\.\\.\\.?[0-9a-f]{7}", # Git range between two short commit IDs
+
    "[0-9a-f]{7}\\[\\.\\.\\]", # Shortened commit IDs as written in tests
+
    "did:key:z6Mk[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{44}",
+
    "rad://z[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{28}",
+
    "rad:z[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{28}",
+
    "z6Mk[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{44}",
+
]
+

+
[default.extend-identifiers]
+
"typ" = "typ" # We may write "typ" instead of "type". The latter is a Rust keyword.
+

+
[type.codespell]
+
check-file = false
+
extend-glob = [".codespellrc"]
modified build.rs
@@ -31,7 +31,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
        // x.y.z, with efe10f95be being a unique prefix of the OID of
        // `HEAD`, and the working directory was dirty.
        // If this is a build pointing to a commit that has release tag, this
-
        // will just return the tag name itelf, e.g. `releases/x.y.z`.
+
        // will just return the tag name itself, e.g. `releases/x.y.z`.
        // If all fails, we just use `hash`, which, in the worst case is
        // still "unknown" (see above) but in most cases will just be
        // the short OID of `HEAD`.
modified crates/radicle-protocol/src/service/limiter.rs
@@ -155,7 +155,7 @@ mod test {
    }

    #[test]
-
    fn test_limitter_refill() {
+
    fn test_limiter_refill() {
        let mut r = RateLimiter::default();
        let t = (3, 0.2); // Three tokens burst. One token every 5 seconds.
        let a = HostName::Dns(String::from("seed.radicle.example.com"));
@@ -187,7 +187,7 @@ mod test {

    #[test]
    #[rustfmt::skip]
-
    fn test_limitter_multi() {
+
    fn test_limiter_multi() {
        let t = (1, 1.0); // One token per second. One token burst.
        let n = arbitrary::gen::<NodeId>(1);
        let n = Some(&n);
@@ -207,7 +207,7 @@ mod test {

    #[test]
    #[rustfmt::skip]
-
    fn test_limitter_different_rates() {
+
    fn test_limiter_different_rates() {
        let t1 = (1, 1.0); // One token per second. One token burst.
        let t2 = (2, 2.0); // Two tokens per second. Two token burst.
        let n = arbitrary::gen::<NodeId>(1);
modified crates/radicle-ssh/src/encoding.rs
@@ -56,7 +56,7 @@ pub trait Encoding {
    /// May panic if the argument is greater than [`u32::MAX`].
    /// This is a convenience method, to spare callers casting or converting
    /// [`usize`] to [`u32`]. If callers end up in a situation where they
-
    /// need to push a 32-bit unisgned integer, but the value they would
+
    /// need to push a 32-bit unsigned integer, but the value they would
    /// like to push does not fit 32 bits, then the implementation will not
    /// comply with the SSH format anyway.
    fn extend_usize(&mut self, u: usize) {
modified flake.nix
@@ -235,6 +235,13 @@
              hooks =
                {
                  alejandra.enable = true;
+
                  typos = {
+
                    enable = true;
+
                    settings = {
+
                      verbose = true;
+
                      write = true;
+
                    };
+
                  };
                  codespell = {
                    enable = true;
                    entry = "${lib.getExe pkgs.codespell} -w";