Skip to content

Commit

Permalink
chore(lints): bump toolchain to make it work again
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Jan 19, 2024
1 parent 023a7fd commit d545479
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 44 deletions.
115 changes: 75 additions & 40 deletions lints/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ name = "format_error"
path = "ui/format_error.rs"

[dependencies]
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "e4c626dd9a17a23270bf8e7158e59cf2b9c04840" } # should match the toolchain version (rustc -vV)
dylint_linting = "2.5.0"
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "6fd0258e45105161b7e759a22e7350958e5cb0b1" } # should match the toolchain version of lints
dylint_linting = "2.6.0"
itertools = "0.12"

[dev-dependencies]
dylint_testing = "2.5.0"
dylint_testing = "2.6.0"

# UI test dependencies
tracing = "0.1"
Expand Down
19 changes: 19 additions & 0 deletions lints/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ Custom lints for RisingWave to enforce code style and best practices, empowered

See [cargo dylint](https://github.com/trailofbits/dylint) for more information.

## Install `cargo-dylint`

```bash
cargo install dylint
```

## Run lints

To run all lints, run `cargo dylint --all` in the root of the repository.

If you find there are some compile errors, try updating the `cargo-dylint` binary by installing it again.

## Add new lints

To add a new lint, add a new file in the `src` directory to declare the lint, then register it in `fn register_lints(..)` in `lib.rs`.
Expand All @@ -19,3 +27,14 @@ To test a lint, create a new file in the `ui` directory and add it as an `exampl
## VS Code integration

Duplicate `.vscode/settings.json.example` to `.vscode/settings.json` to enable rust-analyzer integration for developing lints.

## Bump toolchain

The version of the toolchain is specified in `rust-toolchain` file under current directory.
It does not have to be exactly the same as the one used to build RisingWave, but it should be close enough to avoid compile errors.

Information below may be helpful to find a proper version to bump to:

- The toolchain used by the lastest version of `cargo-dylint`: https://github.com/trailofbits/dylint/blob/master/internal/template/rust-toolchain

Check warning on line 38 in lints/README.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"lastest" should be "last" or "latest".
- The toolchain used by the lastest version of `clippy`: https://github.com/rust-lang/rust-clippy/blob/master/rust-toolchain

Check warning on line 39 in lints/README.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"lastest" should be "last" or "latest".
- The hash of the latest commit in `rust-lang/rust-clippy` repo for the dependency `clippy-utils`.
2 changes: 1 addition & 1 deletion lints/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-12-26" # should be identical to the root one
channel = "nightly-2024-01-11"
components = ["llvm-tools-preview", "rustc-dev"]

0 comments on commit d545479

Please sign in to comment.