Skip to content

Commit

Permalink
Split out parts of noseyparker into additional internal crates
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlarsen committed Oct 23, 2023
1 parent a670209 commit a67e81a
Show file tree
Hide file tree
Showing 25 changed files with 179 additions and 63 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@

# scripts/create-release.zsh output directory
/release

# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json
80 changes: 57 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ rust-version = "1.70"

license = "Apache-2.0"
authors = ["Brad Larsen <bradford.larsen@praetorian.com>"]

homepage = "https://github.com/praetorian-inc/noseyparker"
repository = "https://github.com/praetorian-inc/noseyparker"

version = "0.16.0-dev"

publish = false


[profile.release]
# Generate debug symbols even in release builds
# Used for cargo-instruments: https://github.com/cmyr/cargo-instruments
Expand All @@ -22,6 +25,7 @@ publish = false
lto = "thin"
opt-level = 3 # default for release profile


# Insta benefits from being compiled in release mode, even as dev dependency.
[profile.dev.package.insta]
opt-level = 3
Expand Down
16 changes: 16 additions & 0 deletions crates/bstring-serde/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "bstring-serde"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
version = "0.0.0"
publish.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bstr = { version = "1.0", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
File renamed without changes.
2 changes: 1 addition & 1 deletion crates/content-guesser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ homepage.workspace = true
repository.workspace = true
publish.workspace = true

name = "content_guesser"
name = "content-guesser"
version = "0.0.0"

[features]
Expand Down
41 changes: 41 additions & 0 deletions crates/input-enumerator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[package]
name = "input-enumerator"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
version = "0.0.0"
publish.workspace = true

[features]
gix_debug = ["gix-object/verbose-object-parsing-errors"]

[dependencies]
progress = { path = "../progress" }

anyhow = { version = "1.0" }
bstr = { version = "1.0", features = ["serde"] }
bstring-serde = { path = "../bstring-serde" }
fixedbitset = "0.4"

# The following two dependencies get enabled by the `gix_debug` feature
#
# note that the `verbose-object-parsing-errors` feature is:
# - broken in gix 0.53 + gix-object 0.36,
# - broken in gix 0.52 + gix-object 0.35
# - not broken in gix 0.51 + gix-object 0.33
gix = { version = "0.55", features = ["max-performance", "serde"] }
gix-object = { version = "0.38", features = ["verbose-object-parsing-errors"], optional = true }

ignore = "0.4"
petgraph = "0.6"
roaring = "0.10"
serde = { version = "1.0", features = ["derive"] }
smallvec = { version = "1.11", features = ["const_generics", "const_new", "union"] }
tracing = "0.1"

[dev-dependencies]
pretty_assertions = "1.3"
proptest = "1.0"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bstr::BString;
use gix::ObjectId;
use gix::date::Time;

use crate::utils::BStringSerde;
use bstring_serde::BStringSerde;


// FIXME: figure out how to do this without allocating
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::time::Instant;
use tracing::{debug, warn};

use crate::bstring_table::BStringTable;
use crate::progress::Progress;
use progress::Progress;

type Symbol = crate::bstring_table::Symbol<u32>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use tracing::{error_span, warn};
use crate::blob_appearance::{BlobAppearance, BlobAppearanceSet};
use crate::git_commit_metadata::CommitMetadata;
use crate::git_metadata_graph::GitMetadataGraph;
use crate::progress::Progress;

use progress::Progress;

// -------------------------------------------------------------------------------------------------
// implementation helpers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
pub mod blob_appearance;
pub mod bstring_table;
pub mod git_commit_metadata;
pub mod git_metadata_graph;

use anyhow::Result;
use ignore::{DirEntry, WalkBuilder, WalkState};
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use tracing::{debug, error, warn};

use crate::progress::Progress;
use progress::Progress;

mod git_repo_enumerator;
pub use git_repo_enumerator::{GitRepoEnumerator, GitRepoWithMetadataEnumerator, GitRepoResult};
Expand Down
Loading

0 comments on commit a67e81a

Please sign in to comment.