Skip to content

Commit

Permalink
un-make quote-style a global formatter property and just apply to bot…
Browse files Browse the repository at this point in the history
…h css and js
  • Loading branch information
faultyserver committed Dec 31, 2023
1 parent f91ccea commit 245c847
Show file tree
Hide file tree
Showing 69 changed files with 124 additions and 110 deletions.
6 changes: 3 additions & 3 deletions crates/biome_cli/tests/cases/overrides_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const FORMATTED_WITH_NO_SEMICOLONS: &str = "const a = [\"loreum\", \"ipsum\"]\n"

const CSS_UNFORMATTED_QUOTES: &str =
r#"[class='foo'] { background-image: url("/path/to/file.jpg")}"#;
const CSS_FORMATTED_SINGLE_QUOTES: &str =
"[class='foo'] {\n\tbackground-image: url('/path/to/file.jpg');\n}\n";
const CSS_FORMATTED_SINGLE_QUOTES_AND_SPACES: &str =
"[class='foo'] {\n background-image: url('/path/to/file.jpg');\n}\n";

#[test]
fn does_handle_included_file_and_disable_formatter() {
Expand Down Expand Up @@ -279,7 +279,7 @@ fn does_include_file_with_different_languages() {

assert_file_contents(&fs, test, FORMATTED_WITH_SINGLE_QUOTES);
assert_file_contents(&fs, test2, FORMATTED_WITH_NO_SEMICOLONS);
assert_file_contents(&fs, test_css, CSS_FORMATTED_SINGLE_QUOTES);
assert_file_contents(&fs, test_css, CSS_FORMATTED_SINGLE_QUOTES_AND_SPACES);

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_cli/tests/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const APPLY_CSS_QUOTE_STYLE_BEFORE: &str =
r#"[class='foo'] { background-image: url("/path/to/file.jpg")}"#;

const APPLY_CSS_QUOTE_STYLE_AFTER: &str =
"[class='foo'] {\n\tbackground-image: url('/path/to/file.jpg');\n}";
"[class='foo'] {\n\tbackground-image: url('/path/to/file.jpg');\n}\n";

const APPLY_TRAILING_COMMA_BEFORE: &str = r#"
const a = [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ The configuration that is contained inside the file `biome.json`
--indent-width=NUMBER The size of the indentation, 2 by default
--line-ending=<lf|crlf|cr> The type of line ending.
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--quote-style=<double|single> The type of quotes used in languages that support alternate quoting
styles. Defaults to double.
--jsx-quote-style=<double|single> The type of quotes used in JSX. Defaults to double.
--quote-properties=<preserve|as-needed> When properties in objects are quoted. Defaults to asNeeded.
--trailing-comma=<all|es5|none> Print trailing commas wherever possible in multi-line comma-separated
Expand All @@ -56,8 +54,7 @@ The configuration that is contained inside the file `biome.json`
(and its super languages) files.
--javascript-formatter-line-width=NUMBER What's the max width of a line applied to JavaScript
(and its super languages) files. Defaults to 80.
--javascript-formatter-quote-style=<double|single> The type of quotes used in JavaScript code.
Defaults to double.
--quote-style=<double|single> The type of quotes used in JavaScript code. Defaults to double.
--json-formatter-enabled=<true|false> Control the formatter for JSON (and its super languages)
files.
--json-formatter-indent-style=<tab|space> The indent style applied to JSON (and its super languages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ The configuration that is contained inside the file `biome.json`
--indent-width=NUMBER The size of the indentation, 2 by default
--line-ending=<lf|crlf|cr> The type of line ending.
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--quote-style=<double|single> The type of quotes used in languages that support alternate quoting
styles. Defaults to double.
--jsx-quote-style=<double|single> The type of quotes used in JSX. Defaults to double.
--quote-properties=<preserve|as-needed> When properties in objects are quoted. Defaults to asNeeded.
--trailing-comma=<all|es5|none> Print trailing commas wherever possible in multi-line comma-separated
Expand All @@ -58,8 +56,7 @@ The configuration that is contained inside the file `biome.json`
(and its super languages) files.
--javascript-formatter-line-width=NUMBER What's the max width of a line applied to JavaScript
(and its super languages) files. Defaults to 80.
--javascript-formatter-quote-style=<double|single> The type of quotes used in JavaScript code.
Defaults to double.
--quote-style=<double|single> The type of quotes used in JavaScript code. Defaults to double.
--json-formatter-enabled=<true|false> Control the formatter for JSON (and its super languages)
files.
--json-formatter-indent-style=<tab|space> The indent style applied to JSON (and its super languages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Generic options applied to all files
--indent-width=NUMBER The size of the indentation, 2 by default
--line-ending=<lf|crlf|cr> The type of line ending.
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--quote-style=<double|single> The type of quotes used in languages that support alternate quoting
styles. Defaults to double.
Formatting options specific to the JavaScript files
--jsx-quote-style=<double|single> The type of quotes used in JSX. Defaults to double.
Expand Down Expand Up @@ -44,8 +42,7 @@ Formatting options specific to the JavaScript files
(and its super languages) files.
--javascript-formatter-line-width=NUMBER What's the max width of a line applied to JavaScript
(and its super languages) files. Defaults to 80.
--javascript-formatter-quote-style=<double|single> The type of quotes used in JavaScript code.
Defaults to double.
--quote-style=<double|single> The type of quotes used in JavaScript code. Defaults to double.
Set of properties to integrate Biome with a VCS software.
--vcs-client-kind=<git> The kind of client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
1 change: 1 addition & 0 deletions crates/biome_css_formatter/tests/specs/css/block.css.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
1 change: 1 addition & 0 deletions crates/biome_css_formatter/tests/specs/css/casing.css.snap
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
1 change: 1 addition & 0 deletions crates/biome_css_formatter/tests/specs/css/empty.css.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
-----

```css
Expand Down
Loading

0 comments on commit 245c847

Please sign in to comment.