Skip to content

Commit

Permalink
Merge branch 'main' into feat/gritql-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry authored Sep 15, 2024
2 parents 7838b4b + 63bec3e commit db865b7
Show file tree
Hide file tree
Showing 91 changed files with 1,944 additions and 656 deletions.
15 changes: 4 additions & 11 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,21 @@ A-Linter:
- changed-files:
- any-glob-to-any-file:
- crates/biome_analyze/**
- crates/biome_js_analyze/**
- crates/biome_json_analyze/**
- crates/biome_*_analyze/**

A-Parser:
- changed-files:
- any-glob-to-any-file:
- crates/biome_parser/**
- crates/biome_js_parser/**
- crates/biome_js_syntax/**
- crates/biome_json_parser/**
- crates/biome_json_syntax/**
- crates/biome_css_parser/**
- crates/biome_css_syntax/**
- crates/biome_*_parser/**
- crates/biome_*_syntax/**

A-Formatter:
- changed-files:
- any-glob-to-any-file:
- crates/biome_formatter/**
- crates/biome_formatter_test/**
- crates/biome_js_formatter/**
- crates/biome_json_formatter/**
- crates/biome_css_formatter/**
- crates/biome_*_formatter/**

A-Editors:
- changed-files:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bench_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
channel: stable
cache-target: release
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install hyperfine
run: cargo install hyperfine
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
cache-target: release
bins: cargo-codspeed
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Compile
run: cargo codspeed build --features codspeed -p xtask_bench
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
components: rustfmt
bins: taplo-cli
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run rustfmt
run: |
cargo fmt --all --verbose -- --check
Expand All @@ -51,6 +53,8 @@ jobs:
with:
components: clippy
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo check
run: cargo check --workspace --all-targets --release
- name: Run clippy
Expand All @@ -69,6 +73,8 @@ jobs:
with:
channel: nightly
cache: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install udeps
run: cargo install cargo-udeps --locked
- name: Run udeps
Expand All @@ -92,6 +98,8 @@ jobs:
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests on ${{ matrix.os }}
run: cargo test --workspace

Expand All @@ -118,6 +126,8 @@ jobs:
with:
cache-target: release
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Compile
run: cargo build --release --locked -p xtask_coverage
- name: Run Test262 suite
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/parser_conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
with:
cache-target: release
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Compile
run: cargo build --release --locked -p xtask_coverage
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
components: rustfmt
bins: taplo-cli
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run format
run: |
cargo fmt --all --check
Expand All @@ -56,6 +58,8 @@ jobs:
with:
components: clippy
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy
run: |
cargo lint
Expand Down Expand Up @@ -93,6 +97,8 @@ jobs:
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: cargo test --workspace

Expand All @@ -109,6 +115,8 @@ jobs:
with:
cache-target: release
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build main binary
run: cargo build -p biome_cli --release
- name: Install Node.js
Expand Down Expand Up @@ -152,6 +160,8 @@ jobs:
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run doc command
run: cargo documentation

Expand All @@ -167,6 +177,8 @@ jobs:
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1
with:
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run the grammar codegen
run: cargo codegen grammar
- name: Run the analyzer codegen
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_knope.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [ closed ]
branches: [ main ]


jobs:
retrieve-version:
if: github.head_ref == 'release/automated-ci' && github.event.pull_request.merged == true
Expand Down Expand Up @@ -81,6 +82,8 @@ jobs:
channel: stable
cache-target: release
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install arm64 toolchain
if: matrix.code-target == 'linux-arm64' || matrix.code-target == 'linux-arm64-musl'
Expand Down Expand Up @@ -245,6 +248,8 @@ jobs:
channel: stable
cache-target: release
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_TOKEN }}
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,42 @@ 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

## v1.9.1 (2024-09-15)

### Analyzer

### CLI

#### Bug fixes

- `useEditorConfig` now loads the editorconfig when running `biome ci` [#3864](https://github.com/biomejs/biome/issues/3864). Contributed by @dyc3

- Revert [#3731](https://github.com/biomejs/biome/pull/3731) to fix broken quick fixes and code actions. Contributed by @nhedger

### Configuration

### Editors

### Formatter

### JavaScript APIs

### Linter

#### New Features

- Add [nursery/noProcessEnv](https://biomejs.dev/linter/rules/no-process-env/). Contributed by @unvalley

#### Bug fixes

- [useSemanticElements](https://biomejs.dev/linter/rules/use-semantic-elements/) now ignores `alert` and `alertdialog` roles ([3858](https://github.com/biomejs/biome/issues/3858)). Contributed by @Conaclos

- [noUndeclaredDependencies](https://biomejs.dev/linter/rules/no-undeclared-dependencies/) now ignores `@/` imports and recognizes type imports from Definitely Typed and `bun` imports. Contributed by @Conaclos

### Parser

## v1.9.0 (2024-09-12)

### Analyzer
Expand Down Expand Up @@ -375,7 +411,7 @@ The following JavaScript rules are promoted:

- Add [nursery/useTrimStartEnd](https://biomejs.dev/linter/rules/use-trim-start-end/). Contributed by @chansuke

- Add [nursery/noIrreguluarWhitespace](https://biomejs.dev/linter/rules/no-irreguluar-whitespace/). Contributed by @DerTimonius
- Add [nursery/noIrregularWhitespace](https://biomejs.dev/linter/rules/no-irreguluar-whitespace/). Contributed by @DerTimonius

#### Enhancements

Expand Down
8 changes: 7 additions & 1 deletion crates/biome_analyze/src/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ pub enum RuleSource {
EslintMysticatea(&'static str),
/// Rules from [Eslint Plugin Barrel Files](https://github.com/thepassle/eslint-plugin-barrel-files)
EslintBarrelFiles(&'static str),
/// Rules from [Eslint Plugin N](https://github.com/eslint-community/eslint-plugin-n)
EslintN(&'static str),
/// Rules from [Stylelint](https://github.com/stylelint/stylelint)
Stylelint(&'static str),
}
Expand Down Expand Up @@ -152,6 +154,7 @@ impl std::fmt::Display for RuleSource {
Self::EslintUnusedImports(_) => write!(f, "eslint-plugin-unused-imports"),
Self::EslintMysticatea(_) => write!(f, "@mysticatea/eslint-plugin"),
Self::EslintBarrelFiles(_) => write!(f, "eslint-plugin-barrel-files"),
Self::EslintN(_) => write!(f, "eslint-plugin-n"),
Self::Stylelint(_) => write!(f, "Stylelint"),
}
}
Expand Down Expand Up @@ -199,6 +202,7 @@ impl RuleSource {
| Self::EslintUnusedImports(rule_name)
| Self::EslintMysticatea(rule_name)
| Self::EslintBarrelFiles(rule_name)
| Self::EslintN(rule_name)
| Self::Stylelint(rule_name) => rule_name,
}
}
Expand All @@ -221,6 +225,7 @@ impl RuleSource {
Self::EslintUnusedImports(rule_name) => format!("unused-imports/{rule_name}"),
Self::EslintMysticatea(rule_name) => format!("@mysticatea/{rule_name}"),
Self::EslintBarrelFiles(rule_name) => format!("barrel-files/{rule_name}"),
Self::EslintN(rule_name) => format!("n/{rule_name}"),
Self::Stylelint(rule_name) => format!("stylelint/{rule_name}"),
}
}
Expand All @@ -237,13 +242,14 @@ impl RuleSource {
Self::EslintReact(rule_name) => format!("https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/{rule_name}.md"),
Self::EslintReactHooks(_) => "https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md".to_string(),
Self::EslintTypeScript(rule_name) => format!("https://typescript-eslint.io/rules/{rule_name}"),
Self::EslintSolid(rule_name) => format!("https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/{rule_name}.md"),
Self::EslintSolid(rule_name) => format!("https://github.com/solidjs-community/eslint-plugin-solid/blob/main/packages/eslint-plugin-solid/docs/{rule_name}.md"),
Self::EslintSonarJs(rule_name) => format!("https://github.com/SonarSource/eslint-plugin-sonarjs/blob/HEAD/docs/rules/{rule_name}.md"),
Self::EslintStylistic(rule_name) => format!("https://eslint.style/rules/default/{rule_name}"),
Self::EslintUnicorn(rule_name) => format!("https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/{rule_name}.md"),
Self::EslintUnusedImports(rule_name) => format!("https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/{rule_name}.md"),
Self::EslintMysticatea(rule_name) => format!("https://github.com/mysticatea/eslint-plugin/blob/master/docs/rules/{rule_name}.md"),
Self::EslintBarrelFiles(rule_name) => format!("https://github.com/thepassle/eslint-plugin-barrel-files/blob/main/docs/rules/{rule_name}.md"),
Self::EslintN(rule_name) => format!("https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/{rule_name}.md"),
Self::Stylelint(rule_name) => format!("https://github.com/stylelint/stylelint/blob/main/lib/rules/{rule_name}/README.md"),
}
}
Expand Down
8 changes: 0 additions & 8 deletions crates/biome_aria/src/roles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,13 @@ define_role! {
AlertRole {
PROPS: [],
ROLES: ["section"],
CONCEPTS: &[("alert", &[])],
}
}
define_role! {
/// https://www.w3.org/TR/wai-aria-1.1/#alertdialog
AlertDialogRole {
PROPS: [],
ROLES: ["structure"],
CONCEPTS: &[("alert", &[])],
}
}
define_role! {
Expand Down Expand Up @@ -849,8 +847,6 @@ impl<'a> AriaRoles {
"button",
"article",
"dialog",
"alert",
"alertdialog",
"cell",
"columnheader",
"definition",
Expand Down Expand Up @@ -1228,8 +1224,6 @@ impl<'a> AriaRoles {
"button" => &ButtonRole as &dyn AriaRoleDefinitionWithConcepts,
"article" => &ArticleRole as &dyn AriaRoleDefinitionWithConcepts,
"dialog" => &DialogRole as &dyn AriaRoleDefinitionWithConcepts,
"alert" => &AlertRole as &dyn AriaRoleDefinitionWithConcepts,
"alertdialog" => &AlertDialogRole as &dyn AriaRoleDefinitionWithConcepts,
"cell" => &CellRole as &dyn AriaRoleDefinitionWithConcepts,
"columnheader" => &ColumnHeaderRole as &dyn AriaRoleDefinitionWithConcepts,
"definition" => &DefinitionRole as &dyn AriaRoleDefinitionWithConcepts,
Expand Down Expand Up @@ -1289,8 +1283,6 @@ impl<'a> AriaRoles {
"button" => &ButtonRole as &dyn AriaRoleDefinitionWithConcepts,
"article" => &ArticleRole as &dyn AriaRoleDefinitionWithConcepts,
"dialog" => &DialogRole as &dyn AriaRoleDefinitionWithConcepts,
"alert" => &AlertRole as &dyn AriaRoleDefinitionWithConcepts,
"alertdialog" => &AlertDialogRole as &dyn AriaRoleDefinitionWithConcepts,
"cell" => &CellRole as &dyn AriaRoleDefinitionWithConcepts,
"columnheader" => &ColumnHeaderRole as &dyn AriaRoleDefinitionWithConcepts,
"definition" => &DefinitionRole as &dyn AriaRoleDefinitionWithConcepts,
Expand Down
39 changes: 37 additions & 2 deletions crates/biome_cli/src/commands/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ use crate::{execute_mode, setup_cli_subscriber, CliDiagnostic, CliSession, Execu
use biome_configuration::analyzer::assists::PartialAssistsConfiguration;
use biome_configuration::{organize_imports::PartialOrganizeImports, PartialConfiguration};
use biome_configuration::{PartialFormatterConfiguration, PartialLinterConfiguration};
use biome_console::{markup, ConsoleExt};
use biome_deserialize::Merge;
use biome_diagnostics::PrintDiagnostic;
use biome_service::configuration::{
load_configuration, LoadedConfiguration, PartialConfigurationExt,
load_configuration, load_editorconfig, LoadedConfiguration, PartialConfigurationExt,
};
use biome_service::workspace::{RegisterProjectFolderParams, UpdateSettingsParams};
use std::ffi::OsString;
Expand Down Expand Up @@ -49,11 +51,44 @@ pub(crate) fn ci(session: CliSession, payload: CiCommandPayload) -> Result<(), C
cli_options.verbose,
)?;

let editorconfig_search_path = loaded_configuration.directory_path.clone();
let LoadedConfiguration {
configuration: mut fs_configuration,
configuration: biome_configuration,
directory_path: configuration_path,
..
} = loaded_configuration;

let should_use_editorconfig = configuration
.as_ref()
.and_then(|c| c.formatter.as_ref())
.and_then(|f| f.use_editorconfig)
.unwrap_or(
biome_configuration
.formatter
.as_ref()
.and_then(|f| f.use_editorconfig)
.unwrap_or_default(),
);
let mut fs_configuration = if should_use_editorconfig {
let (editorconfig, editorconfig_diagnostics) = {
let search_path = editorconfig_search_path.unwrap_or_else(|| {
let fs = &session.app.fs;
fs.working_directory().unwrap_or_default()
});
load_editorconfig(&session.app.fs, search_path)?
};
for diagnostic in editorconfig_diagnostics {
session.app.console.error(markup! {
{PrintDiagnostic::simple(&diagnostic)}
})
}
editorconfig.unwrap_or_default()
} else {
Default::default()
};
// this makes biome configuration take precedence over editorconfig configuration
fs_configuration.merge_with(biome_configuration);

let formatter = fs_configuration
.formatter
.get_or_insert_with(PartialFormatterConfiguration::default);
Expand Down
Loading

0 comments on commit db865b7

Please sign in to comment.