@@ -60,6 +60,7 @@ fn test_arg_value() {
6060 assert_eq ! ( arg_value( args, "--bar" , |p| p == "foo" ) , None ) ;
6161 assert_eq ! ( arg_value( args, "--foobar" , |p| p == "foo" ) , None ) ;
6262 assert_eq ! ( arg_value( args, "--foobar" , |p| p == "123" ) , Some ( "123" ) ) ;
63+ assert_eq ! ( arg_value( args, "--foobar" , |p| p. contains( "12" ) ) , Some ( "123" ) ) ;
6364 assert_eq ! ( arg_value( args, "--foo" , |_| true ) , None ) ;
6465}
6566
@@ -334,15 +335,13 @@ pub fn main() {
334335 // - IF Clippy is run on the main crate, not on deps (`!cap_lints_allow`) THEN
335336 // - IF `--no-deps` is not set (`!no_deps`) OR
336337 // - IF `--no-deps` is set and Clippy is run on the specified primary package
337- let cap_lints_allow = arg_value ( & orig_args, "--cap-lints" , |val| val == "allow" ) . is_some ( ) ;
338+ let cap_lints_allow = arg_value ( & orig_args, "--cap-lints" , |val| val == "allow" ) . is_some ( )
339+ && arg_value ( & orig_args, "--force-warn" , |val| val. contains ( "clippy::" ) ) . is_none ( ) ;
338340 let in_primary_package = env:: var ( "CARGO_PRIMARY_PACKAGE" ) . is_ok ( ) ;
339341
340342 let clippy_enabled = !cap_lints_allow && ( !no_deps || in_primary_package) ;
341343 if clippy_enabled {
342344 args. extend ( clippy_args) ;
343- }
344-
345- if clippy_enabled {
346345 rustc_driver:: RunCompiler :: new ( & args, & mut ClippyCallbacks { clippy_args_var } ) . run ( )
347346 } else {
348347 rustc_driver:: RunCompiler :: new ( & args, & mut RustcCallbacks { clippy_args_var } ) . run ( )
0 commit comments