Skip to content

Commit 9e08e7f

Browse files
committed
Remove special dogfood target
1 parent 5250744 commit 9e08e7f

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

src/main.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use rustc_tools_util::VersionInfo;
66
use std::env;
7-
use std::ffi::OsString;
87
use std::path::PathBuf;
98
use std::process::{self, Command};
109

@@ -14,7 +13,7 @@ Usage:
1413
cargo clippy [options] [--] [<opts>...]
1514
1615
Common options:
17-
--no-deps Run Clippy only on the given crate, without linting the dependencies
16+
--no-deps Run Clippy only on the given crate, without linting the dependencies
1817
--fix Automatically apply lint suggestions. This flag implies `--no-deps`
1918
-h, --help Print this message
2019
-V, --version Print version info and exit
@@ -116,22 +115,6 @@ impl ClippyCmd {
116115
path
117116
}
118117

119-
fn target_dir() -> Option<(&'static str, OsString)> {
120-
env::var_os("CLIPPY_DOGFOOD")
121-
.map(|_| {
122-
env::var_os("CARGO_MANIFEST_DIR").map_or_else(
123-
|| std::ffi::OsString::from("clippy_dogfood"),
124-
|d| {
125-
std::path::PathBuf::from(d)
126-
.join("target")
127-
.join("dogfood")
128-
.into_os_string()
129-
},
130-
)
131-
})
132-
.map(|p| ("CARGO_TARGET_DIR", p))
133-
}
134-
135118
fn into_std_cmd(self) -> Command {
136119
let mut cmd = Command::new("cargo");
137120
let clippy_args: String = self
@@ -141,7 +124,6 @@ impl ClippyCmd {
141124
.collect();
142125

143126
cmd.env("RUSTC_WORKSPACE_WRAPPER", Self::path())
144-
.envs(ClippyCmd::target_dir())
145127
.env("CLIPPY_ARGS", clippy_args)
146128
.arg(self.cargo_subcommand)
147129
.args(&self.args);

tests/dogfood.rs

-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ fn dogfood_clippy() {
3333
let mut command = Command::new(&*CLIPPY_PATH);
3434
command
3535
.current_dir(root_dir)
36-
.env("CLIPPY_DOGFOOD", "1")
3736
.env("CARGO_INCREMENTAL", "0")
3837
.arg("clippy")
3938
.arg("--all-targets")
@@ -79,7 +78,6 @@ fn test_no_deps_ignores_path_deps_in_workspaces() {
7978
// Make sure that with the `--no-deps` argument Clippy does not run on `path_dep`.
8079
let output = Command::new(&*CLIPPY_PATH)
8180
.current_dir(&cwd)
82-
.env("CLIPPY_DOGFOOD", "1")
8381
.env("CARGO_INCREMENTAL", "0")
8482
.arg("clippy")
8583
.args(&["-p", "subcrate"])
@@ -99,7 +97,6 @@ fn test_no_deps_ignores_path_deps_in_workspaces() {
9997
// Test that without the `--no-deps` argument, `path_dep` is linted.
10098
let output = Command::new(&*CLIPPY_PATH)
10199
.current_dir(&cwd)
102-
.env("CLIPPY_DOGFOOD", "1")
103100
.env("CARGO_INCREMENTAL", "0")
104101
.arg("clippy")
105102
.args(&["-p", "subcrate"])
@@ -126,7 +123,6 @@ fn test_no_deps_ignores_path_deps_in_workspaces() {
126123
let successful_build = || {
127124
let output = Command::new(&*CLIPPY_PATH)
128125
.current_dir(&cwd)
129-
.env("CLIPPY_DOGFOOD", "1")
130126
.env("CARGO_INCREMENTAL", "0")
131127
.arg("clippy")
132128
.args(&["-p", "subcrate"])
@@ -228,7 +224,6 @@ fn run_clippy_for_project(project: &str) {
228224

229225
command
230226
.current_dir(root_dir.join(project))
231-
.env("CLIPPY_DOGFOOD", "1")
232227
.env("CARGO_INCREMENTAL", "0")
233228
.arg("clippy")
234229
.arg("--all-targets")

0 commit comments

Comments
 (0)