Skip to content

Commit 09ab14b

Browse files
authored
chore: some general housekeeping (#690)
1 parent 9621913 commit 09ab14b

5 files changed

Lines changed: 39 additions & 13 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
IMPORTANT!!
3+
If you generated this PR with the help of any AI assistance, please disclose it in the PR.
4+
-->
5+
6+
<!--
7+
Thanks for submitting a Pull Request! We appreciate you spending the time to work on these changes.
8+
Please provide enough information so that others can review your PR.
9+
Learn more about contributing: https://github.com/biomejs/gritql/blob/main/CONTRIBUTING.md
10+
-->
11+
12+
## Summary
13+
14+
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve?-->
15+
16+
<!-- Link any relevant issues if necessary or include a transcript of any Discord discussion. -->
17+
18+
## Test Plan
19+
20+
<!-- What demonstrates that your implementation is correct? -->
21+
22+
## Docs
23+
24+
<!-- Make sure to update the documentation with relevant new or updated information -->

CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A high-level overview of tools you need to have installed:
1616
- Yarn package manager. You'll need [`yarn`](https://classic.yarnpkg.com/en/docs/install) (classic). Install v1.22.19 with `npm install --global yarn`.
1717
- Tree-Sitter CLI: provides [`tree-sitter`](https://github.com/tree-sitter/tree-sitter/tree/master/cli) binary for testing grammars. Install v0.22.2 with `npm install --global tree-sitter-cli`.
1818
- Terraform CLI. Install [`terraform`](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli) with `brew tap hashicorp/tap && brew install hashicorp/tap/terraform`.
19-
- For snapshot testing review, you should install the cargo insta plugin: `curl -LsSf https://insta.rs/install.sh | sh` (https://insta.rs/docs/cli/)
19+
- For snapshot testing review, you should install the cargo insta plugin: `curl -LsSf https://insta.rs/install.sh | sh` (<https://insta.rs/docs/cli/>)
2020

2121
## Building the Code
2222

@@ -63,13 +63,13 @@ After making your changes, run the [./resources/edit_grammars.mjs](./resources/e
6363

6464
For example:
6565

66-
```
66+
```sh
6767
node ./resources/edit_grammars.mjs yaml
6868
```
6969

7070
### Snippet contexts
7171

72-
Snippet contexts help when a snippet is a valid AST subtree, but needs to be in a larger tree to parse. For example, matching on a table name like ` $schema.$table` in SQL is not valid SQL by itself, only when surrounded by something like `SELECT x from $schema.$table` is the snippet valid.
72+
Snippet contexts help when a snippet is a valid AST subtree, but needs to be in a larger tree to parse. For example, matching on a table name like `$schema.$table` in SQL is not valid SQL by itself, only when surrounded by something like `SELECT x from $schema.$table` is the snippet valid.
7373

7474
Snippet contexts are defined by implementing the `snippet_context_strings` method in the `Language` trait. This method returns a list of strings that are used to match the snippet in the larger tree. For example, the SQL implementation returns `["SELECT 1 from ", ";"]` to match a table name in a SQL query.
7575

@@ -100,9 +100,9 @@ These steps are done in our cloud environment and are not necessary for contribu
100100

101101
- grep for an existing language like `Sol` for solidity, and add it to all the `Language` enums you find.
102102
- Add the language to `apps/web/src/views/project/details.tsx`, so repos with this language don’t get an “unsupported language” warning. (5 minutes)
103-
- LSP target languages list: https://github.com/getgrit/rewriter/pull/7734/files#diff-f9d4f097b08d33241c5c8d15a2fbde0e37086c265ce0eba8decac20d5cd989c6R23
104-
- VS Code client list: https://github.com/getgrit/rewriter/blob/f992490394a4807789504f1cea6a04b934ad3b24/apps/poolish/src/lsp-client.ts
105-
- VS Code command palette triggers: https://github.com/getgrit/rewriter/pull/7734/files#diff-b38f1d6304993a250903310722206e6c89c58c52c2d1bd4b6fdd8f7218810570R103
103+
- LSP target languages list: <https://github.com/getgrit/rewriter/pull/7734/files#diff-f9d4f097b08d33241c5c8d15a2fbde0e37086c265ce0eba8decac20d5cd989c6R23>
104+
- VS Code client list: <https://github.com/getgrit/rewriter/blob/f992490394a4807789504f1cea6a04b934ad3b24/apps/poolish/src/lsp-client.ts>
105+
- VS Code command palette triggers: <https://github.com/getgrit/rewriter/pull/7734/files#diff-b38f1d6304993a250903310722206e6c89c58c52c2d1bd4b6fdd8f7218810570R103>
106106
- There are also `exhaustive` runtime checks that error if a switch case doesn’t handle a language, like `makeSingleLineComment`. Search for `exhaustive(lang` and fill those out too.
107107
- Regenerate both DB/prisma types to add it to the DB schema and GraphQL types.
108108
- Add the language to `language-selector.tsx`. Pick an icon from [https://react-icons.github.io](https://react-icons.github.io/), usually from the Simple Icons category.

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MIT License
22

3-
Copyright (c) 2024 Iuvo AI, Inc.
3+
Copyright (c) 2024-2025 Iuvo AI, Inc.
4+
Copyright (c) 2025-present Biome Developers and Contributors.
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,27 @@ Read the [documentation](https://docs.grit.io/language/overview), [interactive t
3737

3838
Install the Grit CLI:
3939

40-
```
40+
```sh
4141
curl -fsSL https://docs.grit.io/install | bash
4242
```
4343

4444
### Usage
4545

4646
Search for all your `console.log` calls by putting the desired pattern in backticks:
4747

48-
```
48+
```sh
4949
grit apply '`console.log($_)`'
5050
```
5151

5252
Replace `console.log` with `winston.log`, using `=>` to create rewrites:
5353

54-
```
54+
```sh
5555
grit apply '`console.log($msg)` => `winston.log($msg)`'
5656
```
5757

5858
Save the pattern to a [`grit.yaml`](https://docs.grit.io/guides/config) file and exclude test cases in a where clause:
5959

60-
```
60+
```sh
6161
cat << 'EOF' > .grit/grit.yaml
6262
patterns:
6363
- name: use_winston
@@ -72,7 +72,7 @@ grit apply use_winston
7272

7373
Run `grit check` to enforce your patterns as [custom lints](https://docs.grit.io/guides/ci).
7474

75-
```
75+
```sh
7676
grit check
7777
```
7878

@@ -107,13 +107,15 @@ GritQL comes from our experiences with conducting large scale refactors and migr
107107
Usually, migrations start with exploratory work to figure out the scope of the problem—often using simple grep searches. These are easy to start with, but most migrations end up accumulating additional requirements like ensuring the right packages are imported and excluding cases which don’t have a viable migration path.
108108

109109
Eventually, any complex migration ends up being a full codemod program written with a tool like [jscodeshift](https://github.com/facebook/jscodeshift). This comes with its own problems:
110+
110111
- Most of the exploratory work has to be abandoned as you figure out how to represent your original regex search as an AST.
111112
- Reading/writing a codemod requires mentally translating from AST names back to what source code actually looks like.
112113
- Most frameworks are not composable, so you’re stuck copying patterns back and forth.
113114
- Performance is often an afterthought, so iterating on a large codemod can be painfully slow.
114115
- Codemod frameworks are language-specific, so if you’re hopping between multiple languages—or trying to migrate a shared API—you have to learn different frameworks.
115116

116117
GritQL is our attempt to develop a powerful middle ground:
118+
117119
- Exploratory analysis is easy: just put a code snippet in backticks and use `$metavariables` for holes you want to represent.
118120
- Incrementally add complexity by introducing side conditions with where clauses.
119121
- Reuse named patterns to avoid rebuilding queries, and use shared patterns from our [standard library](https://github.com/getgrit/stdlib) for common tasks like ensuring modules are imported.

0 commit comments

Comments
 (0)