Remove `--preview` as a required argument for `ruff server` (#12053)

## 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.
This commit is contained in:
Jane Lewis 2024-06-27 12:27:15 -07:00 committed by GitHub
parent 59ea94ce88
commit b28dc9ac14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 6 deletions

View File

@ -4,12 +4,7 @@ use crate::ExitStatus;
use anyhow::Result; use anyhow::Result;
use ruff_server::Server; use ruff_server::Server;
pub(crate) fn run_server(preview: bool, worker_threads: NonZeroUsize) -> Result<ExitStatus> { 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);
}
let server = Server::new(worker_threads)?; let server = Server::new(worker_threads)?;
server.run().map(|()| ExitStatus::Success) server.run().map(|()| ExitStatus::Success)