Skip to content

Commit

Permalink
Point to local crates
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Feb 14, 2023
1 parent 9886f33 commit ddd458a
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 219 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rustflags = [
# This is a workaround to configure lints for the entire workspace, pending the ability to configure this via TOML.
# See: `https://github.com/rust-lang/cargo/issues/5034`
# `https://github.com/EmbarkStudios/rust-ecosystem/issues/22#issuecomment-947011395`
"-Dunsafe_code",
"-Wclippy::pedantic",
# Allowed pedantic lints
"-Wclippy::char_lit_as_u8",
Expand Down
181 changes: 4 additions & 177 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/ruff_python_formatter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
anyhow = "1.0.68"
clap = { version = "4.0.1", features = ["derive"] }
once_cell = "1.17.0"
rome_formatter = { path = "../../../tools/crates/rome_formatter" }
rome_text_size = { path = "../../../tools/crates/rome_text_size" }
ruff_formatter = { path = "../ruff_formatter" }
ruff_text_size = { path = "../ruff_text_size" }
rustc-hash = "1.1.0"
rustpython-common = { workspace = true }
rustpython-parser = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_python_formatter/src/builders.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rome_formatter::prelude::*;
use rome_formatter::{write, Format};
use ruff_formatter::prelude::*;
use ruff_formatter::{write, Format};

use crate::context::ASTFormatContext;
use crate::core::types::Range;
Expand All @@ -13,7 +13,7 @@ pub struct Literal {
impl Format<ASTFormatContext<'_>> for Literal {
fn fmt(&self, f: &mut Formatter<ASTFormatContext<'_>>) -> FormatResult<()> {
let (text, start, end) = f.context().locator().slice(self.range);
f.write_element(FormatElement::Text { text, start, end })
f.write_element(FormatElement::StaticTextSlice { text, start, end })
}
}

Expand Down
6 changes: 1 addition & 5 deletions crates/ruff_python_formatter/src/context.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rome_formatter::{FormatContext, SimpleFormatOptions, TransformSourceMap};
use ruff_formatter::{FormatContext, SimpleFormatOptions};

use crate::core::locator::Locator;

Expand All @@ -19,10 +19,6 @@ impl FormatContext for ASTFormatContext<'_> {
fn options(&self) -> &Self::Options {
&self.options
}

fn source_map(&self) -> Option<&TransformSourceMap> {
None
}
}

impl<'a> ASTFormatContext<'a> {
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_python_formatter/src/format/alias.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rome_formatter::prelude::*;
use rome_formatter::write;
use rome_text_size::TextSize;
use ruff_formatter::prelude::*;
use ruff_formatter::write;
use ruff_text_size::TextSize;

use crate::context::ASTFormatContext;
use crate::cst::Alias;
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_python_formatter/src/format/arg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rome_formatter::prelude::*;
use rome_formatter::write;
use rome_text_size::TextSize;
use ruff_formatter::prelude::*;
use ruff_formatter::write;
use ruff_text_size::TextSize;

use crate::context::ASTFormatContext;
use crate::cst::Arg;
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_python_formatter/src/format/arguments.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rome_formatter::prelude::*;
use rome_formatter::{format_args, write, Format};
use ruff_formatter::prelude::*;
use ruff_formatter::{format_args, write, Format};

use crate::context::ASTFormatContext;
use crate::cst::Arguments;
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_python_formatter/src/format/boolop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rome_formatter::prelude::*;
use rome_formatter::write;
use ruff_formatter::prelude::*;
use ruff_formatter::write;

use crate::context::ASTFormatContext;
use crate::cst::Boolop;
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_python_formatter/src/format/builders.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rome_formatter::prelude::*;
use rome_formatter::{write, Format};
use rome_text_size::TextSize;
use ruff_formatter::prelude::*;
use ruff_formatter::{write, Format};
use ruff_text_size::TextSize;

use crate::context::ASTFormatContext;
use crate::cst::Stmt;
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_python_formatter/src/format/cmpop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rome_formatter::prelude::*;
use rome_formatter::write;
use ruff_formatter::prelude::*;
use ruff_formatter::write;

use crate::context::ASTFormatContext;
use crate::cst::Cmpop;
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_python_formatter/src/format/comprehension.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rome_formatter::prelude::*;
use rome_formatter::write;
use ruff_formatter::prelude::*;
use ruff_formatter::write;

use crate::context::ASTFormatContext;
use crate::cst::Comprehension;
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_python_formatter/src/format/expr.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![allow(unused_variables, clippy::too_many_arguments)]

use rome_formatter::prelude::*;
use rome_formatter::{format_args, write};
use rome_text_size::TextSize;
use ruff_formatter::prelude::*;
use ruff_formatter::{format_args, write};
use ruff_text_size::TextSize;
use rustpython_parser::ast::Constant;

use crate::builders::literal;
Expand Down
Loading

0 comments on commit ddd458a

Please sign in to comment.