Skip to content

Commit

Permalink
Merge branch 'main' into feat-3929
Browse files Browse the repository at this point in the history
  • Loading branch information
fireairforce committed Sep 19, 2024
2 parents 905b346 + 6922305 commit 04b8a67
Show file tree
Hide file tree
Showing 47 changed files with 771 additions and 190 deletions.
22 changes: 13 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ New entries must be placed in a section entitled `Unreleased`.
Read
our [guidelines for writing a good changelog entry](https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md#changelog).

## Unreleased

### Analyzer
## v1.9.2 (2024-09-19)

### CLI

#### New features

- Added support for custom GritQL definitions, including:
- Pattern and predicate definitions: https://docs.grit.io/guides/patterns
- Function definitions: https://docs.grit.io/language/functions#function-definitions

Contributed by @arendjr

#### Bug fixes

- Fix [#3917](https://github.com/biomejs/biome/issues/3917), where the fixed files were incorrectly computed. Contributed by @ematipico

### Configuration
- Fixed an issue that caused GritQL `contains` queries to report false positives when the matched
node appeared inside a sibling node. Contributed by @arendjr

### Editors

Expand All @@ -36,10 +42,6 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

Contributed by @ematipico

### Formatter

### JavaScript APIs

### Linter

#### New features
Expand All @@ -49,6 +51,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

#### Bug fixes

- [noLabelWithoutControl](https://biomejs.dev/linter/rules/no-label-without-control/) now accept JSX expression as label value ([#3875](https://github.com/biomejs/biome/issues/3875)). Contributed by @Conaclos

- [useFilenamingConvention](https://biomejs.dev/linter/rules/use-filenaming-convention) no longer suggests names with a disallowed case ([#3952](https://github.com/biomejs/biome/issues/3952)). Contributed by @Conaclos

- [useFilenamingConvention](https://biomejs.dev/linter/rules/use-filenaming-convention) now recognizes file names starting with ASCII digits as lowercase ([#3952](https://github.com/biomejs/biome/issues/3952)).
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ declare_lint_rule! {
/// ```
///
pub NoMissingVarFunction {
version: "next",
version: "1.9.2",
name: "noMissingVarFunction",
language: "css",
recommended: true,
Expand Down
1 change: 1 addition & 0 deletions crates/biome_grit_patterns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ grit-pattern-matcher = { version = "0.3" }
grit-util = { version = "0.3" }
im = { version = "15.1.0" }
path-absolutize = { version = "3.1.1", optional = false, features = ["use_unix_paths_on_wasm"] }
rand = { version = "0.8" }
regex = { workspace = true }
rustc-hash = { workspace = true }
serde = { workspace = true, features = ["derive"] }
Expand Down
11 changes: 11 additions & 0 deletions crates/biome_grit_patterns/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub enum CompileError {
/// Used for missing syntax nodes.
MissingSyntaxNode,

/// A built-in function call was discovered in an unexpected context.
UnexpectedBuiltinCall(String),

/// A metavariables was discovered in an unexpected context.
UnexpectedMetavariable,

Expand Down Expand Up @@ -95,6 +98,9 @@ impl Diagnostic for CompileError {
CompileError::MissingSyntaxNode => {
fmt.write_markup(markup! { "A syntax node was missing" })
}
CompileError::UnexpectedBuiltinCall(name) => {
fmt.write_markup(markup! { "Unexpected call to built-in: "{{name}}"()" })
}
CompileError::UnexpectedMetavariable => {
fmt.write_markup(markup! { "Unexpected metavariable" })
}
Expand Down Expand Up @@ -176,6 +182,11 @@ impl Diagnostic for CompileError {

fn advices(&self, visitor: &mut dyn biome_diagnostics::Visit) -> std::io::Result<()> {
match self {
CompileError::UnexpectedBuiltinCall(name) => visitor.record_log(
LogCategory::Info,
&markup! { "Built-in "{{name}}" can only be used on the right-hand side of a rewrite" }
.to_owned(),
),
CompileError::ReservedMetavariable(_) => visitor.record_log(
LogCategory::Info,
&markup! { "Try using a different variable name" }.to_owned(),
Expand Down
Loading

0 comments on commit 04b8a67

Please sign in to comment.