Skip to content

Commit

Permalink
chore: improve README (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante authored Mar 20, 2024
1 parent 65f72c1 commit 42e07c8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
# GritQL
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/getgrit/gritql/readme-brand/assets/grit-logo-darkmode.png">
<img alt="Grit logo" src="https://raw.githubusercontent.com/getgrit/gritql/readme-brand/assets/grit-logo.png" width="40%">
</picture>
</div>

<br>

<div align="center">

[![CI Status](https://img.shields.io/github/actions/workflow/status/getgrit/gritql/main.yaml)](https://github.com/getgrit/gritql/actions/workflows/main.yaml)
[![MIT License](https://img.shields.io/github/license/getgrit/gritql)](https://github.com/getgrit/gritql/blob/main/LICENSE)
[![Discord](https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord)](https://docs.grit.io/discord)

GritQL is a declarative query language for searching and modifying source code. GritQL focuses on a few areas:
[Playground](https://app.grit.io/studio) |
[Tutorial](https://docs.grit.io/tutorials/gritql) |
[Docs](https://docs.grit.io/language)

</div>

<hr>

GritQL is a declarative query language for searching and modifying source code.

- 📖 Start simply without learning AST details: any code snippet is a valid GritQL query
- ⚡️ Use Rust and query optimization to scale up to 10M+ line repositories
- 📦 Use Grit's built-in module system to reuse 200+ [standard patterns](https://github.com/getgrit/stdlib) or [share your own](https://docs.grit.io/guides/sharing#anchor-publishing-patterns)
- ♻️ Once you learn GritQL, you can use it to rewrite any [target language](https://docs.grit.io/language/target-languages): JavaScript/TypeScript, Python, JSON, Java, Terraform, Solidity, CSS, Markdown, YAML, Rust, Go, or SQL
- 🔧 GritQL makes it easy to include auto-fix rules for faster remediation

Read the [docs](https://docs.grit.io/language) or try any query in the [studio](https://app.grit.io/studio).

## Getting started

Read the [documentation](https://docs.grit.io/language/overview), [interactive tutorial](https://docs.grit.io/tutorials/gritql), or run `grit --help`.
Expand All @@ -28,19 +43,19 @@ curl -fsSL https://docs.grit.io/install | bash

### Usage

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

```
grit apply '`console.log($_)`'
```

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

```
grit apply '`console.log($msg)` => `winston.log($msg)`'
```

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

```
cat << 'EOF' > .grit/grit.yaml
Expand Down
Binary file added assets/grit-logo-darkmode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/grit-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 42e07c8

Please sign in to comment.