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 in the CI with warnings disallowed #23

Merged
merged 4 commits into from
Oct 25, 2022

Commits on Oct 20, 2022

  1. Add missing edition = "2021" to compile and runtime crates

    Commit ad85f13 ("Seems like edition in workspace isn't applied? Update
    all to 2021") found that `workspace.edition` isn't a valid key and added
    it to most crates' individual `[package]` table, but didn't remove the
    key from `[workspace]` nor added it to the `compile` and `runtime`
    crates.
    
    Note that `[workspace.package] edition = "2021"` exists since Rust 1.64,
    but still requires `[package] edition.workspace = true` to be repeated
    in every individual `Cargo.toml` for it to be inherited:
    https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
    MarijnS95 committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    af022fb View commit details
    Browse the repository at this point in the history
  2. compile: Upgrade to bindgen 0.61 and use Builder with Clone

    As announced earlier in Twinklebear#20 when introducing `BindgenOptions`, upstream
    `bindgen` didn't yet allow cloning nor copying their `Builder` struct,
    limiting it to generate a single binding per `Builder` object.  This
    doesn't fit with ispc-rs's `Config` struct which explicitly allows
    multiple libraries to be compiled using (partially) the same
    base configuration (barring any side-effects from `fn compile(&mut self,
    lib)` updating various fields depending on `lib`).
    
    This issue has since been addressed upstream, and now allows us to move
    and clone the `bindgen::Builder` around instead of implementing a very
    limited subset of config fields and manually reconstructing the builder
    every time.
    MarijnS95 committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    e9dba21 View commit details
    Browse the repository at this point in the history
  3. Run cargo clippy --fix

    MarijnS95 committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    d2eb232 View commit details
    Browse the repository at this point in the history
  4. Run clippy in the CI with warnings disallowed

    As discussed previously it'd be nice to keep `ispc-rs` "free" of simple
    "code smells" commonly pointed out by `clippy`.  This is easy to guard
    by disallowing any clippy warnings from trickling into the codebase
    through PRs via an extra CI check.
    
    Downside is that Rust upgrades every 6 weeks and usually enables new or
    improves existing lints, resulting in unrelated CI errors caused by
    existing code being punted on unsuspecting contributors in newly opened
    PRs.  But these are typically easy to resolve in a separate PR, or to be
    caught early when (also) running the CI job on a schedule.
    MarijnS95 committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    25f8196 View commit details
    Browse the repository at this point in the history