Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 6 additions & 21 deletions crates/turborepo-lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ const DEFAULT_NUM_WORKERS: u32 = 10;
const SUPPORTED_GRAPH_FILE_EXTENSIONS: [&str; 8] =
["svg", "png", "jpg", "pdf", "json", "html", "mermaid", "dot"];

#[derive(Copy, Clone, Debug, PartialEq, Eq, ValueEnum, Deserializable, Serialize)]
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, ValueEnum, Deserializable, Serialize)]
pub enum OutputLogsMode {
#[serde(rename = "full")]
#[default]
Full,
#[serde(rename = "none")]
None,
Expand All @@ -62,12 +63,6 @@ pub enum OutputLogsMode {
ErrorsOnly,
}

impl Default for OutputLogsMode {
fn default() -> Self {
Self::Full
}
}

impl Display for OutputLogsMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Expand All @@ -92,22 +87,17 @@ impl From<OutputLogsMode> for turborepo_ui::tui::event::OutputLogs {
}
}

#[derive(Copy, Clone, Debug, PartialEq, Serialize, ValueEnum, Deserialize, Eq)]
#[derive(Copy, Clone, Debug, Default, PartialEq, Serialize, ValueEnum, Deserialize, Eq)]
pub enum LogOrder {
#[serde(rename = "auto")]
#[default]
Auto,
#[serde(rename = "stream")]
Stream,
#[serde(rename = "grouped")]
Grouped,
}

impl Default for LogOrder {
fn default() -> Self {
Self::Auto
}
}

impl Display for LogOrder {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Expand Down Expand Up @@ -1162,22 +1152,17 @@ impl RunArgs {
}
}

#[derive(ValueEnum, Clone, Copy, Debug, PartialEq, Serialize)]
#[derive(ValueEnum, Clone, Copy, Debug, Default, PartialEq, Serialize)]
pub enum LogPrefix {
#[serde(rename = "auto")]
#[default]
Auto,
#[serde(rename = "none")]
None,
#[serde(rename = "task")]
Task,
}

impl Default for LogPrefix {
fn default() -> Self {
Self::Auto
}
}

