-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: watch mode for patterns test #298
Merged
Merged
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
24535a7
feature: watch mode for patterns test
Ashu999 a4eae62
Merge branch 'main' of
Ashu999 3d6bd31
feat: re-run pattern test for changed/affected patterns only
Ashu999 d51ba5e
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 44fcd31
refactor: ignore watch mode on external libs and sepraton of concerns…
Ashu999 d5e0459
handle case when reading patterns from single yaml file
Ashu999 0a2fb53
watch mode made efficient and handled patten delete case
Ashu999 d63cfc6
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 d862cc8
remove clone() usage where possible
Ashu999 62ebf75
snapshot test update for yaml__tests__gets_module_patterns
Ashu999 266c58b
applied clippy fix
Ashu999 62ec2d3
improved code quality of watch mode functions
Ashu999 f8c4a32
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 472d374
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 d91a1f5
simplified code
Ashu999 ed2f881
added integration test for: patterns test --watch
Ashu999 a7968f7
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 5f26579
using temp directory for watch mode test
Ashu999 8df9a94
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 e73e73c
using get_fixture for temp directory setup
Ashu999 e28388d
watch mode logs minor fix
Ashu999 00d4119
added test for watch mode case when all patterns are removed
Ashu999 1ca1a43
avoid clone() and unwrap() where possible
Ashu999 7884371
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 5895757
use get_test_process_cmd() to get base command
Ashu999 43dc81e
Merge branch 'main' of https://github.com/getgrit/gritql into main-wa…
Ashu999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,82 @@ | ||
# this file is used for integration testing of `grit patterns test --watch` | ||
version: 0.0.1 | ||
patterns: | ||
- name: github.com/getgrit/stdlib#* | ||
- name: our_cargo_use_long_dependency | ||
level: error | ||
body: | | ||
language toml | ||
|
||
cargo_use_long_dependency() where $filename <: not includes or { | ||
"language-submodules", | ||
"language-metavariables" | ||
} | ||
- name: cargo_use_long_dependency | ||
level: error | ||
body: | | ||
language toml | ||
|
||
`[dependencies] | ||
$deps` where { | ||
$filename <: or { includes "Cargo.toml", includes "cargo.toml" }, | ||
$deps <: some bubble `$name = $version` where { | ||
$version <: string(), | ||
$version => `{ version = $version }`, | ||
} | ||
} | ||
- name: no_treesitter_in_grit_crates | ||
description: | | ||
The `grit-pattern-matcher` and `grit-util` crates should remain free of | ||
TreeSitter dependencies. This also implies they cannot have dependencies on any | ||
of the `marzano-*` crates, since those *can* have TreeSitter dependencies. | ||
level: error | ||
body: | | ||
language toml | ||
|
||
`[dependencies] | ||
$deps` where { | ||
$filename <: or { includes "Cargo.toml", includes "cargo.toml" }, | ||
$absolute_filename <: or { | ||
includes "crates/grit-pattern-matcher", | ||
includes "crates/grit-util" | ||
}, | ||
$deps <: some bubble `$name = $specifier` where $name <: or { | ||
includes "tree_sitter", | ||
includes "tree-sitter", | ||
includes "marzano" | ||
} | ||
} | ||
- name: no_println_in_lsp | ||
description: Don't use println!() in LSP code, it breaks the LSP stdio protocol. | ||
level: error | ||
body: | | ||
engine marzano(0.1) | ||
language rust | ||
|
||
`println!($_)` => . where { | ||
$filename <: not includes "test.rs", | ||
$absolute_filename <: includes "lsp", | ||
} | ||
- name: no_println_in_core | ||
description: Don't use println or other debugging macros in core code. | ||
level: error | ||
body: | | ||
engine marzano(0.1) | ||
language rust | ||
|
||
`println!($args)` as $print where { | ||
$outcome = ., | ||
or { | ||
$absolute_filename <: includes "crates/core", | ||
$absolute_filename <: includes "crates/gritmodule", | ||
$absolute_filename <: includes "crates/util", | ||
and { $absolute_filename <: includes "crates/cli/", $outcome = `log::info!($args)` } | ||
}, | ||
// Allow tests and build utils | ||
$absolute_filename <: not includes or { | ||
"tests/", | ||
"build.rs", | ||
"test" | ||
}, | ||
$print <: not within `mod tests { $_ }` | ||
} => $outcome |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't invent a new way to do integration tests. We already have fixtures and existing conventions. Look at them and follow that.