Skip to content

Diffs

Pipe in a diff to judge only what changed:

Terminal window
git diff main | decide run code-risk --each function

decide reads a diff from git diff, git show, git format-patch, or gh pr diff, and any .diff or .patch file.

--each One item is Named like
hunk each block of changed lines server.go:42
function each function a change touches, whole server.go#L40 Handler.Delete
file every change to one file server.go
line each added line server.go:43

The default is hunk, unless the template sets a unit of its own. code-risk judges each changed file:

Terminal window
gh pr diff 42 | decide run code-risk
gh pr diff 42 | decide run code-risk --each hunk

--each function judges the whole of each function a diff touches, so the model sees the code around the change. It works on Go, Python, JavaScript, TypeScript, and Java.

Run it in the repository the diff came from. decide reads each function from the file on disk.

decide skips deleted files, binary files, lockfiles, and generated files, and says which. When a diff has nothing left to judge, decide exits 0.

decide is Apache 2.0. Made by Deep Noodle, after some very hard thinking.