Skip to content

v0.3.0 - Nix & Rust Hooks

Latest

Choose a tag to compare

@aRustyDev aRustyDev released this 08 Jul 04:22
· 23 commits to main since this release
v0.3.0
c16a199

🎉 New Features

🧪 Nix Development Hooks

This release introduces comprehensive pre-commit hooks for Nix development:

  • nix-flake-check: Validates flake.nix files using nix flake check
  • nix-build-check: Tests Nix builds for both flakes and legacy expressions
  • nix-darwin-check: Validates nix-darwin configurations (Darwin-only)
  • nix-home-manager-check: Tests home-manager configurations
  • nix-fmt: Formats Nix files (supports nixpkgs-fmt, alejandra, nixfmt)
  • nix-lint: Lints Nix files using statix and optionally deadnix

All Nix hooks include:

  • ✅ Automatic tool installation if missing
  • ✅ Support for both flakes and legacy Nix
  • ✅ Clear error messages
  • ✅ Configurable behavior via environment variables

🦀 Rust/Cargo Hooks

  • fmt: Format files with cargo fmt
  • cargo-check: Check the package for errors
  • clippy: Lint rust sources
  • rustc: Run cargo rustc following the cargo.toml file
  • build-docs: Build rust documentation
  • generate-report: Check for future incompatibilities
  • cargo-bench: Compile and execute benchmarks

📝 Other Improvements

  • Added dead-links checker for markdown files
  • Added pluralith hook for generating Terraform diagrams
  • Added tfupdate hook for updating Terraform version constraints
  • Documentation improvements and TODO additions

📦 Installation

repos:
  - repo: https://github.com/aRustyDev/pre-commit-hooks
    rev: v0.3.0
    hooks:
      # Nix hooks
      - id: nix-fmt
        args: [--formatter=alejandra]  # optional
      - id: nix-lint
        args: [--with-deadnix]  # optional
      - id: nix-flake-check
      - id: nix-build-check
      
      # Rust hooks
      - id: fmt
      - id: clippy
      - id: cargo-check
      
      # Other useful hooks
      - id: dead-links
      - id: pluralith

🙏 Contributors

📋 Full Changelog

v0.2.1...v0.3.0