Skip to content

Releases: aRustyDev/pre-commit-hooks

v0.3.0 - Nix & Rust Hooks

08 Jul 04:22
v0.3.0
c16a199

Choose a tag to compare

🎉 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

Added Pluralith Hook

21 Aug 13:24
v0.1.4
8dcdf33

Choose a tag to compare

Added Pluralith Hook Pre-release
Pre-release
v0.1.4

feat: added pluralit (untested)

v0.1.3

22 Jul 14:34
acf4bf7

Choose a tag to compare

Copies not just dir but files and dirs

v0.1.2

22 Jul 04:26
acf4bf7

Choose a tag to compare

explicitly set GIT_DIR w/ 'git rev-parse --show-toplevel'

v0.1.1

22 Jul 04:14
0fc5f56

Choose a tag to compare

Switch hooks/backup-nixos to /usr/bin/env bash

v0.1.0

22 Jul 03:36
af10786

Choose a tag to compare

Added 'backup-nixos-config' hook