Skip to content

Commit b443e33

Browse files
authored
chore: kebab-case names for binaries (#17639)
These commits follow the lint `cargo::non_kebab_case_bins` https://doc.rust-lang.org/nightly/cargo/reference/lints.html#non_kebab_case_bins The failure was found in <rust-lang/rust#161789 (comment)> when syncing Cargo submodule. * `clippy_dev` `package.name` got renamed to `clippy-dev`. * Expect no actual developer workflow changes as people usually run `cargo dev` via `.cargo/config.toml` alias. * ‼️ One caveat of this is that the next subtree sync need to also update the name in rust-lang/rust's Cargo.lock * `clippy_dummy`, because it is published already, rename its bin name directly as `clippy`. This is a dummy package so it doesn't matter that much, as we are unlikely to publish new versions. * Test snapshots and test binary names are also converted to dashes. They are less controversial than above as being completely internal. changelog: none
2 parents 464e285 + 5691eb2 commit b443e33

45 files changed

Lines changed: 68 additions & 64 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
bless = "test --config env.RUSTC_BLESS='1'"
33
uitest = "test --test compile-test"
44
uibless = "bless --test compile-test"
5-
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
5+
dev = "run --package clippy-dev --bin clippy-dev --manifest-path clippy_dev/Cargo.toml --"
66
lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
77
collect-metadata = "test --test compile-test --config env.COLLECT_METADATA='1'"
88

@@ -19,7 +19,7 @@ profile-rustflags = true
1919
split-debuginfo = "unpacked"
2020

2121
# Add back the containing directory of the packages we have to refer to using --manifest-path
22-
[profile.dev.package.clippy_dev]
22+
[profile.dev.package.clippy-dev]
2323
rustflags = ["--remap-path-prefix", "=clippy_dev"]
2424
[profile.dev.package.lintcheck]
2525
rustflags = ["--remap-path-prefix", "=lintcheck"]

.github/workflows/clippy_mq.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
run: cargo test
8080
working-directory: rustc_tools_util
8181

82-
- name: Test clippy_dev
82+
- name: Test clippy-dev
8383
run: cargo test
8484
working-directory: clippy_dev
8585

.github/workflows/clippy_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: cargo test
5454
working-directory: rustc_tools_util
5555

56-
- name: Test clippy_dev
56+
- name: Test clippy-dev
5757
run: cargo test
5858
working-directory: clippy_dev
5959

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion

clippy_dev/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "clippy_dev"
2+
name = "clippy-dev"
33
description = "Clippy developer tooling"
44
version = "0.0.1"
55
edition = "2024"

clippy_dev/src/setup/git_hook.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::Path;
33

44
/// Rusts setup uses `git rev-parse --git-common-dir` to get the root directory of the repo.
55
/// I've decided against this for the sake of simplicity and to make sure that it doesn't install
6-
/// the hook if `clippy_dev` would be used in the rust tree. The hook also references this tool
6+
/// the hook if `clippy-dev` would be used in the rust tree. The hook also references this tool
77
/// for formatting and should therefore only be used in a normal clone of clippy
88
const REPO_GIT_DIR: &str = ".git";
99
const HOOK_SOURCE_FILE: &str = "util/etc/pre-commit.sh";
@@ -36,7 +36,7 @@ fn check_precondition(force_override: bool) -> bool {
3636
// Make sure that we can find the git repository
3737
let git_path = Path::new(REPO_GIT_DIR);
3838
if !git_path.exists() || !git_path.is_dir() {
39-
eprintln!("error: clippy_dev was unable to find the `.git` directory");
39+
eprintln!("error: clippy-dev was unable to find the `.git` directory");
4040
return false;
4141
}
4242

clippy_dev/src/setup/intellij.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn inject_deps_into_project(rustc_source_dir: &Path, project: &ClippyProjectInfo
9696
}
9797
}
9898

99-
/// `clippy_dev` expects to be executed in the root directory of Clippy. This function
99+
/// `clippy-dev` expects to be executed in the root directory of Clippy. This function
100100
/// loads the given file or returns an error. Having it in this extra function ensures
101101
/// that the error message looks nice.
102102
fn read_project_file(file_path: &str) -> Result<String, ()> {

clippy_dummy/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ license = "MIT OR Apache-2.0"
1212
keywords = ["clippy", "lint", "plugin"]
1313
categories = ["development-tools", "development-tools::cargo-plugins"]
1414

15+
[[bin]]
16+
name = "clippy"
17+
path = "src/main.rs"
18+
1519
[build-dependencies]
1620
term = "1"

clippy_test_deps/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clippy_test_deps/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "clippy_test_deps"
2+
name = "clippy-test-deps"
33
version = "0.1.0"
44
edition = "2021"
55

0 commit comments

Comments
 (0)