From 7fbdf51c0d72e2734f5e4f7a6d96cf2e1cea5471 Mon Sep 17 00:00:00 2001 From: orveth Date: Sun, 1 Feb 2026 16:00:44 -0800 Subject: [PATCH 1/2] ci: add GitHub Actions workflow with Nix caching - Add CI workflow running on ubuntu-latest and macos-latest - Use DeterminateSystems/nix-installer-action for Nix installation - Use DeterminateSystems/magic-nix-cache-action for build caching - Run cargo build, test, and clippy with -D warnings - Add CI and License badges to README Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1125fd4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + check: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v17 + + - name: Enable Nix cache + uses: DeterminateSystems/magic-nix-cache-action@v8 + + - name: Build + run: nix develop --command cargo build + + - name: Test + run: nix develop --command cargo test + + - name: Clippy + run: nix develop --command cargo clippy -- -D warnings diff --git a/README.md b/README.md index 9ae4614..6957e20 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # njalla-cli +[![CI](https://github.com/orveth/njalla-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/orveth/njalla-cli/actions/workflows/ci.yml) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + Privacy-first domain management CLI for [Njalla](https://njal.la), built in Rust. > **Disclaimer:** This is an unofficial project and is not affiliated with or endorsed by Njalla. Use at your own risk. Always verify important operations through the official Njalla web interface. From 1467a702620e9ee574cadef90b803f552b2d6b0b Mon Sep 17 00:00:00 2001 From: orveth Date: Sun, 1 Feb 2026 16:12:17 -0800 Subject: [PATCH 2/2] fix: use inlined format args for clippy pedantic --- src/client.rs | 4 ++-- src/output.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.rs b/src/client.rs index 66d0e2b..a1f8ab8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -88,7 +88,7 @@ impl NjallaClient { }; if self.debug { - eprintln!("[DEBUG] Request: {} {:?}", method, params); + eprintln!("[DEBUG] Request: {method} {params:?}"); } let response = self @@ -102,7 +102,7 @@ impl NjallaClient { let response_text = response.text().await?; if self.debug { - eprintln!("[DEBUG] Response: {}", response_text); + eprintln!("[DEBUG] Response: {response_text}"); } let api_response: ApiResponse = serde_json::from_str(&response_text)?; diff --git a/src/output.rs b/src/output.rs index a4215fd..9524e6c 100644 --- a/src/output.rs +++ b/src/output.rs @@ -339,7 +339,7 @@ pub fn format_transactions(transactions: &[Transaction], format: OutputFormat) - // Pad before coloring to avoid ANSI codes breaking alignment let amount_raw = format!("€{}", t.amount); - let amount_padded = format!("{:<10}", amount_raw); + let amount_padded = format!("{amount_raw:<10}"); let amount_str = if t.completed.is_some() { amount_padded.green().to_string() } else {