Skip to content

Commit

Permalink
Run clippy on windows in CI (#485)
Browse files Browse the repository at this point in the history
* Run clippy on windows in CI

* Fix win32 clippy error

* Revert clippy rust_version check

* Fix clippy error on windows
  • Loading branch information
VianneyRuhlmann committed Jun 14, 2024
1 parent 6fcf188 commit fc6e92b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ jobs:
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- run: cargo fmt --all -- --check
clippy:
name: "clippy #${{ matrix.rust_version }}"
name: "clippy #${{ matrix.platform }} ${{ matrix.rust_version }}"
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
# Ignore nightly for now, it fails too often
rust_version: ["1.71.1", "stable"]
runs-on: ubuntu-latest
platform: [windows-latest, ubuntu-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -31,7 +32,9 @@ jobs:
rust_version: ${{ matrix.rust_version }}
- name: Install ${{ matrix.version }} toolchain and clippy
run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy
- run: cargo clippy --all-targets --all-features -- -D warnings $([ ${{ matrix.rust_version }} = 1.71.1 ] && echo -Aunknown-lints)
- name: Run clippy on ${{ matrix.platform }} ${{ matrix.rust_version }}
shell: bash
run: cargo clippy --all-targets --all-features -- -D warnings $([ ${{ matrix.rust_version }} = 1.71.1 ] && echo -Aunknown-lints)
licensecheck:
runs-on: ubuntu-latest
name: "Presence of licence headers"
Expand Down
2 changes: 1 addition & 1 deletion profiling-ffi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

#[cfg(feature = "symbolizer")]
#[cfg(all(feature = "symbolizer", not(target_os = "windows")))]
pub use symbolizer_ffi::*;

use std::fmt::Debug;
Expand Down
3 changes: 1 addition & 2 deletions spawn_worker/src/win32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ pub fn recv_passed_handle() -> Option<OwnedHandle> {
}

fn get_module_file_name(h: HMODULE) -> anyhow::Result<String> {
let mut buf = Vec::new();
buf.resize(2000, 0);
let mut buf = vec![0; 2000];
loop {
let read: usize = unsafe { GetModuleFileNameW(h, &mut buf) } as usize;
if read == 0 {
Expand Down

0 comments on commit fc6e92b

Please sign in to comment.