mirror of
https://github.com/nushell/nushell.git
synced 2025-02-16 10:32:29 +01:00
Match toolkit clippy settings to CI clippy settings (#10984)
# Description I've had a few PRs fail clippy in CI after they pass `toolkit check pr` because the clippy settings are different. This brings `toolkit.nu` into alignment with CI and leaves notes to prompt future synchronization. # User-Facing Changes N/A # Tests + Formatting `cargo` output elided: ``` ❯ toolkit check pr running `toolkit fmt` running `toolkit clippy` running `toolkit clippy` on tests running `toolkit clippy` on plugins running `toolkit test` running `toolkit test stdlib` - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` ``` # After Submitting N/A
This commit is contained in:
parent
33a7bc405f
commit
91920373b5
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -9,6 +9,7 @@ name: continuous-integration
|
|||||||
env:
|
env:
|
||||||
NUSHELL_CARGO_PROFILE: ci
|
NUSHELL_CARGO_PROFILE: ci
|
||||||
NU_LOG_LEVEL: DEBUG
|
NU_LOG_LEVEL: DEBUG
|
||||||
|
# If changing these settings also change toolkit.nu
|
||||||
CLIPPY_OPTIONS: "-D warnings -D clippy::unwrap_used"
|
CLIPPY_OPTIONS: "-D warnings -D clippy::unwrap_used"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -47,9 +48,10 @@ jobs:
|
|||||||
- name: cargo fmt
|
- name: cargo fmt
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
|
# If changing these settings also change toolkit.nu
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: cargo clippy --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- $CLIPPY_OPTIONS
|
run: cargo clippy --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- $CLIPPY_OPTIONS
|
||||||
|
|
||||||
# In tests we don't have to deny unwrap
|
# In tests we don't have to deny unwrap
|
||||||
- name: Clippy of tests
|
- name: Clippy of tests
|
||||||
run: cargo clippy --tests --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- -D warnings
|
run: cargo clippy --tests --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- -D warnings
|
||||||
|
33
toolkit.nu
33
toolkit.nu
@ -39,14 +39,43 @@ export def clippy [
|
|||||||
print $"running ('toolkit clippy' | pretty-format-command)"
|
print $"running ('toolkit clippy' | pretty-format-command)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If changing these settings also change CI settings in .github/workflows/ci.yml
|
||||||
try {(
|
try {(
|
||||||
cargo clippy
|
cargo clippy
|
||||||
--workspace
|
--workspace
|
||||||
--tests
|
--exclude nu_plugin_*
|
||||||
--features ($features | str join ",")
|
--features ($features | str join ",")
|
||||||
--
|
--
|
||||||
-D warnings
|
-D warnings
|
||||||
)} catch {
|
-D clippy::unwrap_used
|
||||||
|
)
|
||||||
|
|
||||||
|
if $verbose {
|
||||||
|
print $"running ('toolkit clippy' | pretty-format-command) on tests"
|
||||||
|
}
|
||||||
|
# In tests we don't have to deny unwrap
|
||||||
|
(
|
||||||
|
cargo clippy
|
||||||
|
--tests
|
||||||
|
--workspace
|
||||||
|
--exclude nu_plugin_*
|
||||||
|
--features ($features | str join ",")
|
||||||
|
--
|
||||||
|
-D warnings
|
||||||
|
)
|
||||||
|
|
||||||
|
if $verbose {
|
||||||
|
print $"running ('toolkit clippy' | pretty-format-command) on plugins"
|
||||||
|
}
|
||||||
|
(
|
||||||
|
cargo clippy
|
||||||
|
--package nu_plugin_*
|
||||||
|
--
|
||||||
|
-D warnings
|
||||||
|
-D clippy::unwrap_used
|
||||||
|
)
|
||||||
|
|
||||||
|
} catch {
|
||||||
error make --unspanned {
|
error make --unspanned {
|
||||||
msg: $"\nplease fix the above ('clippy' | pretty-format-command) errors before continuing!"
|
msg: $"\nplease fix the above ('clippy' | pretty-format-command) errors before continuing!"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user