Live data from Hacker News

Get an AI code review in 10 seconds

oldmanrahul.com

61–69 of 69 posts

Re: Get an AI code review in 10 seconds

#61
post #2

With not much more effort you can get a much better review by additionally concatenating the touched files and sending them as context along with the diff. It was the work of about five minutes to make the scaffolding of a very basic bot that does this, and then somewhat more time iterating on the prompt. By the way, I find it's seriously worth sucking up the extra ~four minutes of delay and going up to GPT-5 high ra…

Alternative twist on this that I find works very well (and that I posted about a month ago https://news.ycombinator.com/item?id=45959846) - instead of concat&sending touched files, checkout the feature branch and the prompt becomes "help me review this pr, diff attached, we are on the feature branch" with an AI that has access to the codebase (I like Cursor).

Re: Get an AI code review in 10 seconds

#62
post #34

Earlier quoted context omitted.

Funny you mention that, I have very recently just came back from a one-shot prompt which fixed a rather complex template instantiation issue in a relatively big very convoluted low-level codebase (lots of asm, SPDK / userspace nvme, unholy shuffling of data between numa domains into shared l3/l2 caches). That codebase maybe isn't in millions of lines of code but definitely is complex enough to need a month of onboard…

Template instantiation is relatively simple and can be resolved immediately. Trying to figure out how 4 different libraries interact with undefined behavior to boot is not going to be easy for AI for a while.

Maybe LLMs can't fix all of the human deficiencies in the past.

Re: Get an AI code review in 10 seconds

#64
post #39

Earlier quoted context omitted.

those AI checks, if you insist in getting them, should be part of your pre-commit, not part of your PR review flow. they are at best (if they even reach this level) as good as a local run of a linter or static type checker If you are running them as a PR check, the PR is out there. So people will spend time on that PR. no matter if you are fixing the AI comments or not. Best to fix those things BEFORE you provide you…

My team uses draft PRs and goes through a process, including AI review, before removing the draft status thereby triggering any remaining human review. A PR is also a decent UI for getting the feedback but especially so for documenting/discussing the AI review suggestions with the team, just like human review. AI review is also not equivalent to linter and static checks. It can suggest practices appropriate for the l…

I'm starting to repeat myself here: If you need/want the opinion of an AI on the changes you make, you should run the robot locally BEFORE you make a pr. I would even say: before you even push commits to the central repository.

Re: Get an AI code review in 10 seconds

#65
post #3

I recently started using LLMs to review my code before asking for a more formal review from colleagues. It's actually been surprisingly useful - why waste my colleagues time with small obvious things? But it's also gone much further than that sometimes with deeper reviews points. Even when I don't agree with them it's great having that little bit more food for thought - if anything it helps seed the review

Yes, exactly!

The objective of this initial review is to catch those low-hanging fruit that your colleagues would waste cycles on.

LLMs can catch syntax and basic semantics. Peers can spend time on more interesting things like design and relevant biz context.

Re: Get an AI code review in 10 seconds

#66
post #31

Earlier quoted context omitted.

Sure, AI code reviews aren't a replacement for an architecture review on a larger team project. But they're fantastic at spotting dumb mistakes or low-hanging fruit for improvements! And having the AI spot those for you first means you don't waste your team's valuable reviewing time on the simple stuff that you could have caught early.

those AI checks, if you insist in getting them, should be part of your pre-commit, not part of your PR review flow. they are at best (if they even reach this level) as good as a local run of a linter or static type checker If you are running them as a PR check, the PR is out there. So people will spend time on that PR. no matter if you are fixing the AI comments or not. Best to fix those things BEFORE you provide you…

[deleted]

Re: Get an AI code review in 10 seconds

#67
post #43

Earlier quoted context omitted.

This just sounds like you haven’t worked in a team environment in the last 12 months. The ergonomics of doing this in pre-commit make no sense. Spin up a PR in GitHub and get Cursor and/or Claude to do a code review — it’s amazing. It’ll often spot bugs (not only obvious ones), it’ll utilise your agent.md to spot mismatched coding style, missing documentation, it’ll check sentry to see if this part of the code touche…

Stuff like coding style and missing documentation is what your basic dumb formatter and linter are supposed to do, using a LLM for such things is hilarious overkill and waste of electricity.

I think what has happened is that there are a whole lot of younger programmers who have not used tooling like linters and static analyzers. For them, when AI does the same thing it is a revelation.

Re: Get an AI code review in 10 seconds

#68
post #51
post #43

Earlier quoted context omitted.

Stuff like coding style and missing documentation is what your basic dumb formatter and linter are supposed to do, using a LLM for such things is hilarious overkill and waste of electricity.

Your linter can tell if a comment exists. AI can tell if it’s up to date.

When your linter or static analyser says something, you know exactly what it means. When AI says something - many a time, it doesnt make sense. And I use AI code review tools every day.
Post reply on HN