Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run clippy on windows in CI #485

Merged
merged 4 commits into from
Jun 14, 2024
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
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