@@ -2,7 +2,7 @@ use super::{ActivePlugin, Planner};
2
2
use anyhow:: bail;
3
3
use anyhow:: { anyhow, Result } ;
4
4
use qlty_analysis:: workspace_entries:: TargetMode ;
5
- use qlty_config:: config:: { DriverDef , EnabledPlugin , IssueMode , PluginDef , Platform } ;
5
+ use qlty_config:: config:: { DriverDef , EnabledPlugin , IssueMode , Platform , PluginDef } ;
6
6
use semver:: { Version , VersionReq } ;
7
7
use std:: path:: { Path , PathBuf } ;
8
8
use tracing:: { debug, trace, warn} ;
@@ -48,8 +48,17 @@ fn configure_plugins(planner: &Planner) -> Result<Vec<ActivePlugin>> {
48
48
continue ;
49
49
}
50
50
51
- if let Some ( plugin_def) = planner. config . plugins . definitions . get ( enabled_plugin. name . as_str ( ) ) {
52
- if !plugin_def. supported_platforms . is_empty ( ) && !plugin_def. supported_platforms . contains ( & Platform :: current ( ) ) {
51
+ if let Some ( plugin_def) = planner
52
+ . config
53
+ . plugins
54
+ . definitions
55
+ . get ( enabled_plugin. name . as_str ( ) )
56
+ {
57
+ if !plugin_def. supported_platforms . is_empty ( )
58
+ && !plugin_def
59
+ . supported_platforms
60
+ . contains ( & Platform :: current ( ) )
61
+ {
53
62
warn ! (
54
63
"Plugin {} is not supported on this platform ({}), skipping. (Supported platforms are: {})" ,
55
64
enabled_plugin. name,
@@ -557,14 +566,12 @@ mod test {
557
566
) ;
558
567
559
568
let planner = build_planner ( QltyConfig {
560
- plugin : vec ! [
561
- EnabledPlugin {
562
- name: "enabled" . to_string( ) ,
563
- prefix: Some ( "prefix" . to_string( ) ) ,
564
- drivers: vec![ ALL . to_string( ) ] ,
565
- ..Default :: default ( )
566
- } ,
567
- ] ,
569
+ plugin : vec ! [ EnabledPlugin {
570
+ name: "enabled" . to_string( ) ,
571
+ prefix: Some ( "prefix" . to_string( ) ) ,
572
+ drivers: vec![ ALL . to_string( ) ] ,
573
+ ..Default :: default ( )
574
+ } ] ,
568
575
plugins : PluginsConfig {
569
576
downloads : HashMap :: new ( ) ,
570
577
releases : HashMap :: new ( ) ,
@@ -576,7 +583,7 @@ mod test {
576
583
let plugins: Vec < ActivePlugin > = enabled_plugins ( & planner) . unwrap ( ) ;
577
584
578
585
assert ! ( plugins. is_empty( ) ) ;
579
- }
586
+ }
580
587
581
588
#[ test]
582
589
fn test_config_plugin_prefix_package_file ( ) {
0 commit comments