Skip to content

Commit

Permalink
Remove --preview as a required argument for ruff server (#12053)
Browse files Browse the repository at this point in the history
## Summary

`ruff server` has reached a point of stabilization, and `--preview` is
no longer required as a flag.

`--preview` is still supported as a flag, since future features may be
need to gated behind it initially.

## Test Plan

A simple way to test this is to run `ruff server` from the command line.
No error about a missing `--preview` argument should be reported.
  • Loading branch information
snowsignal authored Jun 27, 2024
1 parent 59ea94c commit b28dc9a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions crates/ruff/src/commands/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ use crate::ExitStatus;
use anyhow::Result;
use ruff_server::Server;

pub(crate) fn run_server(preview: bool, worker_threads: NonZeroUsize) -> Result<ExitStatus> {
if !preview {
tracing::error!("--preview needs to be provided as a command line argument while the server is still unstable.\nFor example: `ruff server --preview`");
return Ok(ExitStatus::Error);
}

pub(crate) fn run_server(_preview: bool, worker_threads: NonZeroUsize) -> Result<ExitStatus> {
let server = Server::new(worker_threads)?;

server.run().map(|()| ExitStatus::Success)
Expand Down

0 comments on commit b28dc9a

Please sign in to comment.