Better HN
topnewbestaskshowjobs
Log inSign up

brendanator

8 karma · joined Jan 16, 2020 (6y ago) · 14 submissions

Submissions

comment 2w ago · link · parent

Sourcery CEO here. Wanted to comment on the claims of 1.6x Greptile review comments.

With Greptile there's a precision-recall trade-off with code review comments. Greptile is at the precision end of the scale, so every comment that they make is accurate. We've seen on GitHub that over 80% of the comments they make get addressed. At the other end of the spectrum is Sourcery [1], which produces over 2x as many comments as Greptile, and this agent run example has 1.6x.

Shameless self-promotion: we believe that outputting a lot of comments, even if they're nitpicky, is the right way to go for coding agents because they can triage all of the comments very rapidly and decide which to address and which are not relevant.

[1] https://sourcery.ai

2.

Blood test finds 7× more cancers when added to standard screening(grail.com ↗)

2 points · by brendanator · 1y ago · discuss

comment 1y ago · link · parent

Totally agree - we’re working on this at https://sourcery.ai

comment 2y ago · link · parent

Haha fair counter - but I think the typical current ways of reviews is more unnecessarily inefficient and the downside risk of something going wrong in a PR being merged is way lower than in the FDA/housing inspection case.

There are types of code changes that definitely need reviews - but those are the small minority of all code changes and the way we approach those changes should be different from how we handle all other changes

5.

Rethinking how we approach code reviews(sourcery.ai ↗)

2 points · by brendanator · 2y ago · 3 comments

6.

Instantly Refactor Python in Sublime(sourcery.ai ↗)

1 points · by brendanator · 5y ago · discuss

comment 5y ago · link · parent

Hi HN! We're Brendan, Nick and Tim — founders of Sourcery.

We're building the most advanced refactoring tool in the world. Most refactoring tools require the user to decide what refactorings to make. Sourcery turns that around and proposes refactorings to you according to its own code quality metrics. It can also do far more advanced refactorings than anything else out there.

The way it works is inspired by how an expert refactors code. They make lots of small changes, each of which slightly improves the quality of the code while keeping the functionality the same. Sourcery has a large library of small, correct refactorings that it composes together to produce larger ones. It uses code quality metrics to guide its search through the possible combinations of these refactorings to find the best overall change. We use a mix of standard metrics, like code size and cognitive complexity, along with some of our own custom metrics which capture what we think is important to high quality code.

Sourcery is currently available for Python and can be used in:

- PyCharm, VSCode and Vim where it refactors the current file you have open

- GitHub where it acts as a code review tool on PRs, suggesting refactorings and scoring the code changes with our code quality metrics

- A CLI which allows it be used as a pre-commit hook or in a CI pipeline

The next step for to start proposing refactorings at the class level, such as extracting methods to remove duplicated code. Then we will add machine learning based refactorings to capture more niche improvements that can be made when using libraries outside the standard library.

Give us a try!

You can also get an instant demo by starring this repo https://github.com/sourcery-ai/sourcery and our GitHub bot will refactor your most starred Python GitHub repo.

We would love to hear your thoughts, feedback and suggestions on how can we improve!

8.

Show HN: Sourcery – Automated Refactoring for Python(sourcery.ai ↗)

4 points · by brendanator · 5y ago · 1 comment

9.

Instantly refactor your Python code in Vim(sourcery.ai ↗)

2 points · by brendanator · 6y ago · discuss

10.

GitHub Actions for Perfect Python Continuous Integration(sourcery.ai ↗)

3 points · by brendanator · 6y ago · discuss

comment 6y ago · link · parent

Thank you for all these suggestions, I've updated the article.

Your website is an excellent source of knowledge!

comment 6y ago · link · parent

Multi stage builds do indeed seem much better, thanks

Regarding writing bytecode - this slows down the first load of a file, in exchange for speeding up subsequent loads of a file. It has no effect on runtime speed. Given that python code is only loaded once when a Docker image is run, it is better to disable this.

13.

A perfect way to Dockerize your Python application(sourcery.ai ↗)

3 points · by brendanator · 6y ago · 4 comments