"""Configure the Ruff style checks and formatting commands."""
#! /usr/bin/env python

# Inherit the parent construction environment
Import("env")

ruff_check = env.Command(
    target=["ruff-check.txt"],
    source=["pyproject.toml"],
    action=["ruff check . && ruff format . --check"],
)
env.AlwaysBuild(ruff_check)
env.Alias("ruff-check", ruff_check)
env.Alias("style", ruff_check)
ruff_format = env.Command(
    target=["ruff-format.txt"],
    source=["pyproject.toml"],
    action=["ruff check . --fix; ruff format ."],
)
env.AlwaysBuild(ruff_format)
env.Alias("ruff-format", ruff_format)
