mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
Auto merge of #11154 - Alexendoo:track-clippy-conf-dir, r=flip1995
Trigger a rebuild when `CLIPPY_CONF_DIR` changes changelog: none This is a fix for https://github.com/rust-lang/rust-clippy/issues/9928#issuecomment-1634698183, any time `CLIPPY_CONF_DIR` changes cargo will now rebuild the crate clippy is being run on, giving it a chance to lint with the (potentially) different config file r? `@flip1995`
This commit is contained in:
commit
4b355d8f31
1 changed files with 7 additions and 0 deletions
|
@ -130,6 +130,13 @@ impl rustc_driver::Callbacks for ClippyCallbacks {
|
||||||
config.parse_sess_created = Some(Box::new(move |parse_sess| {
|
config.parse_sess_created = Some(Box::new(move |parse_sess| {
|
||||||
track_clippy_args(parse_sess, &clippy_args_var);
|
track_clippy_args(parse_sess, &clippy_args_var);
|
||||||
track_files(parse_sess);
|
track_files(parse_sess);
|
||||||
|
|
||||||
|
// Trigger a rebuild if CLIPPY_CONF_DIR changes. The value must be a valid string so
|
||||||
|
// changes between dirs that are invalid UTF-8 will not trigger rebuilds
|
||||||
|
parse_sess.env_depinfo.get_mut().insert((
|
||||||
|
Symbol::intern("CLIPPY_CONF_DIR"),
|
||||||
|
env::var("CLIPPY_CONF_DIR").ok().map(|dir| Symbol::intern(&dir)),
|
||||||
|
));
|
||||||
}));
|
}));
|
||||||
config.register_lints = Some(Box::new(move |sess, lint_store| {
|
config.register_lints = Some(Box::new(move |sess, lint_store| {
|
||||||
// technically we're ~guaranteed that this is none but might as well call anything that
|
// technically we're ~guaranteed that this is none but might as well call anything that
|
||||||
|
|
Loading…
Reference in a new issue