Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 27c1499

Browse files
✨ feat(commit-message): add pre-commit hook for ChatGPT commit message (#1)
## 💌 Description This commit adds a pre-commit hook for ChatGPT commit message in the `chatgpt_pre_commit_hooks` package. The hook is implemented in the `chatgpt_commit_message.py` module. The hook checks if the commit message follows the Conventional Commits convention and suggests a clean commit message in the GitMoji convention. The commit message is pre-pended with the UNICODE character format of GitMoji. The commit message also includes a short description of why these changes were made. The commit also includes various configuration files, templates, and workflows for GitHub, including `.editorconfig`, `.flake8`, `.gitattributes`, `.github/CODEOWNERS`, `.github/ISSUE_TEMPLATE/config.yml`, `.github/ISSUE_TEMPLATE/template.bug.yml`, `.github/ISSUE_TEMPLATE/template.feature_request.yml`, `.github/ISSUE_TEMPLATE/template.question.yml`, `.github/PULL_REQUEST_TEMPLATE.md`, `.github/dependabot.yml`, `.github/release-drafter.yml`, `.github/stale.yml`, `.github/workflows/reuse.ghdiag.yml`, `.github/workflows/workflow.ci.yml`, `.github/workflows/workflow.release.draft.yml`, `.github/workflows/workflow.release.yml`, `.gitignore`, `.pre-commit-config.yaml`, `.pre-commit-hooks.yaml`, `.python-version`, `.vscode/extensions.json`, `.vscode/settings.json`, `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, `README.md`, `docs/chatgpt_commit_message.md`, and `pyproject.toml`. ## 🩹 Related issue N/A ## 🏗️ Type of change <!-- Mark with an `x` all the checkboxes that apply (like `[x]`) --> - [ ] 📚 Examples / docs / tutorials / dependencies update - [ ] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] 🥂 Improvement (non-breaking change which improves an existing feature) - [ ] 🚀 New feature (non-breaking change which adds functionality) - [x] 💥 Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🔐 Security fix - [ ] ⬆️ Dependencies update ## ✅ Checklist <!-- Mark with an `x` all the checkboxes that apply (like `[x]`) --> - [x] I've read the [`CODE_OF_CONDUCT.md`](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/blob/main/CODE_OF_CONDUCT.md) document. - [x] I've read the [`CONTRIBUTING.md`](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/blob/main/CONTRIBUTING.md) guide. - [ ] I've written tests for all new methods and classes that I created. - [x] I've written the docstring in Google format for all the methods and classes that I used.
1 parent 0da8df3 commit 27c1499

29 files changed

Lines changed: 1883 additions & 2 deletions

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = tab
8+
indent_size = 2
9+
trim_trailing_whitespace = true
10+
11+
[*.{cmd,bat}]
12+
end_of_line = crlf
13+
14+
[*.{yml,yaml,md}]
15+
indent_style = space
16+
17+
[*.{py,pyi}]
18+
indent_style = space
19+
indent_size = 4

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 180
3+
exclude = .git,__pycache__,.tox,.eggs,*.egg,.venv

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto eol=lf
3+
4+
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
5+
# in Windows via a file share from Linux, the scripts will work.
6+
*.{cmd,[cC][mM][dD]} text eol=crlf
7+
*.{bat,[bB][aA][tT]} text eol=crlf
8+
9+
# Force bash scripts to always use LF line endings so that if a repo is accessed
10+
# in Unix via a file share from Windows, the scripts will work.
11+
*.sh text eol=lf
12+
13+
# Common files config
14+
*.jpg -text
15+
*.png -text
16+
*.pdf -text

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default reviewers/codeowners for all code changes in the repository
2+
* @DariuszPorowski

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2+
blank_issues_enabled: false
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
3+
name: 🐛 Bug Report
4+
description: If something isn't working 🔧
5+
title: "[bug]: "
6+
labels: [bug]
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: Thanks for taking the time to fill out this bug report!
11+
- type: textarea
12+
id: what-happened
13+
attributes:
14+
label: 🐛 What happened?
15+
description: A clear and concise description of what the bug is.
16+
placeholder: Describe what happened
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: reproduce
21+
attributes:
22+
label: 🔬 How to reproduce?
23+
description: Steps to reproduce the behavior.
24+
placeholder: |
25+
1. ...
26+
2. ...
27+
validations:
28+
required: false
29+
- type: textarea
30+
id: code-sample
31+
attributes:
32+
label: 🏗️ Code Sample / Log
33+
description: Please copy and paste any relevant code sample / log output.
34+
render: Shell
35+
placeholder: This will be automatically formatted into code, so no need for backticks.
36+
validations:
37+
required: false
38+
- type: input
39+
id: chatgpt-pre-commit-hooks
40+
attributes:
41+
label: 🌌 Environment (ChatGPT / OpenAI pre-commit-hooks)
42+
description: What ChatGPT / OpenAI pre-commit-hooks version are you running?
43+
placeholder: 0.0.1
44+
validations:
45+
required: true
46+
- type: input
47+
id: python
48+
attributes:
49+
label: 🌌 Environment (pre-commit)
50+
description: "What pre-commit version are you running? Get it with: `pre-commit --version`"
51+
placeholder: 3.2.2
52+
validations:
53+
required: true
54+
- type: input
55+
id: python
56+
attributes:
57+
label: 🌌 Environment (Python)
58+
description: "What python version are you running? Get it with: `python --version`"
59+
placeholder: 3.10.10
60+
validations:
61+
required: true
62+
- type: dropdown
63+
id: os
64+
attributes:
65+
label: 🌌 Environment (OS)
66+
description: What OS are you running?
67+
options:
68+
- Linux
69+
- Windows
70+
- macOS
71+
validations:
72+
required: true
73+
- type: textarea
74+
id: screenshots
75+
attributes:
76+
label: 📷 Screenshots
77+
description: If applicable, add screenshots to help explain your problem.
78+
placeholder: Just do Ctrl+V having screenshot in the clipboard.
79+
validations:
80+
required: false
81+
- type: textarea
82+
id: expected-behavior
83+
attributes:
84+
label: 📈 Expected behavior
85+
description: A clear and concise description of what you expected to happen.
86+
placeholder: A clear and concise description of what you expected to happen.
87+
validations:
88+
required: false
89+
- type: textarea
90+
id: additional-context
91+
attributes:
92+
label: 📎 Additional context
93+
description: Add any other context about the problem here.
94+
placeholder: Add any other context about the problem here.
95+
validations:
96+
required: false
97+
- type: checkboxes
98+
id: terms
99+
attributes:
100+
label: 📜 Code of Conduct
101+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/blob/main/CODE_OF_CONDUCT.md)
102+
options:
103+
- label: I agree to follow this project's Code of Conduct.
104+
required: true
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
3+
name: 🚀 Feature request
4+
description: Suggest an idea for this project 🏖
5+
title: "[feature]: "
6+
labels: [enhancement]
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: Thanks for taking the time to fill out this new feature idea!
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: 🚀 Feature description
15+
description: A clear and concise description of the feature proposal.
16+
placeholder: A clear and concise description of the feature proposal.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: motivation
21+
attributes:
22+
label: 🔈 Motivation
23+
description: Please describe the motivation for this proposal.
24+
placeholder: Please describe the motivation for this proposal.
25+
validations:
26+
required: false
27+
- type: textarea
28+
id: alternatives
29+
attributes:
30+
label: 🛰 Alternatives
31+
description: A clear and concise description of any alternative solutions or features you've considered.
32+
placeholder: A clear and concise description of any alternative solutions or features you've considered.
33+
validations:
34+
required: false
35+
- type: textarea
36+
id: additional-context
37+
attributes:
38+
label: 📎 Additional context
39+
description: Add any other context or screenshots about the feature request here.
40+
placeholder: Add any other context or screenshots about the feature request here.
41+
validations:
42+
required: false
43+
- type: checkboxes
44+
id: terms
45+
attributes:
46+
label: 📜 Code of Conduct
47+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/blob/main/CODE_OF_CONDUCT.md)
48+
options:
49+
- label: I agree to follow this project's Code of Conduct.
50+
required: true
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
3+
name: ❓ Question
4+
description: Ask a question about this project 🎓
5+
title: "[question]: "
6+
labels: [question]
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: Thanks for taking the time to fill out this new feature idea!
11+
- type: checkboxes
12+
id: checklist
13+
attributes:
14+
label: ✅ Checklist
15+
description: Mark with an ✔️ all the checkboxes that apply.
16+
options:
17+
- label: I've searched the project's [`issues`](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/issues?q=is%3Aissue) and did not find answer for my question.
18+
required: true
19+
- type: textarea
20+
id: question
21+
attributes:
22+
label: ❓ Question
23+
description: What is your question?
24+
placeholder: |
25+
How can I ...?
26+
Is it possible to ...?
27+
validations:
28+
required: true
29+
- type: textarea
30+
id: additional-context
31+
attributes:
32+
label: 📎 Additional context
33+
description: Add any other context or screenshots about the question here.
34+
placeholder: Add any other context or screenshots about the question here.
35+
validations:
36+
required: false
37+
- type: checkboxes
38+
id: terms
39+
attributes:
40+
label: 📜 Code of Conduct
41+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/blob/main/CODE_OF_CONDUCT.md)
42+
options:
43+
- label: I agree to follow this project's Code of Conduct.
44+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## 💌 Description
2+
3+
<!-- Add a more detailed description of the changes if needed. -->
4+
5+
## 🩹 Related issue
6+
7+
<!-- If your PR refers to a related issue, link it here. -->
8+
Fixes: #
9+
10+
## 🏗️ Type of change
11+
12+
<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->
13+
14+
- [ ] 📚 Examples / docs / tutorials / dependencies update
15+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
16+
- [ ] 🥂 Improvement (non-breaking change which improves an existing feature)
17+
- [ ] 🚀 New feature (non-breaking change which adds functionality)
18+
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change)
19+
- [ ] 🔐 Security fix
20+
- [ ] ⬆️ Dependencies update
21+
22+
## ✅ Checklist
23+
24+
<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->
25+
26+
- [ ] I've read the [`CODE_OF_CONDUCT.md`](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/blob/main/CODE_OF_CONDUCT.md) document.
27+
- [ ] I've read the [`CONTRIBUTING.md`](https://github.com/DariuszPorowski/chatgpt-pre-commit-hooks/blob/main/CONTRIBUTING.md) guide.
28+
- [ ] I've written tests for all new methods and classes that I created.
29+
- [ ] I've written the docstring in Google format for all the methods and classes that I used.

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Please see the documentation for all configuration options:
2+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: pip
7+
directory: /
8+
schedule:
9+
interval: weekly
10+
commit-message:
11+
prefix: "[pip] :arrow_up: "
12+
prefix-development: "[pip dev] :arrow_up: "
13+
include: scope
14+
15+
- package-ecosystem: github-actions
16+
directory: /
17+
schedule:
18+
interval: weekly
19+
commit-message:
20+
prefix: "[github-actions] :arrow_up: "

0 commit comments

Comments
 (0)