impl Display for LogPrefix {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Expand Down
22 changes: 12 additions & 10 deletions crates/turborepo-lib/src/engine/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,16 +732,18 @@ impl<'a> EngineBuilder<'a> {
.load(package_name)
.map(Some)
.or_else(|err| {
if let Some((span, text)) = read_req.required()
&& matches!(err, config::Error::NoTurboJSON)
{
Err(Error::MissingTurboJsonExtends(Box::new(
MissingTurboJsonExtends {
package_name: read_req.package_name().to_string(),
span,
text,
},
)))
if let Some((span, text)) = read_req.required() {
if matches!(err, config::Error::NoTurboJSON) {
Err(Error::MissingTurboJsonExtends(Box::new(
MissingTurboJsonExtends {
package_name: read_req.package_name().to_string(),
span,
text,
},
)))
} else {
Err(err.into())
}
} else if matches!(err, config::Error::NoTurboJSON) {
Ok(None)
} else {
Expand Down
1 change: 0 additions & 1 deletion crates/turborepo-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#![feature(once_cell_try)]
#![feature(try_blocks)]
#![feature(impl_trait_in_assoc_type)]
#![feature(let_chains)]
#![deny(clippy::all)]
// Clippy's needless mut lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11299
#![allow(clippy::needless_pass_by_ref_mut)]
Expand Down
11 changes: 4 additions & 7 deletions crates/turborepo-lib/src/turbo_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,20 @@ impl DerefMut for Pipeline {
}
}

#[derive(Serialize, Deserialize, Debug, Copy, Clone, Deserializable, PartialEq, Eq, ValueEnum)]
#[derive(
Serialize, Deserialize, Debug, Default, Copy, Clone, Deserializable, PartialEq, Eq, ValueEnum,
)]
#[serde(rename_all = "camelCase")]
pub enum UIMode {
/// Use the terminal user interface
#[default]
Tui,
/// Use the standard output stream
Stream,
/// Use the web user interface (experimental)
Web,
}

impl Default for UIMode {
fn default() -> Self {
Self::Tui
}
}

impl Display for UIMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Expand Down
41 changes: 20 additions & 21 deletions crates/turborepo-lib/src/turbo_json/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,27 @@ pub fn validate_extends(validator: &Validator, turbo_json: &TurboJson) -> Vec<Er
text: NamedSource::new(path, text),
}];
}
if let Some(package_name) = turbo_json.extends.first()
&& package_name != ROOT_PKG_NAME
&& validator.non_root_extends
{
let path = turbo_json
.path
.as_ref()
.map_or("turbo.json", |p| p.as_ref());
if let Some(package_name) = turbo_json.extends.first() {
if package_name != ROOT_PKG_NAME && validator.non_root_extends {
let path = turbo_json
.path
.as_ref()
.map_or("turbo.json", |p| p.as_ref());

let (span, text) = match turbo_json.text {
Some(ref text) => {
let len = text.len();
let span: SourceSpan = (0, len - 1).into();
(Some(span), text.to_string())
}
None => (None, String::new()),
};
// Root needs to be first
return vec![Error::ExtendsRootFirst {
span,
text: NamedSource::new(path, text),
}];
let (span, text) = match turbo_json.text {
Some(ref text) => {
let len = text.len();
let span: SourceSpan = (0, len - 1).into();
(Some(span), text.to_string())
}
None => (None, String::new()),
};
// Root needs to be first
return vec![Error::ExtendsRootFirst {
span,
text: NamedSource::new(path, text),
}];
}
}
// If we allow for non-root extends we don't need to perform this check
(!validator.non_root_extends
Expand Down
9 changes: 2 additions & 7 deletions crates/turborepo-lockfiles/src/bun/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ type BTreeSet<T> = std::collections::BTreeSet<T>;

/// Represents a platform constraint that can be either inclusive or exclusive.
/// This matches Bun's Negatable type for os/cpu/libc fields.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub enum Negatable {
/// No constraint - package works on all platforms
#[default]
None,
/// Single platform constraint
Single(String),
Expand All @@ -127,12 +128,6 @@ pub enum Negatable {
Negated(Vec<String>),
}

impl Default for Negatable {
fn default() -> Self {
Self::None
}
}

impl Serialize for Negatable {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down
9 changes: 2 additions & 7 deletions crates/turborepo-vt100/src/attrs.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::term::BufWrite as _;

/// Represents a foreground or background color for cells.
#[derive(Eq, PartialEq, Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Debug, Default, Copy, Clone)]
pub enum Color {
/// The default terminal color.
#[default]
Default,

/// An indexed terminal color.
Expand All @@ -13,12 +14,6 @@ pub enum Color {
Rgb(u8, u8, u8),
}

impl Default for Color {
fn default() -> Self {
Self::Default
}
}

const TEXT_MODE_BOLD: u8 = 0b0000_0001;
const TEXT_MODE_ITALIC: u8 = 0b0000_0010;
const TEXT_MODE_UNDERLINE: u8 = 0b0000_0100;
Expand Down
18 changes: 4 additions & 14 deletions crates/turborepo-vt100/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const MODE_ALTERNATE_SCREEN: u8 = 0b0000_1000;
const MODE_BRACKETED_PASTE: u8 = 0b0001_0000;

/// The xterm mouse handling mode currently in use.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
pub enum MouseProtocolMode {
/// Mouse handling is disabled.
#[default]
None,

/// Mouse button events should be reported on button press. Also known as
Expand All @@ -34,16 +35,11 @@ pub enum MouseProtocolMode {
// DecLocator,
}

impl Default for MouseProtocolMode {
fn default() -> Self {
Self::None
}
}

/// The encoding to use for the enabled `MouseProtocolMode`.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
pub enum MouseProtocolEncoding {
/// Default single-printable-byte encoding.
#[default]
Default,

/// UTF-8-based encoding.
Expand All @@ -54,12 +50,6 @@ pub enum MouseProtocolEncoding {
// Urxvt,
}

impl Default for MouseProtocolEncoding {
fn default() -> Self {
Self::Default
}
}

/// Represents the overall terminal state.
#[derive(Clone, Debug)]
pub struct Screen {
Expand Down
2 changes: 1 addition & 1 deletion packages/turbo-repository/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ script_provided_flags="\
for flag in $user_provided_flags; do
if [[ $flag == --target=* ]]; then
target=${flag#*=}
rustup toolchain install nightly-2025-06-20 --target "$target"
rustup toolchain install nightly-2025-09-12 --target "$target"

# For we need to cross-compile some targets with Zig
# Fortunately, napi comes with a `--zig` flag
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
# Needs to be copied to `packages/turbo-repository/scripts/build.sh`
channel = "nightly-2025-06-20"
channel = "nightly-2025-09-12"
components = ["rustfmt", "clippy"]
profile = "minimal"
Loading