Skip to content

Commit

Permalink
fix(cli): don't handle CSS files (#1523)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Jan 11, 2024
1 parent 024b7af commit 660c38a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom
### CLI

- Fix [#1512](https://github.com/biomejs/biome/issues/1512) by skipping verbose diagnostics from the count. Contributed by @ematipico
- Don't handle CSS files, the formatter isn't ready yet. Contributed by @ematipico

### Configuration

Expand Down
2 changes: 2 additions & 0 deletions crates/biome_cli/tests/cases/overrides_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ fn does_include_file_with_different_overrides() {
}

#[test]
#[ignore = "Enable when we are ready to handle CSS files"]
fn does_include_file_with_different_languages() {
let mut console = BufferConsole::default();
let mut fs = MemoryFileSystem::default();
Expand Down Expand Up @@ -291,6 +292,7 @@ fn does_include_file_with_different_languages() {
}

#[test]
#[ignore = "Enable when we are ready to handle CSS files"]
fn does_include_file_with_different_languages_and_files() {
let mut console = BufferConsole::default();
let mut fs = MemoryFileSystem::default();
Expand Down
1 change: 1 addition & 0 deletions crates/biome_cli/tests/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ fn applies_custom_quote_style() {
}

#[test]
#[ignore = "Enable when we are ready to handle CSS files"]
fn applies_custom_css_quote_style() {
let mut fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ expression: content
## `input.css`

```css
html {
}

html {}
```

## `input.js`
Expand Down Expand Up @@ -112,7 +110,7 @@ biome.json:20:17 deserialize DEPRECATED ━━━━━━━━━━━━
```

```block
Formatted 3 file(s) in <TIME>
Formatted 2 file(s) in <TIME>
```


Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ expression: content
## `input.css`

```css
html {
}

html {}
```

## `input.js`
Expand Down Expand Up @@ -73,7 +71,7 @@ internalError/fs DEPRECATED ━━━━━━━━━━━━━━━━
```

```block
Formatted 3 file(s) in <TIME>
Formatted 2 file(s) in <TIME>
```


7 changes: 5 additions & 2 deletions crates/biome_service/src/file_handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ impl Language {
"typescriptreact" => Language::TypeScriptReact,
"json" => Language::Json,
"jsonc" => Language::Jsonc,
"css" => Language::Css,
// TODO: remove this when we are ready to handle CSS files
"css" => Language::Unknown,
_ => Language::Unknown,
}
}
Expand Down Expand Up @@ -341,6 +342,7 @@ pub(crate) trait ExtensionHandler {
pub(crate) struct Features {
js: JsFileHandler,
json: JsonFileHandler,
#[allow(unused)]
css: CssFileHandler,
unknown: UnknownFileHandler,
}
Expand Down Expand Up @@ -380,7 +382,8 @@ impl Features {
| Language::TypeScript
| Language::TypeScriptReact => self.js.capabilities(),
Language::Json | Language::Jsonc => self.json.capabilities(),
Language::Css => self.css.capabilities(),
// TODO: change this when we are ready to handle CSS files
Language::Css => self.unknown.capabilities(),
Language::Unknown => self.unknown.capabilities(),
}
}
Expand Down
1 change: 1 addition & 0 deletions website/src/content/docs/internals/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom
### CLI

- Fix [#1512](https://github.com/biomejs/biome/issues/1512) by skipping verbose diagnostics from the count. Contributed by @ematipico
- Don't handle CSS files, the formatter isn't ready yet. Contributed by @ematipico

### Configuration

Expand Down

0 comments on commit 660c38a

Please sign in to comment.