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. 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 {