Skip to main content

Backlog

19

Under consideration

Feedback

create a lite version with only rule based refactoring.

n9o93eced@mozmail.com
Feedback

Docstring Recipe generates git diff

I used the “Generate Docstrings” option on a class. The Sourcery pane took some time to load, but when it finally did, it generated this diff instead of just the docstring: ``` <<<<<<< SEARCH class CreateGuide(PermissionRequiredMixin, CreateView): model = models.Guide template_name = "guides/create_guide.html" form_class = forms.GuideForm permission_required = "clients.add_guide" raise_exception = True def form_valid(self, form): self.object = form.save() return HttpResponseRedirect(reverse_lazy("guides_manage", kwargs=self.kwargs)+"?system_id="+str(self.object.system.id)) def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["guides_url"] = reverse_lazy("guides_manage", kwargs=self.kwargs) return context ======= class CreateGuide(PermissionRequiredMixin, CreateView): """Create a new guide. This view handles the creation of new guides, allowing users to add guides to the system. """ model = models.Guide template_name = "guides/create_guide.html" form_class = forms.GuideForm permission_required = "clients.add_guide" raise_exception = True def form_valid(self, form): self.object = form.save() return HttpResponseRedirect(reverse_lazy("guides_manage", kwargs=self.kwargs)+"?system_id="+str(self.object.system.id)) def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["guides_url"] = reverse_lazy("guides_manage", kwargs=self.kwargs) return context REPLACE ``` Usually, it just generates the class with the added docstring, and I can use the ‘insert at cursor’ option to just replace the code. This would appear to be a bug to me. Does anyone else get this? I’m on Windows 11, VS Code 1.99.3, Sourcery 1.35.0. Let me know if there’s any other diagnostic info I can provide.

James Walters
Feedback

Add Programming Paradigm Enforcement/Suggestions (Starting with Functional Programming)

Implement configurable programming paradigm checks and suggestions that can guide developers to write code following specific paradigms, with initial focus on functional programming. Problem Statement Currently, Sourcery focuses on general code quality improvements but doesn't provide paradigm-specific refactoring suggestions. Developers who want to follow specific programming paradigms (functional, object-oriented, etc.) have to manually identify and refactor code patterns, which can be time-consuming and inconsistent across teams. Proposed Feature Add a configuration option to enable paradigm-specific analysis and suggestions, starting with functional programming. This would include: Functional Programming Checks: Detect and suggest replacing loops with map(), filter(), reduce() Identify iterative loops and suggest tail-recursive alternatives Flag non-tail recursive functions and suggest tail-recursive refactoring Identify mutable data structures and suggest immutable alternatives Flag side effects in functions and suggest pure function alternatives Recommend function composition over nested function calls Suggest replacing class-based solutions with function-based ones where appropriate Identify opportunities for currying and partial application Example Transformations Loop to Tail Recursion: # Before - Iterative def factorial(n): result = 1 for i in range(1, n + 1): result *= i return result def sum_list(lst): total = 0 for item in lst: total += item return total Sourcery Suggestion: def factorial(n, acc=1): return acc if n Benefits Consistency: Enforce coding standards across teams Learning: Help developers learn paradigm-specific patterns including recursion Performance: Tail recursion can be optimized by interpreters/compilers Code Quality: Improve maintainability through paradigm adherence Stack Safety: Promote tail recursion to avoid stack overflow issues Flexibility: Configurable per project needs Future Extensions Object-Oriented Programming paradigm checks Procedural programming guidelines Custom paradigm definitions Team-specific paradigm rules Recursion depth analysis and optimization suggestions Use Cases Educational: Teaching functional programming and recursion concepts Team Standards: Enforcing consistent coding paradigms Legacy Refactoring: Migrating codebases to different paradigms Code Reviews: Automated paradigm compliance checking Performance Optimization: Converting inefficient recursion to tail recursion Technical Considerations Warn about Python's recursion limit (default 1000) wh

andres@aemonge.com
Feedback

re-trigger review on a commit

It would be great to automatically trigger a review when a new commit is pushed to Git. Currently, this must be done manually. There should be a setting to enable or disable automatic re-triggering.

vladimir@novisign.com
Feedback

uv.lock is not ignored during review

Added the following in .sourcery.yaml ignore: - uv.lock and attempted to review my code in Cursor IDE. end up with an error ValidationError This diff exceeds the maximum token limit for reviewing in IDE. The problem occurs only when uv.lock is updated, which is quite a lot of data and not needed for the review. Did I configure something wrong?

Yael Mi
Feedback

Superfluous comment votes

Bot always creates a plus and minus vote each on comments it creates itself. This is confusing as it seems to indicate that somebody has already reacted on the bot’s comment which is not the case.

andig
Feedback

Make github/gitlab integration use less invasive permissions

For many opensource projects it is important to maintain a tight control over who can have write access to their repositories. Sourcery.ai Github app is asking for wide permissions, including ability to push changes into the repositories. I’d like to see this tunable after the initial authorization. In our experience Sourcery.ai pull request reviews are useful but we would like to avoid to see ability to push proposed changes into the PR tree under review. It would best be if such permissions were missing from the Sourcery.ai and such configuration was explicit in the app.sourcery.ai.

Alexander Bokovoy
Feedback

Add ability to use images in the chat

Add a feature to drop images into the chat so you can ask the model about them - for example screenshots of UI or error messages.

Nick Thapen
Feedback

Improving Code Lenses

Do you find the code lenses useful? - Are there specific circumstances where they aren’t useful? - Are there other recipes that it would be useful to trigger on a code lens (for example some sort of simplify/refactor, or generating diagrams)

Nick Thapen
Feedback

Github Repo Syncing

The repos I’ve assigned to Sourcery never seem to sync. My current settings on the Github side have 6 repos assigned to have Sourcery access, but from the Sourcery page and extension it says I’ve assigned access to zero repos.

Frater.nul

Next up

Committed and queued

No Next up issues

In Progress

Actively being built

No In Progress issues

Done

4

Recently shipped

Feedback

Customize test generation with recipies

We are quite often using the functionality to generate tests and it works fine for the most part. It is however often defaulting to use Pythons Unittests, while we prefer to use and have a set up for Pytest. This typically results in me generating the tests and then ask Sourcery to regenerate all tests for pytest or use some other testing library. It would be awesome if it was possible to provide some kind of context per default when generating tests, such as: “Write tests using pytest, use pytest-mock“ for mocking.” I mentioned this in a support chat, and you seemed eager to look into it. I figured I can mention it here as well. Thanks for a great product!

Robert
Feedback

Improve initial loading time for Macs with Apple Silicon

Starting up Sourcery the first time I install a new version takes a long time on M1/M2/M3 macs. Once it loads up for the first time it’s fine

Tim Gilboy
Feedback

Add a chat history capabilities

It would be very helpful (to me anyway) to include the capability to see previous chats and their response. It would save time/worry not having to copy paste import chats just in case I need to refer to chat wording, results, etc. You can start off by only keeping 2 days then expand those capabilities as you see fit. (btw JetBrains AI Assistant does allow you to view previous chats)

Robert Gottesman
Feedback

PyCharm IDE | 1.34.0 | UI | Suggested Overview should be wrapped in the display

Slightly annoying change that I got with the new version. Instead of wrapping the text, there’s now a scrollbar. Since I use Sourcery for reviews always in the side pane, this is a but annoying change

Yael Mi