Skip to content
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

added .env.example and an optional disable option for ChatGPT #19

Merged
merged 1 commit into from
Feb 8, 2023
Merged
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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OPENAI_API_KEY=
OPENAI_ENABLED=true
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Usage](#usage)
- [Example Reports](#example-reports)
- [Installation](#installation)
- [ChatGPT](#chatgpt)
- [Contributing](#contributing)

## Usage
Expand Down Expand Up @@ -46,9 +47,17 @@ You'll need [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/). The
```bash
yarn
```

You're all set!

## ChatGPT
Please copy the `.env.example` file to `.env` and fill out the details if you have a ChatGPT API key. You can also set the API key as an environment variable.
```bash
cp .env.example .env
```
If you want to disable ChatGPT while testing other implementations, you can set `OPENAI_ENABLED=false`.



## Contributing

You're more than welcome to contribute! For help you can check [CONTRIBUTING.md](CONTRIBUTING.md)
2 changes: 1 addition & 1 deletion src/typos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const checkTypos = async (files: InputType): Promise<{ issue: Issue; instances:
let instances: Instance[] = [];

/** Typo checking */
if (!!process.env.OPENAI_API_KEY) {
if (!!process.env.OPENAI_API_KEY && process.env.OPENAI_ENABLED !== 'false') {
for (const file of files) {
/** Cut file in 100 lines blocks */
const lines: { line: string; index: number }[] = file?.content
Expand Down