Skip to content

Commit

Permalink
Merge pull request #8 from aiFdn/sharkar/update-gpt-models
Browse files Browse the repository at this point in the history
Update build script, dependencies, and default model
  • Loading branch information
SHSharkar authored Jun 30, 2024
2 parents bc1b82b + 6935b51 commit 500ffb1
Show file tree
Hide file tree
Showing 10 changed files with 19,421 additions and 14,095 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ GW_OPENAI_MAX_TOKENS=<max response tokens from OpenAI API>
GW_OPENAI_BASE_PATH=<may be used to set proxy path to OpenAI API>
GW_DESCRIPTION=<postface a message with ~3 sentences description of the changes>
GW_EMOJI=<boolean, add GitMoji>
GW_MODEL=<either 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4', 'gpt-4-0613', 'gpt-4-0314', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-0301'>
GW_MODEL=<either 'gpt-4o','gpt-4-turbo','gpt-4-turbo-preview','gpt-4-0125-preview','gpt-4-1106-preview','gpt-4','gpt-3.5-turbo-0125','gpt-3.5-turbo','gpt-3.5-turbo-1106'>
GW_LANGUAGE=<locale, scroll to the bottom to see options>
GW_MESSAGE_TEMPLATE_PLACEHOLDER=<message template placeholder, default: '$msg'>
GW_PROMPT_MODULE=<either conventional-commit or @commitlint, default: conventional-commit>
Expand Down Expand Up @@ -160,7 +160,7 @@ Effortlessly apply settings across all repositories with GitWiz's global configu

### Switching Models: Flexibility at Your Fingertips

- **Default Model**: GitWiz starts with `gpt-3.5-turbo-1106`.
- **Default Model**: GitWiz starts with `gpt-4o`.
- **Upgrade to GPT-4**: For superior performance (note the higher cost):

```sh
Expand Down Expand Up @@ -218,24 +218,24 @@ GitWiz offers the flexibility to choose your preferred style for generating comm
### Integrating `@commitlint` with GitWiz

- **Automatic Integration**:
The first time you run GitWiz with `GW_PROMPT_MODULE` set to `@commitlint`, the tool will automatically configure the integration.
The first time you run GitWiz with `GW_PROMPT_MODULE` set to `@commitlint`, the tool will automatically configure the integration.

- **Manual Configuration**:
If you need to force reset or set the `@commitlint` configuration, use the command:
If you need to force reset or set the `@commitlint` configuration, use the command:

```sh
gw commitlint force
```

- **Viewing Current Configuration**:
To check your current `@commitlint` configuration, utilize:
To check your current `@commitlint` configuration, utilize:

```sh
gw commitlint get
```

- **Customization with `.gitwz-commitlint`**:
GitWiz creates a `.gitwz-commitlint` file in your project directory. This file contains the prompts used for the local `@commitlint` configuration, and you can edit it to fine-tune the generated commit messages according to your project's guidelines.
GitWiz creates a `.gitwz-commitlint` file in your project directory. This file contains the prompts used for the local `@commitlint` configuration, and you can edit it to fine-tune the generated commit messages according to your project's guidelines.
### Why Choose `@commitlint`?
Expand All @@ -248,10 +248,10 @@ The `gitwz` or `gwz` commands are designed to seamlessly integrate with your exi
### Seamless Integration with Git Commit Flags
- **Command Equivalence**:
When you use `gitwz` or `gwz`, it acts as a direct substitute for the `git commit -m` command, incorporating the generated message automatically.
When you use `gitwz` or `gwz`, it acts as a direct substitute for the `git commit -m` command, incorporating the generated message automatically.
**Example**:
The command:
The command:
```sh
gw --no-verify
Expand All @@ -268,10 +268,10 @@ The `gitwz` or `gwz` commands are designed to seamlessly integrate with your exi
### Advanced Message Customization
- **Template Functionality**:
GitWiz provides a template feature, allowing you to enrich the AI-generated commit message with custom text. This is especially useful for adding contextual information such as issue numbers, tags, or descriptive prefixes.
GitWiz provides a template feature, allowing you to enrich the AI-generated commit message with custom text. This is especially useful for adding contextual information such as issue numbers, tags, or descriptive prefixes.
**Usage**:
To prepend a custom string to your generated message, use the command:
To prepend a custom string to your generated message, use the command:
```sh
gw 'Issue #205: $msg'
Expand All @@ -280,10 +280,10 @@ The `gitwz` or `gwz` commands are designed to seamlessly integrate with your exi
Here, `Issue #205:` is your custom addition, and `$msg` serves as a placeholder for the generated message.

- **Placeholder Configuration**:
GitWiz analyzes placeholders within command parameters, offering flexibility in how your custom text is incorporated. You can define your preferred placeholder format in the GitWiz configuration, which will be recognized and replaced in the commit message.
GitWiz analyzes placeholders within command parameters, offering flexibility in how your custom text is incorporated. You can define your preferred placeholder format in the GitWiz configuration, which will be recognized and replaced in the commit message.

**Example**:
If you set your `GW_MESSAGE_TEMPLATE_PLACEHOLDER` to a simpler form like `$m`, GitWiz will use this new placeholder in processing your commit messages.
If you set your `GW_MESSAGE_TEMPLATE_PLACEHOLDER` to a simpler form like `$m`, GitWiz will use this new placeholder in processing your commit messages.

### Enhancing Your Version Control Practices

Expand Down Expand Up @@ -408,7 +408,7 @@ Automate commit message enhancement with GitWiz, now available as a GitHub Actio
GW_OPENAI_BASE_PATH: ''
GW_DESCRIPTION: false
GW_EMOJI: false
GW_MODEL: gpt-3.5-turbo-1106
GW_MODEL: gpt-4o
GW_LANGUAGE: en
GW_PROMPT_MODULE: conventional-commit
```
Expand All @@ -425,8 +425,7 @@ Automate commit message enhancement with GitWiz, now available as a GitHub Actio
## **💳 Payments: Transparent and Controlled**
- GitWiz operates on your OpenAI API token, billed directly to you.
- Default model: `gpt-3.5-turbo-1106`. Manage costs while enjoying enhanced capabilities.
- Opt for `gpt-4-0125-preview` for a premium experience.
- Default model: `gpt-4o`. Manage costs while enjoying enhanced capabilities.
## **Credits and Acknowledgements**
Expand Down
69 changes: 69 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import simpleImportSort from "eslint-plugin-simple-import-sort";
import _import from "eslint-plugin-import";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import prettier from "eslint-plugin-prettier";
import { fixupPluginRules } from "@eslint/compat";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
), {
plugins: {
"simple-import-sort": simpleImportSort,
import: fixupPluginRules(_import),
"@typescript-eslint": typescriptEslint,
prettier,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",

parserOptions: {
project: "./tsconfig.json",
},
},

settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},

rules: {
"prettier/prettier": "error",
"no-console": "error",
"import/order": "off",
"sort-imports": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
complexity: ["warn", 10],
"max-depth": ["warn", 4],
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
},
}];
Loading

0 comments on commit 500ffb1

Please sign in to comment.