From f1ef56b7984f94de783532ef5dfe90cc16a051f5 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 29 Sep 2026 12:37:13 +0200 Subject: [PATCH] build: define detector formatter and LSP targets --- Cargo.toml | 13 +++++++++++++ Jenkinsfile | 9 +++++---- README.md | 4 ++++ src/bin/john-slop-fmt.rs | 9 +++++++++ src/bin/john-slop-lsp.rs | 9 +++++++++ src/{main.rs => bin/john-slop.rs} | 7 ++----- tasks.md | 2 +- 7 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 src/bin/john-slop-fmt.rs create mode 100644 src/bin/john-slop-lsp.rs rename src/{main.rs => bin/john-slop.rs} (81%) diff --git a/Cargo.toml b/Cargo.toml index cfce6c1..a51b4e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,19 @@ edition = "2024" rust-version = "1.88" license = "MIT" repository = "https://git.dandaedre.com/idle-org/john_slop" +autobins = false + +[[bin]] +name = "john-slop" +path = "src/bin/john-slop.rs" + +[[bin]] +name = "john-slop-fmt" +path = "src/bin/john-slop-fmt.rs" + +[[bin]] +name = "john-slop-lsp" +path = "src/bin/john-slop-lsp.rs" [dependencies] miette = { version = "7.6.0", features = ["fancy"] } diff --git a/Jenkinsfile b/Jenkinsfile index 2ebf4a6..3e57bf8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -133,7 +133,7 @@ pipeline { sh ''' set -eu - echo "Building john_slop release binary..." + echo "Building John Slop release binaries..." cargo build \ --locked \ @@ -143,9 +143,10 @@ pipeline { echo echo "Release build completed." - if [ -f target/release/john_slop ]; then - ls -lh target/release/john_slop - fi + ls -lh \ + target/release/john-slop \ + target/release/john-slop-fmt \ + target/release/john-slop-lsp ''' } } diff --git a/README.md b/README.md index 5480d77..fa44238 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ The temporary command-line entry point accepts one file, directory, or supported ZIP-based path and prints a summary per document. Its interface will be replaced by the planned Clap-based detector binary during Milestone 1. +Cargo exposes explicit `john-slop`, `john-slop-fmt`, and `john-slop-lsp` binary +targets. The formatter and LSP currently exit with an explanatory unsupported +message until their dedicated implementation milestones. + Reusable consumers should call the library facade: `load_config`, `analyze_source`, `plan_replacements`, and `read_inputs`. Replacement planning is pure and shares the exact resolved configuration used by analysis. diff --git a/src/bin/john-slop-fmt.rs b/src/bin/john-slop-fmt.rs new file mode 100644 index 0000000..031eb3d --- /dev/null +++ b/src/bin/john-slop-fmt.rs @@ -0,0 +1,9 @@ +//! Formatter command-line adapter scaffold. + +use miette::{Result, miette}; + +fn main() -> Result<()> { + Err(miette!( + "john-slop-fmt is not implemented yet; replacement planning is available through the library" + )) +} diff --git a/src/bin/john-slop-lsp.rs b/src/bin/john-slop-lsp.rs new file mode 100644 index 0000000..d92608c --- /dev/null +++ b/src/bin/john-slop-lsp.rs @@ -0,0 +1,9 @@ +//! Language-server adapter scaffold. + +use miette::{Result, miette}; + +fn main() -> Result<()> { + Err(miette!( + "john-slop-lsp is not implemented yet; LSP support is planned for Milestone 6" + )) +} diff --git a/src/main.rs b/src/bin/john-slop.rs similarity index 81% rename from src/main.rs rename to src/bin/john-slop.rs index a321d9b..621fe01 100644 --- a/src/main.rs +++ b/src/bin/john-slop.rs @@ -1,7 +1,4 @@ -//! Command-line entry point for the John Slop prototype. - -#![warn(clippy::missing_docs_in_private_items)] -#![allow(dead_code)] +//! Detector command-line adapter. use std::{env, path::Path}; @@ -11,7 +8,7 @@ use miette::{IntoDiagnostic, Result, WrapErr, miette}; fn main() -> Result<()> { let path = env::args_os() .nth(1) - .ok_or_else(|| miette!("usage: john_slop "))?; + .ok_or_else(|| miette!("usage: john-slop "))?; let config = load_config(); let documents = read_inputs(&config, Path::new(&path)) diff --git a/tasks.md b/tasks.md index ffd9a47..e9054df 100644 --- a/tasks.md +++ b/tasks.md @@ -56,7 +56,7 @@ are written down, and a clean baseline passes all quality gates. decompression bombs using the limits from Milestone 0. - [x] Centralize error enums with `thiserror`; add `miette` context only at presentation boundaries. Remove placeholder `try_report` and sample reports. -- [ ] Add explicit `[[bin]]` targets for `john-slop`, `john-slop-fmt`, and +- [x] Add explicit `[[bin]]` targets for `john-slop`, `john-slop-fmt`, and `john-slop-lsp`; the latter two may initially call stub adapters but all three must compile. - [ ] Keep binary parsing/orchestration out of the library. Add `clap` with derive