Inspiration
We have often received complaints about “uninformative” git commits, and repeatedly doing git commit -m "fix: minor fix" is very boring...
Inspired by the Password Game, we have decided to force users to have a bit of fun - answering trivia questions, writing your git commit as a Haiku, smiling until the progress bar hits 100%... the list goes on!
What it does
We have created a VSCode extension where you type in a git commit message, and you get hit with increasingly absurd rules. It may ask you to write your git commit as a Haiku, as a palindrome, using pig latin, and so on. Afterwards, you might even get asked to answer trivia questions, get your code roasted...
Do you think that is all? Of course, what is the point of coding if you don't enjoy it? Your happiness will therefore be enforced!
How we built it
We created custom command line commands using Typer, with a modular design to incorporate multiple rules for git commits, where the modules include things like NLTK to count syllabi, openCV2 and deepface to detect your happiness, and so on.
This then interfaces with the VSCode API, and we then use a Webview system with React and MUI to build a VSCode extension for you to use!
Challenges we ran into
- Python being Python, dependency issue galore...
- Tying everything together with a very apparent lack of sleep...
- Implementing a full chess engine...
Accomplishments that we're proud of
- Creating a fully extensible and modular system where you can add even more rules easily.
- Somehow not running into that many merge conflicts which require complicated resolution.
What we learned
- Working on 3 different OSes (Windows, MacOS, Ubuntu) is not a great idea... Probably should dockerise it
- Python has very painful dependency resolutions, let's avoid it if possible...
What's next for Git Police
Customizable Commit Requirements (“Self-Torture”)
- Allow users to define their own constraints for commit messages (e.g., minimum word count, specific keywords, rhyming patterns, etc.).
- Add support for regex-based validation for advanced users.
More Interesting Commit Challenges
- We can include more interesting challenges, such as asking users to do an interpretive dance that matches their intended commit.
- This will be passed through a video-VLM model.
Hard Mode
Chain all the rules together!
Built With
- fastapi
- opencv2
- python
- react
- typer
- typescript
Log in or sign up for Devpost to join the conversation.