Skip to content

Commit

Permalink
Update lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed May 9, 2024
1 parent aaa956a commit 8135e14
Show file tree
Hide file tree
Showing 86 changed files with 261 additions and 45 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,7 @@ warpgate_pdk = "0.3.1"
# warpgate = { path = "../proto/crates/warpgate" }
# warpgate_api = { path = "../proto/crates/warpgate-api" }
# warpgate_pdk = { path = "../proto/crates/warpgate-pdk" }

[workspace.lints.clippy]
# Very noisy, lots of false positives!
assigning_clones = "allow"
3 changes: 3 additions & 0 deletions crates/bun/lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ cached = { workspace = true }
miette = { workspace = true }
rustc-hash = { workspace = true }
yarn-lock-parser = "0.7.0"

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/bun/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ tokio = { workspace = true }
moon = { path = "../../core/moon" }
moon_project_graph = { path = "../../../nextgen/project-graph" }
moon_test_utils = { path = "../../core/test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/bun/tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ miette = { workspace = true }
proto_core = { workspace = true }
rustc-hash = { workspace = true }
starbase_utils = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ moon_test_utils = { path = "../core/test-utils" }
httpmock = "0.7.0"
serial_test = "3.0.0"
starbase_archive = { workspace = true }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion crates/cli/src/systems/startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub async fn load_environments(states: StatesMut, resources: ResourcesMut) {
states.set(ProtoEnv(Arc::new(ProtoEnvironment::new()?)));

let mut console = Console::new(quiet);
console.set_reporter(DefaultReporter::new());
console.set_reporter(DefaultReporter::default());

resources.set(console);
}
Expand Down
3 changes: 3 additions & 0 deletions crates/core/action-pipeline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ tokio-util = { workspace = true }
[dev-dependencies]
moon = { path = "../moon" }
moon_test_utils = { path = "../test-utils" }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion crates/core/action-pipeline/src/actions/run_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn run_task(

action.allow_failure = task.options.allow_failure;

let attempts = TaskRunner::new(&workspace, &project, task, &action.node)?
let attempts = TaskRunner::new(&workspace, project, task, &action.node)?
.run_and_persist(&context, &console)
.await?;

Expand Down
15 changes: 6 additions & 9 deletions crates/core/action-pipeline/src/subscribers/local_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ impl Subscriber for LocalCacheSubscriber {
event: &Event<'e>,
workspace: &Workspace,
) -> miette::Result<EventFlow> {
match event {
// After the run has finished, clean any stale archives.
Event::PipelineFinished { .. } => {
if workspace.config.runner.auto_clean_cache {
workspace
.cache_engine
.clean_stale_cache(&workspace.config.runner.cache_lifetime, false)?;
}
// After the run has finished, clean any stale archives.
if let Event::PipelineFinished { .. } = event {
if workspace.config.runner.auto_clean_cache {
workspace
.cache_engine
.clean_stale_cache(&workspace.config.runner.cache_lifetime, false)?;
}
_ => {}
}

Ok(EventFlow::Continue)
Expand Down
3 changes: 3 additions & 0 deletions crates/core/actions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ moon_vcs_hooks = { path = "../../../nextgen/vcs-hooks" }
miette = { workspace = true }
proto_core = { workspace = true }
tracing = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/emitter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ tokio = { workspace = true }

[dev-dependencies]
moon_test_utils = { path = "../test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ publish = false
[dependencies]
miette = { workspace = true }
rustc-hash = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ publish = false
console = { workspace = true }
log = "0.4.21"
starbase_styles = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/moon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ proto_core = { workspace = true }
rustc-hash = { workspace = true }
starbase_events = { workspace = true }
tokio = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/notifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ serde_json = { workspace = true }
starbase_styles = { workspace = true }
tokio = { workspace = true }
uuid = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ async-trait = { workspace = true }
miette = { workspace = true }
rustc-hash = { workspace = true }
serde = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ serde_yaml = { workspace = true }
starbase_utils = { workspace = true }
# symlink = "0.1.0"
tokio = { workspace = true, features = ["full", "test-util"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ rustc-hash = { workspace = true }
starbase_styles = { workspace = true }
thiserror = { workspace = true }
warpgate = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/core/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ tokio = { workspace = true }

[dev-dependencies]
moon_test_utils = { path = "../test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/deno/lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ serde = { workspace = true }
serde_json = { workspace = true, features = ["preserve_order"] }
starbase_styles = { workspace = true }
starbase_utils = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/deno/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ rustc-hash = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/deno/tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ proto_core = { workspace = true }
rustc-hash = { workspace = true }
starbase_utils = { workspace = true }
tracing = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/javascript/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ serde = { workspace = true }
starbase_styles = { workspace = true }
starbase_utils = { workspace = true }
tracing = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/node/lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ yarn-lock-parser = "0.7.0"
[dev-dependencies]
moon_test_utils = { path = "../../core/test-utils" }
reqwest = { workspace = true, features = ["blocking"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/node/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ tokio = { workspace = true }
moon = { path = "../../core/moon" }
moon_project_graph = { path = "../../../nextgen/project-graph" }
moon_test_utils = { path = "../../core/test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/node/tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ proto_core = { workspace = true }
rustc-hash = { workspace = true }
starbase_styles = { workspace = true }
starbase_utils = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/rust/lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ starbase_utils = { workspace = true }

[dev-dependencies]
moon_test_utils = { path = "../../core/test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/rust/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ tokio = { workspace = true }
moon = { path = "../../core/moon" }
moon_project_graph = { path = "../../../nextgen/project-graph" }
moon_test_utils = { path = "../../core/test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/rust/tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ moon_utils = { path = "../../core/utils" }
miette = { workspace = true }
proto_core = { workspace = true }
rustc-hash = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/system/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ miette = { workspace = true }
proto_core = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/typescript/lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ typescript_tsconfig_json = { version = "0.1.4", features = ["serialize"] }

[dev-dependencies]
moon_test_utils = { path = "../../core/test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/typescript/platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ tracing = { workspace = true }
[dev-dependencies]
moon_common = { path = "../../../nextgen/common" }
moon_test_utils = { path = "../../core/test-utils" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/action-context/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ rustc-hash = { workspace = true }
scc = { workspace = true, features = ["serde"] }
serde = { workspace = true }
tokio = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/action-graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ tracing = { workspace = true }
moon_config = { path = "../config" }
moon_test_utils2 = { path = "../test-utils" }
starbase_sandbox = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/action/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ moon_time = { path = "../time" }
miette = { workspace = true }
rustc-hash = { workspace = true }
serde = { workspace = true, features = ["rc"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ tracing = { workspace = true }
uuid = { workspace = true }

# Rebuild schema: graphql-client introspect-schema http://localhost:8080/graphql --output ./nextgen/api/schema.json

[lints]
workspace = true
8 changes: 4 additions & 4 deletions nextgen/api/src/moonbase/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl Moonbase {
// Create the database record then upload to cloud storage
let Ok((_, presigned_url)) = self
.write_artifact(
&hash,
hash,
ArtifactWriteInput {
target: target_id.to_owned(),
size: size as usize,
Expand Down Expand Up @@ -315,11 +315,11 @@ impl Moonbase {
let status = response.status();

if status.is_success() {
self.mark_upload_complete(&hash, true, job_id).await?;
self.mark_upload_complete(hash, true, job_id).await?;

Ok(())
} else {
self.mark_upload_complete(&hash, false, job_id).await?;
self.mark_upload_complete(hash, false, job_id).await?;

Err(MoonbaseError::ArtifactUploadFailure {
hash: hash.to_string(),
Expand All @@ -332,7 +332,7 @@ impl Moonbase {
}
}
Err(error) => {
self.mark_upload_complete(&hash, false, job_id).await?;
self.mark_upload_complete(hash, false, job_id).await?;

Err(MoonbaseError::ArtifactUploadFailure {
hash: hash.to_string(),
Expand Down
3 changes: 3 additions & 0 deletions nextgen/app-components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ moon_plugin = { path = "../plugin" }
proto_core = { workspace = true }
semver = { workspace = true }
starbase = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ starbase_utils = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/args/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ miette = { workspace = true }
shell-words = "1.1.0"
thiserror = { workspace = true }
winsplit = "0.1.0"

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/cache-item/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ tracing = { workspace = true }
[dev-dependencies]
serial_test = "3.0.0"
starbase_sandbox = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ tracing = { workspace = true }

[dev-dependencies]
starbase_sandbox = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ clap = { workspace = true, features = ["string"] }

[dev-dependencies]
starbase_sandbox = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/codeowners/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ tracing = { workspace = true }

[dev-dependencies]
starbase_sandbox = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ schematic = { workspace = true }
serde = { workspace = true }
starbase_styles = { workspace = true }
thiserror = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ loader = ["schematic/url"]
proto = ["loader", "dep:proto_core"]
template = []
tracing = ["dep:tracing"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions nextgen/console-reporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ moon_console = { path = "../console" }
moon_target = { path = "../target" }
moon_time = { path = "../time" }
miette = { workspace = true }

[lints]
workspace = true
6 changes: 4 additions & 2 deletions nextgen/console-reporter/src/default_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ pub struct DefaultReporter {
out: Arc<ConsoleBuffer>,
}

impl DefaultReporter {
pub fn new() -> Self {
impl Default for DefaultReporter {
fn default() -> Self {
Self {
err: Arc::new(ConsoleBuffer::empty(ConsoleStream::Stderr)),
out: Arc::new(ConsoleBuffer::empty(ConsoleStream::Stdout)),
}
}
}

impl DefaultReporter {
pub fn print_task_checkpoint(
&self,
target: &Target,
Expand Down
Loading

0 comments on commit 8135e14

Please sign in to comment.