From 63515b12a7b1496fde377975d4bfb25570e6797f Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 23 May 2024 07:16:15 -0500 Subject: [PATCH 1/5] no-default-features --- .github/workflows/no-default-features.yml | 54 +++++++++++++++++++++++ crates/tools/yml/src/main.rs | 49 ++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 .github/workflows/no-default-features.yml diff --git a/.github/workflows/no-default-features.yml b/.github/workflows/no-default-features.yml new file mode 100644 index 0000000000..23e7ce54cf --- /dev/null +++ b/.github/workflows/no-default-features.yml @@ -0,0 +1,54 @@ +name: no-default-features + +on: + pull_request: + push: + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + branches: + - master + +env: + RUSTFLAGS: -Dwarnings + +jobs: + check: + runs-on: windows-2019 + + strategy: + matrix: + include: + - version: nightly + target: x86_64-pc-windows-msvc + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Update toolchain + run: rustup update --no-self-update ${{ matrix.version }} && rustup default ${{ matrix.version }}-${{ matrix.target }} + - name: Add toolchain target + run: rustup target add ${{ matrix.target }} + - name: Fix environment + uses: ./.github/actions/fix-environment + - name: Check windows + run: cargo check -p windows --no-default-features + - name: Check windows-bindgen + run: cargo check -p windows-bindgen --no-default-features + - name: Check windows-core + run: cargo check -p windows-core --no-default-features + - name: Check windows-implement + run: cargo check -p windows-implement --no-default-features + - name: Check windows-interface + run: cargo check -p windows-interface --no-default-features + - name: Check windows-metadata + run: cargo check -p windows-metadata --no-default-features + - name: Check windows-registry + run: cargo check -p windows-registry --no-default-features + - name: Check windows-result + run: cargo check -p windows-result --no-default-features + - name: Check windows-sys + run: cargo check -p windows-sys --no-default-features + - name: Check windows-targets + run: cargo check -p windows-targets --no-default-features + - name: Check windows-version + run: cargo check -p windows-version --no-default-features \ No newline at end of file diff --git a/crates/tools/yml/src/main.rs b/crates/tools/yml/src/main.rs index ad30054c30..5d31d0b624 100644 --- a/crates/tools/yml/src/main.rs +++ b/crates/tools/yml/src/main.rs @@ -3,6 +3,7 @@ use std::fmt::Write; fn main() { test_yml(); clippy_yml(); + no_default_features_yml(); } fn test_yml() { @@ -153,3 +154,51 @@ jobs: std::fs::write(".github/workflows/clippy.yml", yml.as_bytes()).unwrap(); } + +fn no_default_features_yml() { + let mut yml = r"name: no-default-features + +on: + pull_request: + push: + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + branches: + - master + +env: + RUSTFLAGS: -Dwarnings + +jobs: + check: + runs-on: windows-2019 + + strategy: + matrix: + include: + - version: nightly + target: x86_64-pc-windows-msvc + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Update toolchain + run: rustup update --no-self-update ${{ matrix.version }} && rustup default ${{ matrix.version }}-${{ matrix.target }} + - name: Add toolchain target + run: rustup target add ${{ matrix.target }} + - name: Fix environment + uses: ./.github/actions/fix-environment" + .to_string(); + + for (name, _) in lib::crates("crates/libs") { + write!( + &mut yml, + r" + - name: Check {name} + run: cargo check -p {name} --no-default-features" + ) + .unwrap(); + } + + std::fs::write(".github/workflows/no-default-features.yml", yml.as_bytes()).unwrap(); +} From 05a8caf7f518c476862b0f9776a88c21e653fe6e Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 23 May 2024 07:25:53 -0500 Subject: [PATCH 2/5] lint warning --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 10c6842097..0cd086c721 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = [ ] [workspace.lints.rust] -rust_2018_idioms = "warn" +rust_2018_idioms = { level = "warn", priority = -1 } unused_qualifications = "warn" missing_docs = "warn" unexpected_cfgs = { level = "warn", check-cfg = ['cfg(windows_raw_dylib, windows_debugger_visualizer)'] } From 40a23b9c9855174df49fb969051f3005d05fcdf6 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 23 May 2024 07:34:04 -0500 Subject: [PATCH 3/5] redundant --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0cd086c721..242f9640ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ exclude = [ ] [workspace.lints.rust] -rust_2018_idioms = { level = "warn", priority = -1 } -unused_qualifications = "warn" +rust_2018_idioms = "warn" missing_docs = "warn" unexpected_cfgs = { level = "warn", check-cfg = ['cfg(windows_raw_dylib, windows_debugger_visualizer)'] } From beebc3e25eb8e97a4ff0609aec5270a52d260dc2 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 23 May 2024 07:37:57 -0500 Subject: [PATCH 4/5] remove conflicting lints --- Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 242f9640ef..0ec9353713 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,4 @@ exclude = [ ] [workspace.lints.rust] -rust_2018_idioms = "warn" -missing_docs = "warn" unexpected_cfgs = { level = "warn", check-cfg = ['cfg(windows_raw_dylib, windows_debugger_visualizer)'] } From 08080bc6cc25d981823391b44653c7878c9361e6 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 23 May 2024 07:39:10 -0500 Subject: [PATCH 5/5] lint priority --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 0ec9353713..0cd086c721 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,4 +14,7 @@ exclude = [ ] [workspace.lints.rust] +rust_2018_idioms = { level = "warn", priority = -1 } +unused_qualifications = "warn" +missing_docs = "warn" unexpected_cfgs = { level = "warn", check-cfg = ['cfg(windows_raw_dylib, windows_debugger_visualizer)'] }