audit-cli

Crates.ioaudit-cli
lib.rsaudit-cli
version0.1.4
created_at2024-11-27 18:44:23.500166+00
updated_at2024-12-03 22:36:43.315907+00
descriptionA tool to validate Advent of Code solutions
homepage
repositoryhttps://github.com/durocodes/audit
max_upload_size
id1463514
size210,619
Duro (DuroCodes)

documentation

README

Audit

Audit is a CLI tool that helps you validate and refactor your advent of code solutions. Supports any language, and can be used as a pipe.

[!WARNING] Audit doesn't download inputs or check your answers on advent of code; it's used to refactor your code once you've came up with an initial solution.

Installation

You can use cargo install audit-cli to install the CLI tool on your system, with the aud alias (given you have Rust installed)

Usage

  1. Create a configuration file in your project (default: .audit.toml)
  2. Make sure your advent of code solutions print to the standard output, such as:
Day 1
Part 1: 123
Part 2: 456
  1. Run aud with your advent of code program, such as aud python day1.py

[!TIP] You can also pass aud as a pipe, such as python day1.py | aud

Configuration

You can specify a custom configuration path with the -c/--config flag, such as python day1.py | aud -c audit.toml

"$schema" = "https://raw.githubusercontent.com/durocodes/audit/main/schema.json" # <- optional editor support

[[solutions]]
day = 1
part1 = "123"
part2 = "456"

[[solutions]]
day = 2
part1 = "789"
part2 = "012"

# ...

Example

You can find a minimal example in the example directory, which contains a Python "solution" and a configuration file.

The example can be run with python runner.py | aud (make sure you're in the example directory)

Commit count: 8

cargo fmt