Skip to content

Commit

Permalink
Fixing minor paths for consistency (#49)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
JustusAdam committed Sep 22, 2023
1 parent 0c1dd8c commit cc1e5da
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion crates/paralegal-flow/src/ana/inline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ fn dump_dot_graph<W: std::io::Write>(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<A: FnMut(ArgNum) -> GlobalLocation>(
&self,
Expand Down
2 changes: 1 addition & 1 deletion crates/paralegal-flow/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ pub struct ModelCtrl {
/// The file is expected to contain a `HashMap<Identifier, (Vec<Annotation>,
/// 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<std::path::PathBuf>,
Expand Down
4 changes: 2 additions & 2 deletions crates/paralegal-flow/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions crates/paralegal-flow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,

Expand Down
23 changes: 11 additions & 12 deletions crates/paralegal-flow/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn use_rustc<A, F: FnOnce() -> 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.
///
Expand All @@ -60,44 +60,43 @@ pub fn run_paralegal_flow_with_graph_dump(dir: impl AsRef<Path>) -> 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<Path>) -> 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<I, S>(dir: impl AsRef<Path>, extra: I) -> bool
where
I: IntoIterator<Item = S>,
Expand All @@ -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.
///
Expand All @@ -123,7 +122,7 @@ pub fn run_paralegal_flow_with_flow_graph_dump(dir: impl AsRef<Path>) -> 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.
///
Expand Down
10 changes: 5 additions & 5 deletions crates/paralegal-policy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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");
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion crates/paralegal-spdg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
13 changes: 7 additions & 6 deletions doc-src/index.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit cc1e5da

Please sign in to comment.