Verified Commit 4c102ef1 authored by Dmitry Gruzd's avatar Dmitry Gruzd 2️⃣ Committed by GitLab
Browse files

chore(ci): verify trailing newlines

parent 36ad6a9d
Loading
Loading
Loading
Loading
+8 −0
Changes for .gitlab-ci.yml: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -440,6 +440,14 @@ fmt-check:
  script:
    - cargo fmt --all -- --check

newline-check:
  stage: lint
  extends:
    - .job-template
    - .mr-only-rules
  script:
    - mise run lint:newlines

lint-check:
  stage: lint
  extends:
+1 −0
Changes for AGENTS.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ CLI integration tests (concurrency, worktrees): `mise test:cli`.
- Assistant setup specs and mode texts in `config/setup/` validated against JSON schema (`setup-schema-validate`)
- Migration ledger validated and scope-checked (`migration-ledger-schema-validate`, `migration-ledger-check`, plus `orbit-server` build-time drift checks); full ledger rules in `docs/design-documents/schema_management.md`
- `cargo fmt` (`fmt-check`)
- Trailing newlines (`newline-check`, run locally with `mise lint:newlines`)
- `cargo shear` detects unused workspace and crate dependencies (`unused-deps-check`)
- `cargo audit`, `cargo deny`, `cargo geiger` (security stage)
- Unit tests via nextest (`unit-test`)
+1 −0
Changes for CLAUDE.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ CLI integration tests (concurrency, worktrees): `mise test:cli`.
- Assistant setup specs and mode texts in `config/setup/` validated against JSON schema (`setup-schema-validate`)
- Migration ledger validated and scope-checked (`migration-ledger-schema-validate`, `migration-ledger-check`, plus `orbit-server` build-time drift checks); full ledger rules in `docs/design-documents/schema_management.md`
- `cargo fmt` (`fmt-check`)
- Trailing newlines (`newline-check`, run locally with `mise lint:newlines`)
- `cargo shear` detects unused workspace and crate dependencies (`unused-deps-check`)
- `cargo audit`, `cargo deny`, `cargo geiger` (security stage)
- Unit tests via nextest (`unit-test`)
+19 −3
Changes for crates/xtask/src/schema.rs: 19 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -3,13 +3,29 @@ use orbit_server_config::AppConfig;
use schemars::schema_for;

pub fn run(output: Option<std::path::PathBuf>) -> Result<()> {
    let schema = schema_for!(AppConfig);
    let json = serde_json::to_string_pretty(&schema)?;
    let json = generate()?;

    match output {
        Some(path) => std::fs::write(&path, &json)?,
        None => println!("{json}"),
        None => print!("{json}"),
    }

    Ok(())
}

fn generate() -> Result<String> {
    let schema = schema_for!(AppConfig);
    let mut json = serde_json::to_string_pretty(&schema)?;
    json.push('\n');
    Ok(json)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn generated_schema_ends_with_newline() {
        assert!(generate().unwrap().ends_with('\n'));
    }
}
+3 −0
Changes for lefthook.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ pre-commit:
    - name: fmt
      run: mise run lint:fmt
      glob: "**/*.rs"
    - name: newlines
      run: mise run lint:newlines
      glob: "**/*.{rs,md,yml,yaml,toml,astro,js,ts,json,mdx,vue,rb,css,mjs}"
    # Advisory/non-blocking: narration lint prints warnings but must not block
    # the commit. The script exits non-zero on findings; `|| true` absorbs that
    # exit at the config level so lefthook treats the job as passed. (Lefthook
Loading