Sourcery Blog

sourcery.ai · Company blog · on HN since 2019

The company blog for Sourcery, a Python refactoring tool, covering code quality, project setup, code review, and LLM code generation.

What HN saysCommenters mention the Sourcery tool as one a team adopted by word of mouth and liked, and link its follow-up post on dependency architecture.
17HN people shared it
7linked it in comments
52stories submitted
312story points
1 year agolast shared
2019people per year2026

Most-shared posts

  1. 1
  2. 2
    How to set up a perfect Python project
    3 people · 76 points · first shared 2019 · 48 comments on HN
  3. 3
    Code Review: What and What Not to Automate?
    3 people · 5 points · first shared 2023 · discussion on HN
  4. 4
    Generating Code Without Generating Technical Debt?
    3 people · 3 points · first shared 2023 · discussion on HN
  5. 5
    Is your code too complicated?
    2 people · 15 points · first shared 2022 · 1 comments on HN
  6. 6
  7. 7
  8. 8
  9. 9
    Zero-Cost Exceptions and Error Interfaces
    1 people · 36 points · first shared 2022 · 42 comments on HN
  10. 10
  11. 11
  12. 12
    Chatting with Will McGugan: From Side Project to Startup
    1 people · 4 points · first shared 2022 · discussion on HN
  13. 13
    A code quality battle between 6 AI agents
    1 people · 3 points · first shared 2025 · 1 comments on HN
  14. 14
    Six more ways to improve your Python
    1 people · 3 points · first shared 2020 · discussion on HN
  15. 15
    A perfect way to Dockerize your Python application
    1 people · 3 points · first shared 2020 · 4 comments on HN

What HN people wrote when they linked it

stuartjohnson12 · 2023-03-31
In my experience, the developer tools that really catch on do so via word of mouth. For example, our whole team recently adopted https://sourcery.ai/ (not an ad) because one developer tried it and hyped it up to everyone else who also liked it. Developers are the best kind of customers if you have PMF - they evangelise and actively enjoy debating toolchains. The hard part is usually building the actually valuable tool.
usrme · 2023-02-11
To those that wish to automate a subset of these conventions, there is a tool called Sourcery[1] that I, personally, am a huge fan of! Not only does it have a large set of default rules[2], but it can also allow you to write your own rules that may be specific to your team or organization, and as mentioned it can enable you to follow Google's Python style guide as well[3]. There are some refactorings that Sourcery suggest that I don't agree with myself, namely the usage of 'contextlib.suppress'[4] as I don't like to introduce an additional 'import' statement just to do something so trivial. I wish Sourcery would add the relevance of having possibly too many 'import' statements as a heuristic. --- [1]: https://sourcery.ai/ [2]: https://docs.sourcery.ai/Reference/Default-Rules/ (expand the sub-pages) [3]: https://docs.sourcery.ai/Reference/Optional-Rules/gpsg/ [4]: https://docs.sourcery.ai/Reference/Default-Rules/refactorings/use-cont…
hbrn · 2022-12-15
This (plus Law of Demeter) is the right way to handle medium-big size projects, though I'm not completely sold on the tooling. I mostly do it manually (yes, it is still doable with dozens of modules since dependency hierarchy doesn't change often). One recommendation I have is to present the hierarchy as DAG. Existing image (https://sourcery.ai/static/05300f06cb847360719e2aa31dc5a31b/8c857/depe… doesn't make it very obvious that api is a highest-level module, even though it is clearly stated in the rules.
claytonjy · 2021-12-21
> So now I have two different black calls: in the pre-commit hook and in the CI/CD. And they must be of the same version. > Can the framework run off the venv dir? It can, but it means not using the hooks from the tool's repo and writing your own. This blog post [0] shows the pipenv version of some common hooks; mine look the same but s/pipenv/poetry. If there's a way to use the upstream hooks with your local venv, so I can trust the tool maintainers for proper configuration, I'd love to know about it. [0] https://sourcery.ai/blog/python-best-practices/
buschkowitz · 2019-12-08
I find myself coming back to this guide whenever I set up a new project: https://sourcery.ai/blog/python-best-practices/
brendanator · 2025-06-11
Totally agree - we’re working on this at https://sourcery.ai

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close