docs: add rules for ai generated code.

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar
2026-06-16 03:28:16 -04:00
parent c45acbf6ad
commit 8b7b152492
+35 -8
View File
@@ -1,10 +1,31 @@
If you are reading this, you want to contribute to this project. Good. I want to get Ballistic to a working state as soon as possible so future developers will use Ballistic in their Switch 2 emulators.
# AI Generated Code
But lets get one thing straight right now: **The Git history is sacred.** If you don't follow these rules, your Pull Request will be closed, and you will be told to go learn how to use Git properly.
I don't care if you use AI to write your code. But I do not tolerate my time being wasted with AI slop in PRs. So
here are the rules, read them, or I will close your pull request without even asking.
## YOU HAVE TO UNDERSTAND IT
You will not get way with pasting generated LLM code blindly. I **will** find a flaw in your code. If you copy paste
huge blocks of code from an LLM, you better know exactly what every single line does. If I do a code review and ask why
you use a certain data structure and you cannot give a proper reason, your PR is getting rejected. Write the PR
description in your own words. Don't let the robot do your thinking for you.
## TEST BEFORE PUSHING
Run the unit tests. Like actually run them on your local machine before you commit. If the tests fail during CI/CD I
will blast you for it.
## CLEAN UP FORMATTING AND COMMENTS
AI usually leave weird comments in PRs I've seen like `// loop through the array`. It's useless, delete it. Any
competent programmer would recognize this immediately, but I'm spelling it out for you anyway.
That is it for the AI rules.
# Forking and Branching (Do NOT use `main`)
Your `main` branch should be a pristine, 1:1 mirror of the upstream `main` branch. Never commit directly to your `main` branch.
Your `main` branch should be a pristine, 1:1 mirror of the upstream `main` branch. Never commit directly to your `main`
branch.
The correct workflow:
@@ -14,13 +35,16 @@ The correct workflow:
4. Sync your local main: `git checkout main && git pull origin main`
5. Create a feature branch: `git checkout -b feature-name`
You do your work on `feature-name`. You push `feature-name` to your fork. You open a Pull Request from `feature-name`. Please leave `main` alone.
You do your work on `feature-name`. You push `feature-name` to your fork. You open a Pull Request from `feuature-name`.
Please leave `main` alone.
# Bisectability
Every single commit in your PR must **individually** compile and pass tests.
If I am tracking down a bug two years from now using `git bisect`, and I land on your commit where Ballistic doesn't even compile because you "added the header but forgot the source file", I have to manually skip that commit. If you do this multiple times, you've ruined the bisection and wasted my time.
If I am tracking down a bug two years from now using `git bisect`, and I land on your commit where Ballistic doesn't
even compile because you "added the header but forgot the source file", I have to manually skip that commit. If you do
this multiple times, you've ruined the bisection and wasted my time.
Before you push, run an interactive rebase with the --exec flag to test every commit in your PR automatically:
@@ -38,7 +62,8 @@ Do not combine unrelated changes into a single commit. A commit must be a single
- If you are adding a new feature that requires a core engine change, do it in two commits:
1. `engine: add new capability`
2. `decoder: use new capability for X`
- If i need to `git revert` your commit, it should cleanly remove the feature without breaking three other unrelated things.
- If i need to `git revert` your commit, it should cleanly remove the feature without breaking three other unrelated
things.
# Commit Message
@@ -70,7 +95,8 @@ Map your prefix to the subsystem or directory you are touching:
## The Sign-off
Every commit must include a `Signed-off-by` tag. This means you are legally liable for the code you submit to Ballistic. Use `git commit -s` to add it automatically.
Every commit must include a `Signed-off-by` tag. This means you are legally liable for the code you submit to Ballistic.
Use `git commit -s` to add it automatically.
# The Pull Request Process
@@ -83,4 +109,5 @@ If I review your PR and ask for changes, do not add a new commit that says "fix
# Code Style and Standard
I chose BARR-C 2018 as the code standard to reduce as much bugs as possible. This will be enforce by our CI. If you push code that is not formatted correctly, the CI will fail to build your commit. Use `clang-format` to format your files.
I chose BARR-C 2018 as the code standard to reduce as much bugs as possible. This will be enforce by our CI. If you push
code that is not formatted correctly, the CI will fail to build your commit. Use `clang-format` to format your files.