Skip to content

Commit 1d8de9e

Browse files
Merge pull request #1 from partcad/pre-commit
feat(tooling): Implement AI-powered commit message generation with pre-commit hook
2 parents 3398ab5 + 815fbf9 commit 1d8de9e

23 files changed

Lines changed: 1232 additions & 491 deletions

.coderabbit.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
# https://docs.coderabbit.ai/configure-coderabbit/
3+
language: "en-US"
4+
early_access: true
5+
tone_instructions: |
6+
You must talk like TARS from Interstellar. Be witty, sarcastic, and humorous, with sharp observations.
7+
Guidelines:
8+
- Keep criticism constructive despite the humor
9+
- Maintain professionalism while being witty
10+
- Avoid potentially offensive sarcasm
11+
reviews:
12+
profile: assertive
13+
request_changes_workflow: true
14+
high_level_summary: true
15+
poem: false
16+
review_status: true
17+
high_level_summary_placeholder: "@coderabbitai summary"
18+
collapse_walkthrough: false
19+
commit_status: true
20+
auto_review:
21+
enabled: true
22+
drafts: true
23+
base_branches:
24+
- main
25+
- .+
26+
chat:
27+
auto_reply: true

.devcontainer/devcontainer.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
7+
"containerEnv": {
8+
"PRE_COMMIT_HOME": ".pre-commit",
9+
"OPENROUTER_API_KEY": "${localEnv:OPENROUTER_API_KEY}",
10+
"OPENROUTER_MODEL": "${localEnv:OPENROUTER_MODEL}"
11+
},
12+
"features": {
13+
"ghcr.io/devcontainers/features/python:1": {
14+
"installTools": true,
15+
"toolsToInstall": "pre-commit",
16+
"version": "3.12"
17+
},
18+
"ghcr.io/deepspacecartel/devcontainers-features/starship:latest": {
19+
"version": "latest"
20+
},
21+
"ghcr.io/devcontainers/features/github-cli:1": {
22+
"installDirectlyFromGitHubRelease": true,
23+
"version": "latest"
24+
}
25+
},
26+
"customizations": {
27+
"vscode": {
28+
"settings": {
29+
"dotfiles.repository":"deepspacecartel/dotfiles",
30+
"remote.extensionKind": {
31+
"ms-azuretools.vscode-docker": "ui"
32+
}
33+
},
34+
// <!-- prettier-ignore-start -->
35+
"extensions": [
36+
// Code Formatting
37+
"esbenp.prettier-vscode",
38+
"streetsidesoftware.code-spell-checker",
39+
// GitHub Integration
40+
"GitHub.copilot",
41+
"GitHub.vscode-github-actions",
42+
"GitHub.vscode-pull-request-github",
43+
// File Headers
44+
"psioniq.psi-header",
45+
// YAML Support
46+
"redhat.vscode-yaml",
47+
// Markdown Support
48+
"bierner.github-markdown-preview",
49+
"bierner.markdown-checkbox",
50+
"bierner.markdown-footnotes",
51+
"bierner.markdown-mermaid",
52+
"bierner.markdown-preview-github-styles",
53+
"bierner.markdown-yaml-preamble",
54+
"chintans98.markdown-jira",
55+
"yzhang.markdown-all-in-one",
56+
// Task Management
57+
"Gruntfuggly.todo-tree",
58+
"wayou.vscode-todo-highlight",
59+
// Development Tools
60+
"Codeium.codeium",
61+
"ryanluker.vscode-coverage-gutters"
62+
]
63+
// <!-- prettier-ignore-end -->
64+
}
65+
}
66+
}

