Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hidden --preview / --no-preview options to ruff check #7009

Merged
merged 7 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/ruff/src/settings/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ pub enum PreviewMode {

impl From<bool> for PreviewMode {
fn from(version: bool) -> Self {
match version {
true => PreviewMode::Enabled,
false => PreviewMode::Disabled,
if version {
PreviewMode::Enabled
} else {
PreviewMode::Disabled
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always reminds me of @charliermarsh's tweet about how high-performance code looks like 😆

}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ruff::directives;
use ruff::line_width::{LineLength, TabSize};
use ruff::linter::{check_path, LinterResult};
use ruff::registry::AsRule;
use ruff::settings::types::{PythonVersion};
use ruff::settings::types::PythonVersion;
use ruff::settings::{defaults, flags, Settings};
use ruff_formatter::{FormatResult, Formatted};
use ruff_python_ast::{Mod, PySourceType};
Expand Down