From cc1e5da0faa21c5f0478eeca51ba9459a5ab7abb Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Fri, 22 Sep 2023 14:53:19 -0400 Subject: [PATCH] Fixing minor paths for consistency (#49) ## What Changed? Changes occurrences of `paralegal_flow` to `paralegal-flow`. ## Why Does It Need To? Basically completes #48. Unlike that issue this one is only about occurrences of this name that aren't crucial to be right, because they are not used in code but in documentation, error messages etc. ## Checklist - [x] Above description has been filled out so that upon quash merge we have a good record of what changed. - [x] New functions, methods, types are documented. Old documentation is updated if necessary - [x] Documentation in Notion has been updated - [x] Tests for new behaviors are provided - [x] New test suites (if any) ave been added to the CI tests (in `.github/workflows/rust.yml`) either as compiler test or integration test. *Or* justification for their omission from CI has been provided in this PR description. --- crates/paralegal-flow/src/ana/inline/mod.rs | 2 +- crates/paralegal-flow/src/args.rs | 2 +- crates/paralegal-flow/src/consts.rs | 4 ++-- crates/paralegal-flow/src/lib.rs | 8 +++---- crates/paralegal-flow/src/test_utils.rs | 23 ++++++++++----------- crates/paralegal-policy/src/lib.rs | 10 ++++----- crates/paralegal-spdg/src/lib.rs | 2 +- doc-src/index.md | 13 ++++++------ 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/crates/paralegal-flow/src/ana/inline/mod.rs b/crates/paralegal-flow/src/ana/inline/mod.rs index 3a507a4e9f..ffc19fa341 100644 --- a/crates/paralegal-flow/src/ana/inline/mod.rs +++ b/crates/paralegal-flow/src/ana/inline/mod.rs @@ -864,7 +864,7 @@ fn dump_dot_graph(mut w: W, g: &InlinedGraph) -> std::io::Res } impl<'tcx> Inliner<'tcx> { - /// Turn the output of the inliner into the format the rest of the paralegal_flow pipeline + /// Turn the output of the inliner into the format the rest of the paralegal-flow pipeline /// understands. pub fn to_call_only_flow GlobalLocation>( &self, diff --git a/crates/paralegal-flow/src/args.rs b/crates/paralegal-flow/src/args.rs index 4552a240e1..9fe337fca1 100644 --- a/crates/paralegal-flow/src/args.rs +++ b/crates/paralegal-flow/src/args.rs @@ -334,7 +334,7 @@ pub struct ModelCtrl { /// The file is expected to contain a `HashMap, /// ObjectType)>`, which is the same type as `annotations` field from the /// `ProgramDescription` struct. It uses the `serde` derived serializer. An - /// example for the format can be generated by running paralegal_flow with + /// example for the format can be generated by running `paralegal-flow` with /// `dump_serialized_flow_graph`. #[clap(long, env)] external_annotations: Option, diff --git a/crates/paralegal-flow/src/consts.rs b/crates/paralegal-flow/src/consts.rs index d55dfd32be..f7841bebf5 100644 --- a/crates/paralegal-flow/src/consts.rs +++ b/crates/paralegal-flow/src/consts.rs @@ -11,10 +11,10 @@ use crate::Symbol; pub use paralegal_spdg::FLOW_GRAPH_OUT_NAME; lazy_static! { - /// The symbol `arguments` which we use for refinement in a `#[paralegal_flow::label(...)]` + /// The symbol `arguments` which we use for refinement in a `#[paralegal_flow::marker(...)]` /// annotation. pub static ref ARG_SYM: Symbol = Symbol::intern("arguments"); - /// The symbol `return` which we use for refinement in a `#[paralegal_flow::label(...)]` + /// The symbol `return` which we use for refinement in a `#[paralegal_flow::marker(...)]` /// annotation. pub static ref RETURN_SYM: Symbol = Symbol::intern("return"); /// The symbol `verification_hash` which we use for refinement in a diff --git a/crates/paralegal-flow/src/lib.rs b/crates/paralegal-flow/src/lib.rs index 8ab815a787..4ec6a1620a 100644 --- a/crates/paralegal-flow/src/lib.rs +++ b/crates/paralegal-flow/src/lib.rs @@ -2,7 +2,7 @@ //! //! While this is technically a "library", it only is so for the purposes of //! being able to reference the same code in the two executables `paralegal_flow` and -//! `cargo-paralegal_flow` (a structure suggested by [rustc_plugin]). +//! `cargo-paralegal-flow` (a structure suggested by [rustc_plugin]). #![feature( rustc_private, min_specialization, @@ -112,14 +112,14 @@ pub use crate::marker_db::MarkerCtx; pub struct DfppPlugin; /// Top level argument structure. This is only used for parsing. The actual -/// configuration of paralegal_flow [`struct@Args`] which is stored in `args`. `cargo_args` is +/// configuration of paralegal-flow [`struct@Args`] which is stored in `args`. `cargo_args` is /// forwarded and `_progname` is only to comply with the calling convention of /// `cargo` (it passes the program name as first argument). #[derive(clap::Parser)] #[clap(version = concat!(crate_version!(), "\nbuilt ", env!("BUILD_TIME"), "\ncommit ", env!("COMMIT_HASH")), about)] struct ArgWrapper { - /// This argument doesn't do anything, but when cargo invokes `cargo-paralegal_flow` - /// it always provides "paralegal_flow" as the first argument and since we parse with + /// This argument doesn't do anything, but when cargo invokes `cargo-paralegal-flow` + /// it always provides "paralegal-flow" as the first argument and since we parse with /// clap it otherwise complains about the superfluous argument. _progname: String, diff --git a/crates/paralegal-flow/src/test_utils.rs b/crates/paralegal-flow/src/test_utils.rs index ea9ff78b29..7ac324bda4 100644 --- a/crates/paralegal-flow/src/test_utils.rs +++ b/crates/paralegal-flow/src/test_utils.rs @@ -50,7 +50,7 @@ pub fn use_rustc A>(f: F) -> A { rustc_span::create_default_session_if_not_set_then(|_| f()) } -/// Run paralegal_flow in the current directory, passing the +/// Run paralegal-flow in the current directory, passing the /// `--dump-serialized-non-transitive-graph` flag, which dumps a /// [`CallOnlyFlow`](crate::ir::flows::CallOnlyFlow) for each controller. /// @@ -60,44 +60,43 @@ pub fn run_paralegal_flow_with_graph_dump(dir: impl AsRef) -> bool { run_paralegal_flow_with_graph_dump_and::<_, &str>(dir, []) } -/// Crates a basic invocation of `cargo paralegal_flow`, ensuring that the `cargo-paralegal_flow` -/// and `paralegal_flow` executables that were built from this project are (first) in the +/// Crates a basic invocation of `cargo paralegal-flow`, ensuring that the `cargo-paralegal-flow` +/// and `paralegal-flow` executables that were built from this project are (first) in the /// `PATH`. pub fn paralegal_flow_command(dir: impl AsRef) -> std::process::Command { let path = std::env::var("PATH").unwrap_or_else(|_| Default::default()); - // Cargo gives us the path where it wrote `cargo-paralegal_flow` to let cargo_paralegal_flow_path = Path::new("../../target/debug/cargo-paralegal-flow") .canonicalize() .unwrap(); let mut new_path = std::ffi::OsString::with_capacity( path.len() + cargo_paralegal_flow_path.as_os_str().len() + 1, ); - // We then append the parent (e.g. its directory) to the search path. THat - // directory (we presume) contains both `paralegal_flow` and `cargo-paralegal_flow`. + // We then append the parent (e.g. its directory) to the search path. That + // directory (we presume) contains both `paralegal-flow` and `cargo-paralegal-flow`. new_path.push(cargo_paralegal_flow_path.parent().unwrap_or_else(|| { panic!( - "cargo-paralegal_flow path {} had no parent", + "cargo-paralegal-flow path {} had no parent", cargo_paralegal_flow_path.display() ) })); new_path.push(":"); new_path.push(path); let mut cmd = std::process::Command::new(cargo_paralegal_flow_path); - cmd.arg("paralegal_flow") + cmd.arg("paralegal-flow") .env("PATH", new_path) .current_dir(dir); eprintln!("Command is {cmd:?}"); cmd } -/// Run paralegal_flow in the current directory, passing the +/// Run paralegal-flow in the current directory, passing the /// `--dump-serialized-non-transitive-graph` flag, which dumps a /// [`CallOnlyFlow`](crate::ir::flows::CallOnlyFlow) for each controller. /// /// The result is suitable for reading with /// [`read_non_transitive_graph_and_body`](crate::dbg::read_non_transitive_graph_and_body). /// -/// Allows for additional arguments to be passed to paralegal_flow +/// Allows for additional arguments to be passed to paralegal-flow pub fn run_paralegal_flow_with_graph_dump_and(dir: impl AsRef, extra: I) -> bool where I: IntoIterator, @@ -114,7 +113,7 @@ where .unwrap() .success() } -/// Run paralegal_flow in the current directory, passing the +/// Run paralegal-flow in the current directory, passing the /// `--dump-serialized-flow-graph` which dumps the [`ProgramDescription`] as /// JSON. /// @@ -123,7 +122,7 @@ pub fn run_paralegal_flow_with_flow_graph_dump(dir: impl AsRef) -> bool { run_paralegal_flow_with_flow_graph_dump_and::<_, &str>(dir, []) } -/// Run paralegal_flow in the current directory, passing the +/// Run paralegal-flow in the current directory, passing the /// `--dump-serialized-flow-graph` which dumps the [`ProgramDescription`] as /// JSON. /// diff --git a/crates/paralegal-policy/src/lib.rs b/crates/paralegal-policy/src/lib.rs index d50a2f5a58..6fdd6d4ef4 100644 --- a/crates/paralegal-policy/src/lib.rs +++ b/crates/paralegal-policy/src/lib.rs @@ -14,8 +14,8 @@ //! ``` //! //! 1. [`SPDGGenCommand`] lets you programmatically invoke the SDPG extractor. -//! The [`::global()`](SPDGGenCommand::global) method uses `cargo paralegal_flow` for -//! this purpose, e.g. a global installation of `cargo-paralegal_flow` that was +//! The [`::global()`](SPDGGenCommand::global) method uses `cargo paralegal-flow` for +//! this purpose, e.g. a global installation of `cargo-paralegal-flow` that was //! performed with `cargo install`. //! //! - [`::custom()`](SPDGGenCommand::custom) lets you instead pick a @@ -68,7 +68,7 @@ mod test_utils; pub use self::{context::*, flows_to::CtrlFlowsTo}; -/// Configuration of the `cargo paralegal_flow` command. +/// Configuration of the `cargo paralegal-flow` command. /// /// Takes care of passing the right kinds of arguments to produce the /// [`ProgramDescription`] graph that the properties consume. @@ -80,7 +80,7 @@ pub use self::{context::*, flows_to::CtrlFlowsTo}; pub struct SPDGGenCommand(Command); impl SPDGGenCommand { - /// Use a global installation of `paralegal_flow` via `cargo paralegal_flow`. + /// Use a global installation of `paralegal-flow` via `cargo paralegal-flow`. pub fn global() -> Self { let mut cmd = Command::new("cargo"); cmd.arg("paralegal-flow"); @@ -116,7 +116,7 @@ impl SPDGGenCommand { /// /// Can be created programmatically and automatically by running /// [`SPDGGenCommand::run`] or you can create one manually if you can `cargo -/// paralegal_flow` by hand with [`Self::custom`]. +/// paralegal-flow` by hand with [`Self::custom`]. pub struct GraphLocation(PathBuf); impl GraphLocation { diff --git a/crates/paralegal-spdg/src/lib.rs b/crates/paralegal-spdg/src/lib.rs index 580cb44dd7..73c1733666 100644 --- a/crates/paralegal-spdg/src/lib.rs +++ b/crates/paralegal-spdg/src/lib.rs @@ -514,7 +514,7 @@ impl Ctrl { self.data_flow.0.values().flatten().unique() } - /*** Below are constructor methods intended for use within paralegal_flow. ***/ + /*** Below are constructor methods intended for use within paralegal-flow. ***/ /// Extend the `types` map with the input iterator. pub fn add_types( diff --git a/doc-src/index.md b/doc-src/index.md index ca14437f8c..24866bea07 100644 --- a/doc-src/index.md +++ b/doc-src/index.md @@ -1,13 +1,14 @@ --- -title: Documentation for Dataflow++ +title: Documentation for Paralegal --- This page hosts the compiled rustdocs for -[`dfpp`](https://github.com/brownsys/dfpp) and its dependencies and also for the -rust compiler version 1.63.0, which is the one that `dfpp` is linking against. -The compiler docs do not interlink with the docs for the `dfpp` crate and its -dependencies, because I haven't yet figured out how to build them such that they -do. As a result the two documentations are hosted here separately. +[`Paralegal`](https://github.com/brownsys/dfpp) and its dependencies and also +for the rust compiler version 1.63.0, which is the one that `paralegal_flow` is +linking against. The compiler docs do not interlink with the docs for the +`paralegal_flow` crate and its dependencies, because I haven't yet figured out +how to build them such that they do. As a result the two documentations are +hosted here separately. - [Link to the paralegal-flow crate documentation](libs/paralegal_flow/index.html) (dependent, non-rustc crates are linked) - [Link to the rustc 1.63.0 documentation](compiler/index.html) \ No newline at end of file