Get a PR before the PR with PreFlight. It's quick and easy to setup, and uses Greptile to run checks on your code, and provide you with suggestions to improve it!
- Obtain a GitHub PAT token from your GitHub account.
- Get a Greptile API key
- Add the PAT token and Greptile API key to your environment variables.
- Set
OWNERvariable insrc/constantsfile as your GitHub username! (One day this app would hopefully let you sign in and have this all happen automatically) - Run the magic command to get a local version running (you likely already know this):
npm run devOne more thing: I added functionality that displays a random fact during the intial suggestion load. This isn't necessary, but if you do want to replicate this you'll need an API key from API Ninjas: https://api-ninjas.com/api/facts (for the sake of having the code run easily, you can just keep that API key empty. There will be an error in your console... but it shouldn't break anything.)
Simply type in your repository name and which branch you want to index. PreFlight will connect your repository to Greptile, and will let you know once it's complete (takes a few minutes max).
(If you are running into issues connecting your repo, look into the FAQ section below)
Once your repo is connected, you will get a list of suggestions that PreFlight has for your code. You can click on each suggestion to see a recommendation to fix it provided by Greptile. Once you have pushed your code, you can simply click "Re-Review" to get more feedback.
(Non-exhaustive list, but just some ideas off the top of my head!)
- Sign in with GitHub
- Better suggestion triaging (some issues aren't extremely important and won't really get changed- I'd want to add in a feature that allows a user to ignore a suggestion, or get past it)
- GitHub Copilot (to help with things like coming up with box shadows, or other small things that I don't have memorized)
- ChatGPT (it's basically my replacement for Google, so any small questions I had about state issues I was having or anything of the sort were asked there)
- No part of the code was done exclusively with AI, everything was done by a human (myself)
-
Why is my repo not connecting?
- Make sure you have the correct permissions to access the repository.
- Make sure you have the correct branch name.
- Make sure you have the correct owner name.
- Make sure you have the correct GitHub PAT token and Greptile API key.
- Make sure you have the correct environment variables set up.
-
How do I get a GitHub PAT token?
- Go to your GitHub account settings, and click on Developer Settings.
- Click on Personal Access Tokens, and generate a new token.
- Make sure you have the correct permissions to access the repository.
-
How do I get a Greptile API key?
- Go to the Greptile website and sign up for an account.
- Once you have an account, you can generate an API key.
- Make sure you have the correct permissions to access the repository.