Enfoce no dbg! and todo! in Rust code via clippy lints in the CI job
This commit is contained in:
parent
02ef6fc973
commit
7b3e7ee3cc
6 changed files with 40 additions and 32 deletions
15
.github/actions/check_formatting/action.yml
vendored
15
.github/actions/check_formatting/action.yml
vendored
|
@ -1,15 +0,0 @@
|
||||||
name: 'Check formatting'
|
|
||||||
description: 'Checks code formatting use cargo fmt'
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Install Rust
|
|
||||||
shell: bash -euxo pipefail {0}
|
|
||||||
run: |
|
|
||||||
rustup set profile minimal
|
|
||||||
rustup update stable
|
|
||||||
|
|
||||||
- name: cargo fmt
|
|
||||||
shell: bash -euxo pipefail {0}
|
|
||||||
run: cargo fmt --all -- --check
|
|
24
.github/actions/check_style/action.yml
vendored
Normal file
24
.github/actions/check_style/action.yml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
name: "Check formatting"
|
||||||
|
description: "Checks code formatting use cargo fmt"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install Rust
|
||||||
|
shell: bash -euxo pipefail {0}
|
||||||
|
run: |
|
||||||
|
rustup set profile minimal
|
||||||
|
rustup update stable
|
||||||
|
rustup component add clippy
|
||||||
|
|
||||||
|
- name: cargo fmt
|
||||||
|
shell: bash -euxo pipefail {0}
|
||||||
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
|
- name: cargo clippy
|
||||||
|
shell: bash -euxo pipefail {0}
|
||||||
|
# clippy.toml is not currently supporting specifying allowed lints
|
||||||
|
# so specify those here, and disable the rest until Zed's workspace
|
||||||
|
# will have more fixes & suppression for the standard lint set
|
||||||
|
run: |
|
||||||
|
cargo clippy --workspace --all-targets --all-features -- -A clippy::all -D clippy::dbg_macro -D clippy::todo
|
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
|
@ -22,8 +22,8 @@ env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rustfmt:
|
style:
|
||||||
name: Check formatting
|
name: Check formatting and Clippy lints
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- test
|
- test
|
||||||
|
@ -33,19 +33,20 @@ jobs:
|
||||||
with:
|
with:
|
||||||
clean: false
|
clean: false
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up default .cargo/config.toml
|
- name: Set up default .cargo/config.toml
|
||||||
run: cp ./.cargo/ci-config.toml ~/.cargo/config.toml
|
run: cp ./.cargo/ci-config.toml ~/.cargo/config.toml
|
||||||
|
|
||||||
- name: Run rustfmt
|
- name: Run style checks
|
||||||
uses: ./.github/actions/check_formatting
|
uses: ./.github/actions/check_style
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- test
|
- test
|
||||||
needs: rustfmt
|
needs: style
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
11
.github/workflows/release_nightly.yml
vendored
11
.github/workflows/release_nightly.yml
vendored
|
@ -14,8 +14,8 @@ env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rustfmt:
|
style:
|
||||||
name: Check formatting
|
name: Check formatting and Clippy lints
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- test
|
- test
|
||||||
|
@ -25,16 +25,17 @@ jobs:
|
||||||
with:
|
with:
|
||||||
clean: false
|
clean: false
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run rustfmt
|
- name: Run style checks
|
||||||
uses: ./.github/actions/check_formatting
|
uses: ./.github/actions/check_style
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- test
|
- test
|
||||||
needs: rustfmt
|
needs: style
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
|
@ -104,12 +104,10 @@ async fn test_channel_guest_promotion(cx_a: &mut TestAppContext, cx_b: &mut Test
|
||||||
});
|
});
|
||||||
assert!(project_b.read_with(cx_b, |project, _| project.is_read_only()));
|
assert!(project_b.read_with(cx_b, |project, _| project.is_read_only()));
|
||||||
assert!(editor_b.update(cx_b, |e, cx| e.read_only(cx)));
|
assert!(editor_b.update(cx_b, |e, cx| e.read_only(cx)));
|
||||||
assert!(dbg!(
|
assert!(room_b
|
||||||
room_b
|
.update(cx_b, |room, cx| room.share_microphone(cx))
|
||||||
.update(cx_b, |room, cx| room.share_microphone(cx))
|
.await
|
||||||
.await
|
.is_err());
|
||||||
)
|
|
||||||
.is_err());
|
|
||||||
|
|
||||||
// B is promoted
|
// B is promoted
|
||||||
active_call_a
|
active_call_a
|
||||||
|
|
|
@ -111,7 +111,6 @@ mod test {
|
||||||
|
|
||||||
let mut cx1 = VisualTestContext::from_window(cx.window, &cx);
|
let mut cx1 = VisualTestContext::from_window(cx.window, &cx);
|
||||||
let editor1 = cx.editor.clone();
|
let editor1 = cx.editor.clone();
|
||||||
dbg!(editor1.entity_id());
|
|
||||||
|
|
||||||
let buffer = cx.new_model(|_| Buffer::new(0, 0, "a = 1\nb = 2\n"));
|
let buffer = cx.new_model(|_| Buffer::new(0, 0, "a = 1\nb = 2\n"));
|
||||||
let (editor2, cx2) = cx.add_window_view(|cx| Editor::for_buffer(buffer, None, cx));
|
let (editor2, cx2) = cx.add_window_view(|cx| Editor::for_buffer(buffer, None, cx));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue