@@ -115,6 +115,11 @@ pub struct CheckCommand {
115
115
/// The minimum Python version that should be supported.
116
116
#[ arg( long, value_enum) ]
117
117
pub target_version : Option < PythonVersion > ,
118
+ /// Enable preview mode
119
+ #[ arg( long, overrides_with( "no_preview" ) ) ]
120
+ preview : bool ,
121
+ #[ clap( long, overrides_with( "preview" ) , hide = true ) ]
122
+ no_preview : bool ,
118
123
/// Path to the `pyproject.toml` or `ruff.toml` file to use for
119
124
/// configuration.
120
125
#[ arg( long, conflicts_with = "isolated" ) ]
@@ -458,6 +463,7 @@ impl CheckCommand {
458
463
ignore : self . ignore ,
459
464
line_length : self . line_length ,
460
465
per_file_ignores : self . per_file_ignores ,
466
+ preview_mode : resolve_bool_arg ( self . preview , self . no_preview ) ,
461
467
respect_gitignore : resolve_bool_arg (
462
468
self . respect_gitignore ,
463
469
self . no_respect_gitignore ,
@@ -569,6 +575,7 @@ pub struct Overrides {
569
575
pub ignore : Option < Vec < RuleSelector > > ,
570
576
pub line_length : Option < LineLength > ,
571
577
pub per_file_ignores : Option < Vec < PatternPrefixPair > > ,
578
+ pub preview_mode : Option < bool > ,
572
579
pub respect_gitignore : Option < bool > ,
573
580
pub select : Option < Vec < RuleSelector > > ,
574
581
pub show_source : Option < bool > ,
@@ -632,6 +639,9 @@ impl ConfigProcessor for Overrides {
632
639
if let Some ( line_length) = & self . line_length {
633
640
config. line_length = Some ( * line_length) ;
634
641
}
642
+ if let Some ( preview_mode) = & self . preview_mode {
643
+ config. preview_mode = Some ( * preview_mode) ;
644
+ }
635
645
if let Some ( per_file_ignores) = & self . per_file_ignores {
636
646
config. per_file_ignores = Some ( collect_per_file_ignores ( per_file_ignores. clone ( ) ) ) ;
637
647
}
0 commit comments