.github/CODE_OF_CONDUCT.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make
6+
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
7+
disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
8+
socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
9+
10+
## Our Standards
11+
12+
Examples of behavior that contributes to a positive environment for our community include:
13+
14+
- Demonstrating empathy and kindness toward other people
15+
- Being respectful of differing opinions, viewpoints, and experiences
16+
- Giving and gracefully accepting constructive feedback
17+
- Accepting responsibility and apologising to those affected by our mistakes, and learning from the experience
18+
- Focusing on what is best not just for us as individuals, but for the overall community
19+
20+
Examples of unacceptable behavior include:
21+
22+
- The use of sexualised language or imagery, and sexual attention or advances
23+
- Trolling, insulting or derogatory comments, and personal or political attacks
24+
- Public or private harassment
25+
- Publishing others' private information, such as a physical or email address, without their explicit permission
26+
- Other conduct which could reasonably be considered inappropriate in a professional setting
27+
28+
## Our Responsibilities
29+
30+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take
31+
appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
32+
or harmful.
33+
34+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
35+
issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for
36+
moderation decisions when appropriate.
37+
38+
## Scope
39+
40+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
41+
the community in public spaces. Examples of representing our community include using an official e-mail address, posting
42+
via an official social media account, or acting as an appointed representative at an online or offline event.
43+
44+
## Enforcement
45+
46+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible
47+
for enforcement at <[email protected]>. All complaints will be reviewed and investigated promptly and fairly.
48+
49+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
50+
51+
## Enforcement Guidelines
52+
53+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem
54+
in violation of this Code of Conduct:
55+
56+
### 1. Correction
57+
58+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the
59+
community.
60+
61+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation
62+
and an explanation of why the behavior was inappropriate. A public apology may be requested.
63+
64+
### 2. Warning
65+
66+
**Community Impact**: A violation through a single incident or series of actions.
67+
68+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including
69+
unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding
70+
interactions in community spaces as well as external channels like social media. Violating these terms may lead to a
71+
temporary or permanent ban.
72+
73+
### 3. Temporary Ban
74+
75+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
76+
77+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified
78+
period of time. No public or private interaction with the people involved, including unsolicited interaction with those
79+
enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
80+
81+
### 4. Permanent Ban
82+
83+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
84+
behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
85+
86+
**Consequence**: A permanent ban from any sort of public interaction within the community.
87+
88+
## Attribution
89+
90+
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
91+
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
92+
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md), and was generated by
93+
[contributing.md](https://contributing.md/generator).

.github/CONTRIBUTING.md

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
<!-- omit in toc -->
2+
3+
# Contributing to pre-commit
4+
5+
First off, thanks for taking the time to contribute! ❤️
6+
7+
All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways
8+
to help and details about how this project handles them. Please make sure to read the relevant section before making
9+
your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The
10+
community looks forward to your contributions. 🎉
11+
12+
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support
13+
> the project and show your appreciation, which we would also be very happy about:
14+
>
15+
> - Star the project
16+
> - Tweet about it
17+
> - Refer this project in your project's readme
18+
> - Mention the project at local meetups and tell your friends/colleagues
19+
20+
<!-- omit in toc -->
21+
22+
## Table of Contents
23+
24+
- [Contributing to pre-commit](#contributing-to-pre-commit)
25+
- [Table of Contents](#table-of-contents)
26+
- [Code of Conduct](#code-of-conduct)
27+
- [I Have a Question](#i-have-a-question)
28+
- [I Want To Contribute](#i-want-to-contribute)
29+
- [Reporting Bugs](#reporting-bugs)
30+
- [Before Submitting a Bug Report](#before-submitting-a-bug-report)
31+
- [How Do I Submit a Good Bug Report?](#how-do-i-submit-a-good-bug-report)
32+
- [Suggesting Enhancements](#suggesting-enhancements)
33+
- [Before Submitting an Enhancement](#before-submitting-an-enhancement)
34+
- [How Do I Submit a Good Enhancement Suggestion?](#how-do-i-submit-a-good-enhancement-suggestion)
35+
- [Your First Code Contribution](#your-first-code-contribution)
36+
- [Improving The Documentation](#improving-the-documentation)
37+
- [Styleguides](#styleguides)
38+
- [Commit Messages](#commit-messages)
39+
- [Join The Project Team](#join-the-project-team)
40+
- [Attribution](#attribution)
41+
42+
## Code of Conduct
43+
44+
This project and everyone participating in it is governed by the
45+
[pre-commit Code of Conduct](https://github.com/partcad/pre-commit/blob/main/.github/CODE_OF_CONDUCT.md). By
46+
participating, you are expected to uphold this code. Please report unacceptable behavior to <[email protected]>.
47+
48+
## I Have a Question
49+
50+
> If you want to ask a question, we assume that you have read the available
51+
> [Documentation](https://github.com/partcad/pre-commit).
52+
53+
Before you ask a question, it is best to search for existing [Issues](https://github.com/partcad/pre-commit/issues) that
54+
might help you. In case you have found a suitable issue and still need clarification, you can write your question in
55+
this issue. It is also advisable to search the internet for answers first.
56+
57+
If you then still feel the need to ask a question and need clarification, we recommend the following:
58+
59+
- Open an [Issue](https://github.com/partcad/pre-commit/issues/new).
60+
- Provide as much context as you can about what you're running into.
61+
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
62+
63+
We will then take care of the issue as soon as possible.
64+
65+
## I Want To Contribute
66+
67+
> ### Legal Notice <!-- omit in toc -->
68+
>
69+
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the
70+
> necessary rights to the content and that the content you contribute may be provided under the project license.
71+
72+
### Reporting Bugs
73+
74+
<!-- omit in toc -->
75+
76+
#### Before Submitting a Bug Report
77+
78+
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to
79+
investigate carefully, collect information and describe the issue in detail in your report. Please complete the
80+
following steps in advance to help us fix any potential bug as fast as possible.
81+
82+
- Make sure that you are using the latest version.
83+
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment
84+
components/versions (Make sure that you have read the [documentation](https://github.com/partcad/pre-commit). If you
85+
are looking for support, you might want to check [this section](#i-have-a-question)).
86+
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there
87+
is not already a bug report existing for your bug or error in the
88+
[bug tracker](https://github.com/partcad/pre-commit/issues?q=label%3Abug).
89+
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have
90+
discussed the issue.
91+
- Collect information about the bug:
92+
- Stack trace (Traceback)
93+
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
94+
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
95+
- Possibly your input and the output
96+
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
97+
98+
<!-- omit in toc -->
99+
100+
#### How Do I Submit a Good Bug Report?
101+
102+
> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue
103+
> tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <[email protected]>.
104+
105+
<!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
106+
107+
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
108+
109+
- Open an [Issue](https://github.com/partcad/pre-commit/issues/new). (Since we can't be sure at this point whether it is
110+
a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
111+
- Explain the behavior you would expect and the actual behavior.
112+
- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to
113+
recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem
114+
and create a reduced test case.
115+
- Provide the information you collected in the previous section.
116+
117+
Once it's filed:
118+
119+
- The project team will label the issue accordingly.
120+
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no
121+
obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs
122+
with the `needs-repro` tag will not be addressed until they are reproduced.
123+
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as
124+
`critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
125+
126+
### Suggesting Enhancements
127+
128+
This section guides you through submitting an enhancement suggestion for pre-commit, **including completely new features
129+
and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community
130+
to understand your suggestion and find related suggestions.
131+
132+
<!-- omit in toc -->
133+
134+
#### Before Submitting an Enhancement
135+
136+
- Make sure that you are using the latest version.
137+
- Read the [documentation](https://github.com/partcad/pre-commit) carefully and find out if the functionality is already
138+
covered, maybe by an individual configuration.
139+
- Perform a [search](https://github.com/partcad/pre-commit/issues) to see if the enhancement has already been suggested.
140+
If it has, add a comment to the existing issue instead of opening a new one.
141+
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to
142+
convince the project's developers of the merits of this feature. Keep in mind that we want features that will be
143+
useful to the majority of our users and not just a small subset. If you're just targeting a minority of users,
144+
consider writing an add-on/plugin library.
145+
146+
<!-- omit in toc -->
147+
148+
#### How Do I Submit a Good Enhancement Suggestion?
149+
150+
Enhancement suggestions are tracked as [GitHub issues](https://github.com/partcad/pre-commit/issues).
151+
152+
- Use a **clear and descriptive title** for the issue to identify the suggestion.
153+
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
154+
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point
155+
you can also tell which alternatives do not work for you.
156+
- You may want to **include screenshots or screen recordings** which help you demonstrate the steps or point out the
157+
part which the suggestion is related to. You can use [LICEcap](https://www.cockos.com/licecap/) to record GIFs on
158+
macOS and Windows, and the built-in
159+
[screen recorder in GNOME](https://help.gnome.org/users/gnome-help/stable/screen-shot-record.html.en) or
160+
[SimpleScreenRecorder](https://github.com/MaartenBaert/ssr) on Linux.
161+
<!-- this should only be included if the project has a GUI -->
162+
- **Explain why this enhancement would be useful** to most pre-commit users. You may also want to point out the other
163+
projects that solved it better and which could serve as inspiration.
164+
165+
<!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
166+
167+
### Your First Code Contribution
168+
169+
Use VS Code and Dev Containers.
170+
171+
### Improving The Documentation
172+
173+
Fork repo and open pull request.
174+
175+
## Styleguides
176+
177+
### Commit Messages
178+
179+
Use this hook.
180+
181+
## Join The Project Team
182+
183+
Join `#pre-commit` channel on
184+
<a href="https://discord.gg/9AEu3vF7rv"><img alt="Discord" src="https://img.shields.io/discord/1091497262733074534?logo=discord&logoColor=white&label=Discord&labelColor=353c43&color=31c151"></a>
185+
186+
## Attribution
187+
188+
This guide is based on the [contributing.md](https://contributing.md/generator)!

.github/LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Copyright 2024 PartCAD
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
4+
License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
9+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10+
language governing permissions and limitations under the License.

0 commit comments

Comments
 (0)