anvilsign in

collin/anvil · 0bfd5861

chore: sort derive attributes with cargo-sort-derives

Collin Richards · 2026-06-10 08:23 UTC · 0bfd5861c1b2ec0baf9b4e20b9e5702837251ac0 · parent 89e731e4 · browse files

modified.githooks/pre-commit+9 −1
11 #!/bin/sh
2-# Pre-commit: rustfmt (nightly, for the unstable options in rustfmt.toml) + clippy.
2+# Pre-commit: rustfmt (nightly, for the unstable options in rustfmt.toml),
3+# cargo-sort-derives, and clippy.
34 # Wired up via `git config core.hooksPath .githooks`.
45 set -e
56
⋯ 4 unchanged lines
1011 exit 1
1112 fi
1213
14+if ! cargo sort-derives --check >/dev/null 2>&1; then
15+ cargo sort-derives
16+ echo "pre-commit: cargo sort-derives reordered derives — review, re-stage, and commit again." >&2
17+ git diff --name-only -- '*.rs' >&2
18+ exit 1
19+fi
20+
1321 cargo clippy --workspace --all-targets -- -D warnings
modifiedCLAUDE.md+2 −1
⋯ 2 unchanged lines
33 A minimal, self-hosted git forge in Rust, built on gix (gitoxide).
44
55 Dev setup: `git config core.hooksPath .githooks` — the pre-commit hook runs
6-`cargo +nightly fmt` (nightly, for the unstable options in rustfmt.toml) and
6+`cargo +nightly fmt` (nightly, for the unstable options in rustfmt.toml),
7+`cargo sort-derives` (`cargo install cargo-sort-derives`), and
78 `cargo clippy --workspace --all-targets -- -D warnings`.
89
910 Current status, resume notes, the agreed next steps (a/b/c), and the roadmap live
⋯ 3 unchanged lines
modifiedcrates/anvil-core/src/ci.rs+2 −2
⋯ 21 unchanged lines
2222 pub const PIPELINE_PATH: &str = ".anvil/ci.yml";
2323
2424 /// A parsed pipeline: a base image and ordered straight-line steps.
25-#[derive(Debug, Clone, Deserialize)]
25+#[derive(Clone, Debug, Deserialize)]
2626 pub struct Pipeline {
2727 /// Docker image the steps run in, e.g. `rust:1.95-bookworm`.
2828 pub image: String,
⋯ 2 unchanged lines
3131 }
3232
3333 /// One pipeline step: a shell command, with an optional display name.
34-#[derive(Debug, Clone, Deserialize)]
34+#[derive(Clone, Debug, Deserialize)]
3535 pub struct Step {
3636 #[serde(default)]
3737 pub name: String,
⋯ 205 unchanged lines
modifiedcrates/anvil-core/src/config.rs+4 −4
⋯ 17 unchanged lines
1818 /// Top-level anvil configuration.
1919 ///
2020 /// Load with [`Config::load`] (from a TOML file) or [`Config::default`].
21-#[derive(Debug, Clone, Serialize, Deserialize)]
21+#[derive(Clone, Debug, Deserialize, Serialize)]
2222 #[serde(default)]
2323 pub struct Config {
2424 /// Root directory holding all server state (database + repositories).
⋯ 13 unchanged lines
3838 /// POSTs to [`deploy_webhook`](CiConfig::deploy_webhook). This is deliberately
3939 /// scoped to **one** repository — no other repo can trigger the deploy, even
4040 /// with its own passing CI.
41-#[derive(Debug, Clone, Serialize, Deserialize)]
41+#[derive(Clone, Debug, Deserialize, Serialize)]
4242 #[serde(default)]
4343 pub struct CiConfig {
4444 /// The one repository (`owner/name`) permitted to trigger the deploy
⋯ 35 unchanged lines
8080 pub run_as: String,
8181 }
8282
83-#[derive(Debug, Clone, Serialize, Deserialize)]
83+#[derive(Clone, Debug, Deserialize, Serialize)]
8484 #[serde(default)]
8585 pub struct HttpConfig {
8686 /// Address the HTTP server binds to, e.g. `127.0.0.1:3000`.
⋯ 8 unchanged lines
9595 pub highlight_cache_mb: usize,
9696 }
9797
98-#[derive(Debug, Clone, Serialize, Deserialize)]
98+#[derive(Clone, Debug, Deserialize, Serialize)]
9999 #[serde(default)]
100100 pub struct SshConfig {
101101 /// Whether the SSH git transport is enabled.
⋯ 178 unchanged lines
modifiedcrates/anvil-core/src/models.rs+1 −1
⋯ 41 unchanged lines
4242 /// `status` is one of `queued`, `running`, `success`, `failure` (a step exited
4343 /// non-zero), or `error` (the runner itself failed). `started_at`/`finished_at`
4444 /// are 0 until they occur.
45-#[derive(Debug, Clone, toasty::Model)]
45+#[derive(Clone, Debug, toasty::Model)]
4646 pub struct CiRun {
4747 #[key]
4848 #[auto]
⋯ 43 unchanged lines
modifiedcrates/anvil-git/src/browse.rs+1 −1
⋯ 117 unchanged lines
118118 }
119119
120120 /// How a file changed between two commits.
121-#[derive(Clone, Copy, PartialEq, Eq)]
121+#[derive(Clone, Copy, Eq, PartialEq)]
122122 pub enum ChangeKind {
123123 Added,
124124 Deleted,
⋯ 380 unchanged lines
modifiedcrates/anvil-git/src/smart_http.rs+1 −1
⋯ 23 unchanged lines
2424 use crate::error::Result;
2525
2626 /// The two git wire services.
27-#[derive(Debug, Copy, Clone, Eq, PartialEq)]
27+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
2828 pub enum Service {
2929 /// `git-upload-pack` — serves fetch/clone.
3030 UploadPack,
⋯ 125 unchanged lines
modifiedvendor/gitserver-core/src/discovery.rs+2 −2
⋯ 19 unchanged lines
2020 "Unnamed repository; edit this file 'description' to name the repository.";
2121
2222 /// Information about a discovered bare git repository.
23-#[derive(Debug, Clone, Serialize)]
23+#[derive(Clone, Debug, Serialize)]
2424 pub struct RepoInfo {
2525 pub name: String,
2626 pub relative_path: String,
⋯ 4 unchanged lines
3131 }
3232
3333 /// A store of discovered repositories under a root directory.
34-#[derive(Debug, Clone)]
34+#[derive(Clone, Debug)]
3535 pub struct RepoStore {
3636 root: PathBuf,
3737 max_depth: u32,
⋯ 268 unchanged lines
modifiedvendor/gitserver-core/src/pack.rs+2 −2
⋯ 14 unchanged lines
1515 };
1616 use crate::pktline;
1717
18-#[derive(Debug, Clone, Default)]
18+#[derive(Clone, Debug, Default)]
1919 pub struct UploadPackCapabilities {
2020 pub ofs_delta: bool,
2121 pub multi_ack: bool,
2222 pub multi_ack_detailed: bool,
2323 }
2424
25-#[derive(Debug, Clone, Default)]
25+#[derive(Clone, Debug, Default)]
2626 pub struct ShallowRequest {
2727 pub depth: Option<usize>,
2828 pub client_shallows: Vec<gix::ObjectId>,
⋯ 820 unchanged lines