Skip to content

Commit 36279f1

Browse files
committed
Trigger a rebuild when CLIPPY_CONF_DIR changes
1 parent 7ccf5d4 commit 36279f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/driver.rs

+7
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ impl rustc_driver::Callbacks for ClippyCallbacks {
130130
config.parse_sess_created = Some(Box::new(move |parse_sess| {
131131
track_clippy_args(parse_sess, &clippy_args_var);
132132
track_files(parse_sess);
133+
134+
// Trigger a rebuild if CLIPPY_CONF_DIR changes. The value must be a valid string so
135+
// changes between dirs that are invalid UTF-8 will not trigger rebuilds
136+
parse_sess.env_depinfo.get_mut().insert((
137+
Symbol::intern("CLIPPY_CONF_DIR"),
138+
env::var("CLIPPY_CONF_DIR").ok().map(|dir| Symbol::intern(&dir)),
139+
));
133140
}));
134141
config.register_lints = Some(Box::new(move |sess, lint_store| {
135142
// technically we're ~guaranteed that this is none but might as well call anything that

0 commit comments

Comments
 (0)