David Cohen

Sourcery - Grammarly for code

Sourcery instantly reviews your Python code and refactors it, making it cleaner and more readable. It’s like having a pair programmer always working next to you. Install into PyCharm, VS Code, or your GitHub repos in 1 minute. It's free!

Add a comment

Replies

Best
Brendan Maginnis
Thanks for hunting Sourcery @davidcohen! Hey Product Hunt 👋 - @nick_thapen, @tim_sourcery, and I are very excited to be sharing Sourcery with you all. Sourcery instantly refactors your code while you're working directly in your IDE. We're obsessed with trying to figure out the best way to write high quality code - and Sourcery is our way to make sure everyone can always work with the cleanest code possible. Sourcery sits in the background when you're working, analyzing your code, finding problems, and suggesting changes to make your code easier to read. In your IDE Sourcery works fully locally, so your code is always private. We're focused on Python right now and have integrations with PyCharm, VS Code, and GitHub. Sourcery's still in its early days - so let us know how we can keep improving it to make it more useful to you 😁 It's free to get started - just sign up on our site, add Sourcey to your IDE, and let us know what you think!
Eugene Hauptmann
@davidcohen @nick_thapen @tim_sourcery @brendan_maginnis congrats! Love the privacy aspect. Going to try this on couple of our CI/CD pipelines.
Tim Gilboy
Thanks @eugenehp ! Let us know what you think - we're still in our early days and are always trying to learn how we can keep getting better
Csaba Kissi
@davidcohen @nick_thapen @tim_sourcery @brendan_maginnis Would be great to something like this for other programming languages. Great work guys!
Tim Gilboy
Thanks @csaba_kissi ! We're aiming to expand Sourcery to other languages down the line (we're planning on starting with Java and Javascript next). But first we want to provide even more detailed, frequent, and impactful improvements for Python.
Paul Smith
Hi @brendan_maginnis @nick_thapen @tim_sourcery - great to see you launch! I know a few folks who've been using Sourcery over the past couple of months, and they've nothing but praise for it. Be interested to know how you make sure your reviews and refactoring suggestions are accurate? Is Sourcery implimenting basic best practise and fixing obvious mistakes, or is it learning in a dynamic way across your crowd of users?
Nick Thapen
@brendan_maginnis @tim_sourcery @paul_a_smith Thanks Paul that's great to hear! We take a lot of care to make sure that the suggestions are correct. Firstly bucketloads of internal testing around each suggestion, secondly lots of detailed static analysis of the code, and as a backstop we run all of our suggestions over lots of open-source libraries then check that their tests are still green. Lots more detail here: https://sourcery.ai/blog/testing.... On the second point we treat our suggestions like building blocks - they can stack on top of each other to make more impressive changes to the code (like in the Gilded Rose example in the video).
eamonncarey
Congrats on the launch @tim_sourcery! Looks like you're supporting python for now - what are the plans/timelines for other languages?
Tim Gilboy
@eamonncarey thanks! We're going to be focused on Python for the next several months to year at least. We want to make sure we are able to really help Python developers make meaningful improvements to their code and work much faster. Then we'll start to shift over to other languages. Javascript and Java are the first two on our list, but we've had requests for pretty much every language out there - so depending on what people want those plans might change.
Jerome Bau
Have been using Sourcery for a few months now. Definitely decluttered my code and is always inspiring to use. Highly recommend!
Tim Gilboy
@jerome22 we always love to hear that! Thank you so much for the support
Waïna Landauro
This looks fantastic! I'll share this with my team. Kudos
Tim Gilboy
Cheers @waina ! Let us know what they think
Lukas Kemkes
@brendan_maginnis @nick_thapen @tim_sourcery This is awesome! 🙌 We have been using Sourcery for a while now and are super excited about how easy it makes refactoring our code + it gives us cool advice on how to simplify our code. Very excited to see what's coming in the next releases! 🚀
Tim Gilboy
Thanks @lukas_kemkes ! I always love to hear when Sourcery is helping out teams a lot. We're working now on getting more types of suggestions for your code, doing more complex refactorings (moving to the class level), and building out more tools to help you deal with duplicate code.
Ivanna Wendel
Great product and we will definitely try it with our dev. team! Congrats!
Tim Gilboy
Thanks @ivanna_wendel !!
Ковальчук Владимир
Congrats on lunch on PH! I will test this one, thanks for your work!
Tim Gilboy
Thanks!! @kovalchuk_vladimir - let us know what you think. We're trying to help make everyone's code easier and nice to work with.
Teddy
This is amazing! Congrats on your PH launch team! Are you saying that Sourcery will auto-suggest improvements on my GitHub repos directly 🤯? Interested to hear more!
Tim Gilboy
Thanks @_teddy !! And exactly. If you add Sourcery to your GitHub repos Sourcery will automatically review any new pull request you make. Or you can have Sourcery review your entire repo anytime you want from your Sourcery dashboard. We're Python only for now - so we won't review sections of your repos in other languages - but we'll get there in the future :)
Dylan McKee
This looks really cool! Excited to give it a try and congrats on launching. I'm really curious to know how the suggestions handle opinion – aware that Python has 'one obvious way' but devs are still opinionated (I'm as guilty as the next person) on coding styles, and I'm keen to know how you handle that – as I've often found JetBrains auto formatting very restrictive and undoing of my personal conventions – and how (or if?) you see it expanding beyond Python to more opinionated languages? :)
Tim Gilboy
Thanks @djmckee ! You're definitely not alone - we're opinionated ourselves as developers 🙂. That's why we've set up Sourcery so you can review every suggestion before it's implemented (if you want) and can choose to skip an individual suggestion or configure Sourcery to not suggest certain types of refactorings altogether. In terms of formatting we try our best to fit in with the style of the existing code. As for other languages. We're still a ways out from moving beyond Python - but we will likely have a similar approach where we will take a strong line on what is best practice and how the code should be structured, but always give you flexibility to code to your own style/approach/opinion
Ben Sodderman
Finally! This looks awesome guys. Congrats!
Tim Gilboy
Thanks @ben_sodderman! We're really excited to share Sourcery with the rest of the world :)
Jimi Desmet
Considering how coding can be so tedious, this product is much needed. Have you had feedback on the accuracy of the suggestions Sourcery makes?
Tim Gilboy
@jimi_desmet great question! In general we see roughly 97.5 suggestions accepted to every 2.5 rejected. But many of these rejected suggestions aren't inaccurate, but might be changes that a developer doesn't want to make at a certain time. For example we might suggest that you inline a variable that is defined and immediately returned, but you may want to reject that suggestion for now because you're using that variable for debugging. But that's not to say we're perfect (although we're trying to get closer :) ). We still occasionally get the bug flagged for a refactoring that would change the outcome of the code and then we immediately work to fix that and make sure that situation doesn't come up ever again.
Rogier
Congratulations on the launch! I see you are offering a solution for teams as well. How does Sourcery help make life easier for engineering teams? Can you share more about your plans / roadmap for this product?
Tim Gilboy
@rogiervanwilligen thank you! Teams can use Sourcery individually in their IDE to get instant feedback while they're working on their code. Or they integrate Sourcery into their GitHub organisation and Sourcery will review every new pull request they make. You can think of it as a first layer of the code review process. You can also add Sourcery in as a pre-commit hook or as a script in your CI so every new commit will be reviewed and improved before it's merged. In terms of our plans for the next few months we're primarily focused right now on making Sourcery more powerful - increasing the number of suggestions we make and handling more libraries and frameworks, expanding our analysis to the class level (thing like extracting methods and constants to start, then more complex refactorings), and building out more tools to help you handle duplicate code across your project. Then we'll focus on more integrations and in depth support for teams and likely start focusing on other languages.
Aleks Bochkov
Brilliant idea! Congrats on the launch 🚀
Tim Gilboy
Thanks @bochkovaleks !!
Maurice Iwunze
Shared the product with our tech team, they love it!
Tim Gilboy
@maurice_iwunze thanks for sharing it with them and thanks for the feedback!
Manthankumar Satani
This is excellent, Congratulations,
Tim Gilboy
@its_mnthn thank you! Glad to hear you like it :D
Subhendu
Looks amazing. Just wondering how different it it from https://jshint.com (Tho this is just for JS, but from the concept perspective).
Nick Thapen
@thisissubhendu Thanks! Hadn't seen JS Hint before and it looks cool. The main difference in concept I think is that whenever we see an issue, we always suggest a code change you can implement right away. We've seen that with lots of tools you can get kind of overwhelmed with warnings if you're not sure how to fix them. We want our changes to be actionable straight away.
David Anderson
Just works!
Nick Thapen
@ukwiz That's what we love to hear!
Steve
Great, looking for javascript!
Tim Gilboy
@stefano_marchetti definitely something we're planning on adding in the future. First we want to make Sourcery more powerful for Python and build out some of our more complex code improvement tools. But then the plan is to start supporting other languages and javascript is one of the first on the list :)
Tinks
This looks fantastic - how exciting! I was wondering, will there be a Sourcery community where users can come together to talk, share practices or just connect? Look forward to seeing the journey, well done!
Tim Gilboy
@tinks1 thanks!! We don't have anytype of community yet - but it's something we've thought about. There are only 3 of us on the Sourcery team right now - so trying to find the bandwidth to do everything we want to do!