#+title: tex-fmt
* Tasks
* Release process
** DONE Checkout main branch
** DONE Update release notes in NEWS.md
*** DONE git log --oneline --no-merges vX.X.X..main
** DONE Update version number in Cargo.toml to vY.Y.Y
** DONE Update version number for pre-commit in README
** DONE Update year in LICENSE
** DONE Update Nix flake and lock
*** DONE just nix
*** DONE nix develop
** DONE Update Rust version
*** DONE just upgrade
*** DONE Update bindgen version in CI GitHub action file from Cargo.toml
** DONE Run tests
*** DONE just
*** DONE just perf
*** DONE Update performance results in README.md
** Push to GitHub and check action tests pass
** Create a git tag
*** git tag vY.Y.Y
*** git push --tags
*** Can delete remote tags with git push --delete origin vY.Y.Y
** Publish to crates.io
*** cargo package --list
*** cargo publish
*** Pass --allow-dirty if notes.org has changed
** Publish GitHub release with notes from NEWS.md
*** No need to add a title
*** GitHub binaries published automatically with actions
** Submit to CTAN
*** Update version, update, announcement in ctan/latex-formatter.pkg
*** Update ctan/README.md
*** Update LaTeX docs at ctan/latex-formatter.tex
*** cd ctan
*** just ctan
*** gh release download vY.Y.Y -D latex-formatter/bin
*** tar -czf latex-formatter.tar.gz latex-formatter
*** Validate with ctan-o-mat latex-formatter.pkg
*** Submit with ctan-o-mat --submit latex-formatter.pkg
** Publish in nixpkgs
*** Go to nixpkgs fork directory
*** git checkout master
*** git fetch upstream
*** git rebase upstream/master
*** git fetch
*** git push --force-with-lease origin master
*** git branch -d update-tex-fmt
*** git switch --create update-tex-fmt upstream/master
*** nvim pkgs/by-name/te/tex-fmt/package.nix
*** Update version and invalidate src.hash and cargoHash
*** nix-build -A tex-fmt
*** Fix both hashes, get a successful build
*** git add pkgs/by-name/te/tex-fmt/package.nix
*** git commit -m "tex-fmt: X.X.X -> Y.Y.Y"
*** git push --set-upstream origin HEAD
*** Go to GitHub and create a pull request
*** Submit pull request and check relevant boxes
** Tidy repository
*** Commit any new changes to NEWS.md or notes.org
* CLI and config structure
*** args.rs
**** Core argument definitions
**** Args struct defines arguments used internally by tex-fmt
**** OptionArgs struct defines an intermediate target
***** CLI arguments are read into OptionArgs in cli.rs
***** Config file arguments are read into OptionArgs in config.rs
***** Default values for OptionArgs are defined here
**** These OptionArgs are merged together
**** Then converted into Args
**** Conflicting arguments are resolved
**** The Display trait is implemented for args
*** command.rs
**** Contains the clap command definition
**** Sets options exposed to the user on the CLI
*** cli.rs
**** Logic for reading from CLI
**** Clap uses command.rs to read from CLI
**** This file then parses from clap into OptionArgs
*** config.rs
**** Logic for reading from config file
**** Determines the config file path by looking in several places
**** Reads from this path and parses to a toml Table
**** Values are then assigned to an OptionArgs struct
* Process for adding new arguments
** General
*** args.rs
**** Update Args struct if core argument
**** Update OptionArgs struct
**** Update Args resolve() if extra logic necessary
**** Update Args fmt::Display if core argument
** CLI arguments
*** command.rs
**** Update clap command definition
*** cli.rs
**** Update get_cli_args() and add extra logic if needed
** Config arguments
*** config.rs
**** Update get_config_args()
** Fix compiler warnings
** Implement behaviour
** Add tests
** Update README
*** CLI options
*** Config options
*** Usage section if commonly used option
