Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

chore: add contributor guide #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contributor Guide

## Getting started

Make sure you have the Grit CLI installed:

```sh
npm install -g @getgrit/launcher
```

To propose changes, fork this repository and open a pull request.

## Adding a new pattern

All patterns require at least one sample validating the functionality. As a result, the best way to develop a
GritQL pattern is often by starting with before and after sample(s) of the code to be transformed. You can
iterate in the [GritQL studio](https://app.grit.io/studio) to develop your pattern.

Once you have a pattern, you can add it to the repository by creating a new `.md` file in the `.grit/patterns`
directory. The file name should be the snake-cased name of the pattern. Keep the file name short and
descriptive, and add a concise description as well as any relevant tags. All PRs must contain at least
one sample of before/after code with a descriptive name.

## Testing

Samples can be tested locally using the Grit CLI.

```sh
grit patterns test
```

Once you have your sample(s) passing locally, creating a PR will automatically trigger a CI build running the same tests in a range of environments.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# JSON Grit Patterns

This repository contains curated Grit patterns for JSON.

## License

This repository is licensed exclusively for usage with the Grit tool.
All rights reserved.

## Contributing

We welcome contributions from the community. Please see the [contributing guide](CONTRIBUTING.md) for more information.
Loading