# SPDX-FileCopyrightText: 2025 Gergely Nagy
# SPDX-FileContributor: Gergely Nagy
#
# SPDX-License-Identifier: MIT
set unstable
# Display this help screen
help:
@just --list
# Format all sources
fmt:
treefmt --ci
# Verify that all licenses are properly declared
license-check:
reuse lint
# Build iocaine, optionally with custom OPTIONS.
build *OPTIONS:
cargo build {{ OPTIONS }}
# Run Clippy with a set of lints: either "default" or "pedantic".
clippy lints="default":
@just clippy-{{ lints }}
# Update & commit a dependency. The dependency must be either "flake", "robots-json", or "fennel".
update dependency="flake" *OPTIONS:
@just update-{{ dependency }} {{ OPTIONS }}
[private]
update-flake *OPTIONS:
nix flake update --commit-lock-file {{ OPTIONS }}
GIT_EDITOR=cat git commit --amend --gpg-sign
[private, script]
update-robots-json *OPTIONS:
tarball_url="$(curl -sL --fail --fail-early https://api.github.com/repos/ai-robots-txt/ai.robots.txt/releases/latest | jq -r .tarball_url)"
version="$(curl -sL --fail --fail-early https://api.github.com/repos/ai-robots-txt/ai.robots.txt/releases/latest | jq -r .tag_name)"
curl -sL --fail --fail-early "${tarball_url}" | \
tar --strip-components=1 --wildcards --no-wildcards-match-slash -C data/defaults/etc -xzvf - '*/robots.json'
git add data/defaults/etc/robots.json
git commit --gpg-sign -m "Update robots.json to ai.robots.txt ${version}"
[private, script]
update-fennel FENNEL_VERSION="1.6.0":
curl -sL --fail --fail-early "https://fennel-lang.org/downloads/fennel-{{ FENNEL_VERSION }}.lua" \
-o data/defaults/etc/fennel.lua
git add data/defaults/etc/fennel.lua
git commit --gpg-sign -m "Update fennel.lua to {{ FENNEL_VERSION }}"
[private]
clippy-default *OPTS:
cargo clippy -- {{ OPTS }}
[private]
clippy-pedantic *OPTS:
cargo clippy -- \
-W clippy::pedantic \
-W clippy::nursery \
-W clippy::str_to_string \
-A clippy::missing_panics_doc \
-A clippy::missing_errors_doc \
-A clippy::module_name_repetitions \
-A clippy::missing_const_for_fn \
-A clippy::derive_partial_eq_without_eq \
{{ OPTS }}