Skip to content

Commit

Permalink
feat: improve patterns list/test output
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Mar 23, 2024
1 parent cf59ebf commit 5ae9bfc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion crates/cli/src/commands/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ pub(crate) async fn run_plumbing(
)
})?;

let libs = get_grit_files_from(None).await?;
let cwd = std::env::current_dir()?;
let libs = get_grit_files_from(Some(cwd)).await?;
get_marzano_pattern_test_results(
patterns,
&libs,
Expand Down
1 change: 0 additions & 1 deletion crates/gritmodule/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ pub struct ResolvedGritDefinition {
pub local_name: String,
pub body: String,
pub kind: DefinitionKind,
#[serde(skip)]
pub language: PatternLanguage,
pub visibility: PatternVisibility,
}
Expand Down
1 change: 1 addition & 0 deletions crates/language/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tree-sitter-sql = { path = "../../resources/language-metavariables/tree-sitter-s
tree-sitter-vue = { path = "../../resources/language-metavariables/tree-sitter-vue", optional = true }
tree-sitter-toml = { path = "../../resources/language-metavariables/tree-sitter-toml", optional = true }
serde_json = { version = "1.0.91", features = ["preserve_order"] }
serde = { version = "1.0.91", features = ["derive"] }
marzano-util = { path = "../util" }
regex = "1.7.1"
anyhow = "1.0.70"
Expand Down
4 changes: 3 additions & 1 deletion crates/language/src/target_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::{
};
use anyhow::Result;
use enum_dispatch::enum_dispatch;
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
use std::fmt;
use std::hash::Hash;
Expand All @@ -42,7 +43,8 @@ use std::path::PathBuf;
#[cfg(feature = "finder")]
use std::str::FromStr;

#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum PatternLanguage {
JavaScript,
TypeScript,
Expand Down

0 comments on commit 5ae9bfc

Please sign in to comment.