Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
[
cargo-dylint,
cargo-dylint-cargo-lib,
dylint_examples,
expensive-alpine,
expensive-boundary_toolchains,
expensive-custom_toolchain,
Expand Down Expand Up @@ -79,9 +78,10 @@ jobs:

- name: Install tools
run: |
npm install -g prettier
rustup install nightly
rustup component add rustfmt --toolchain nightly
cargo install nested_workspace || true
npm install -g prettier

- name: Install CI tools
if: ${{ matrix.package == 'cargo-dylint-ci' }}
Expand Down Expand Up @@ -158,15 +158,9 @@ jobs:
fi
cargo test -p "$PACKAGE" "$TEST" -- --nocapture
else
cargo test --all-features --workspace --exclude cargo-dylint --exclude dylint_examples --exclude expensive --exclude scheduled -- --nocapture

pushd driver
cargo test --all-features -- --nocapture
popd
cargo nw fetch

pushd utils/linting
cargo test --all-features -- --nocapture
popd
cargo test --all-features --workspace --exclude cargo-dylint --exclude expensive --exclude scheduled -- --nocapture

# smoelius: The `cdylib` -> `lib` trick is due to @MinerSebas.
for X in examples/*/*; do
Expand Down
90 changes: 45 additions & 45 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"examples",
"expensive",
"internal",
"nightly",
# "internal/template",
"scheduled",
# "utils/linting",
Expand Down Expand Up @@ -41,6 +42,7 @@ hex = "0.4"
home = "=0.5.9"
if_chain = "1.0"
log = "0.4"
nested_workspace = "0.4"
once_cell = "1.21"
predicates = "3.1"
regex = "1.11"
Expand Down
16 changes: 16 additions & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ edition = "2024"
license = "MIT OR Apache-2.0"
publish = false

[build-dependencies]
nested_workspace = { workspace = true }

[dev-dependencies]
cargo-util = { workspace = true }
cargo_metadata = { workspace = true }
nested_workspace = { workspace = true }
regex = { workspace = true }
toml = { workspace = true }
toml_edit = { workspace = true }
Expand All @@ -21,3 +25,15 @@ dylint_internal = { version = "=4.1.0", path = "../internal", features = [

[lints]
workspace = true

[package.metadata.nested_workspace]
roots = [
"general",
"supplementary",
"restriction",
"testing/clippy",
"testing/straggler",
"experimental/derive_opportunity",
"experimental/missing_doc_comment_openai",
"experimental/overscoped_allow",
]
3 changes: 3 additions & 0 deletions examples/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
nested_workspace::build().unwrap();
}
20 changes: 4 additions & 16 deletions examples/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#[cfg(all(not(coverage), test))]
mod test {
use cargo_metadata::MetadataCommand;
use dylint_internal::{
CommandExt, clippy_utils::toolchain_channel, examples::iter, rustup::SanitizeEnvironment,
};
use dylint_internal::{CommandExt, clippy_utils::toolchain_channel, examples::iter};
use regex::Regex;
use std::{
collections::BTreeSet,
Expand All @@ -17,19 +15,9 @@ mod test {

#[test]
fn examples() {
for path in iter(false).unwrap() {
let path = path.unwrap();
let file_name = path.file_name().unwrap();
// smoelius: Pass `--lib --tests` to `cargo test` to avoid the potential filename
// collision associated with building the examples.
dylint_internal::cargo::test(&format!("example `{}`", file_name.to_string_lossy()))
.build()
.sanitize_environment()
.current_dir(path)
.args(["--lib", "--tests"])
.success()
.unwrap();
}
// smoelius: Pass `--lib --tests` to `cargo test` to avoid the potential filename
// collision associated with building the examples.
nested_workspace::test().args(["--lib", "--tests"]).unwrap();
}

#[test]
Expand Down
18 changes: 18 additions & 0 deletions nightly/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "nightly"
description = "Containing package for Dylint workspaces requiring a nightly toolchain"
version = "4.1.0"
edition = "2024"
publish = false

[build-dependencies]
nested_workspace = { workspace = true }

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

[lints]
workspace = true

[package.metadata.nested_workspace]
roots = ["../driver", "../internal/template", "../utils/linting"]
3 changes: 3 additions & 0 deletions nightly/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
nested_workspace::build().unwrap();
}
4 changes: 4 additions & 0 deletions nightly/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[test]
fn nested_workspace() {
nested_workspace::test().unwrap();
}