-
-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): add the
includes
field
- Loading branch information
Showing
25 changed files
with
276 additions
and
37 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
mod actions; | ||
|
||
pub use crate::analyzer::assists::actions::*; | ||
use biome_deserialize::StringSet; | ||
use biome_deserialize_macros::{Deserializable, Merge, Partial}; | ||
use bpaf::Bpaf; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Deserialize, Eq, Partial, PartialEq, Serialize)] | ||
#[partial(derive(Bpaf, Clone, Deserializable, Eq, Merge, PartialEq))] | ||
#[partial(cfg_attr(feature = "schema", derive(schemars::JsonSchema)))] | ||
#[partial(serde(deny_unknown_fields, rename_all = "camelCase"))] | ||
pub struct AssistsConfiguration { | ||
/// Whether Biome should enable assists via LSP. | ||
#[partial(bpaf(long("assists-enabled"), argument("true|false")))] | ||
pub enabled: bool, | ||
|
||
/// Whether Biome should fail in CLI if the assists were not applied to the code. | ||
#[partial(bpaf(pure(Default::default()), optional, hide))] | ||
pub actions: Actions, | ||
|
||
/// A list of Unix shell style patterns. Biome will ignore files/folders that will | ||
/// match these patterns. | ||
#[partial(bpaf(hide))] | ||
pub ignore: StringSet, | ||
|
||
/// A list of Unix shell style patterns. Biome will include files/folders that will | ||
/// match these patterns. | ||
#[partial(bpaf(hide))] | ||
pub include: StringSet, | ||
|
||
/// A list of glob patterns. Biome will include files/folders that will | ||
/// match these patterns. | ||
#[partial(bpaf(pure(Default::default()), hide))] | ||
pub includes: Vec<biome_glob::Glob>, | ||
} | ||
|
||
impl Default for AssistsConfiguration { | ||
fn default() -> Self { | ||
Self { | ||
enabled: true, | ||
actions: Actions::default(), | ||
ignore: StringSet::default(), | ||
include: StringSet::default(), | ||
includes: Default::default(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use biome_deserialize::StringSet; | ||
use biome_deserialize_macros::{Deserializable, Merge, Partial}; | ||
use bpaf::Bpaf; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Deserialize, Eq, Partial, PartialEq, Serialize)] | ||
#[partial(derive(Bpaf, Clone, Deserializable, Eq, Merge, PartialEq))] | ||
#[partial(cfg_attr(feature = "schema", derive(schemars::JsonSchema)))] | ||
#[partial(serde(rename_all = "camelCase", default, deny_unknown_fields))] | ||
pub struct OrganizeImports { | ||
/// Enables the organization of imports | ||
#[partial(bpaf(hide))] | ||
pub enabled: bool, | ||
|
||
/// A list of Unix shell style patterns. The import organizer will ignore files/folders that will | ||
/// match these patterns. | ||
#[partial(bpaf(hide))] | ||
pub ignore: StringSet, | ||
|
||
/// A list of Unix shell style patterns. The import organizer will include files/folders that will | ||
/// match these patterns. | ||
#[partial(bpaf(hide))] | ||
pub include: StringSet, | ||
|
||
/// A list of glob patterns. The import organizer will include files/folders that will | ||
/// match these patterns. | ||
#[partial(bpaf(pure(Default::default()), hide))] | ||
pub includes: Vec<biome_glob::Glob>, | ||
} | ||
|
||
impl Default for OrganizeImports { | ||
fn default() -> Self { | ||
Self { | ||
enabled: true, | ||
ignore: Default::default(), | ||
include: Default::default(), | ||
includes: Default::default(), | ||
} | ||
} | ||
} | ||
|
||
impl PartialOrganizeImports { | ||
pub const fn is_disabled(&self) -> bool { | ||
matches!(self.enabled, Some(false)) | ||
} | ||
|
||
pub const fn is_enabled(&self) -> bool { | ||
!self.is_disabled() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ formatter_extraneous_field.json:3:3 deserialize ━━━━━━━━━━ | |
- useEditorconfig | ||
- ignore | ||
- include | ||
- includes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ formatter_quote_style.json:3:9 deserialize ━━━━━━━━━━━━ | |
- useEditorconfig | ||
- ignore | ||
- include | ||
- includes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
{ | ||
"ignore": [], | ||
"include": [], | ||
"includes": [], | ||
"javascript": {}, | ||
"json": {}, | ||
"css": {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
crates/biome_js_parser/tests/js_test_suite/ok/many_empty_strings.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
source: crates/biome_js_parser/tests/spec_test.rs | ||
expression: snapshot | ||
snapshot_kind: text | ||
--- | ||
## Input | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.