sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

Instant AI code reviews

Results 146 sourcery issues
Sort by recently updated
recently updated
newest added

### Issue description or question The [doc](https://github.com/sourcery-ai/sourcery/wiki/Sourcery-configuration#the-sourcery-configuration-file) says: > Sourcery reads configuration settings from `.sourcery.yaml` in the project directory. What this means is not very clear. Does Sourcery search for...

enhancement

### Issue description or question When posting reports as GitHub comments, any existing report is deleted and a new one posted. This is wrong since it will trigger email notifications...

enhancement

## Description I opened a PR today (br3ndonland/inboard#43), expecting to receive a report from the Sourcery GitHub App. It didn't show up until after I merged the PR. It would...

enhancement

### Issue description or question In unit tests of a legacy system I often come across code like: ``` with patch('...', return_value='whatever'): with patch.object(LocalObj, 'get_...', return_value=expected_data) as mocked_x: with patch('..',...

enhancement

### Issue description or question The switch refactoring always re-orders comparisons of values to strings alphabetically. This does not change behaviour but can obscure developer intent and harm readability. ###...

enhancement

### Issue description or question [PEP 518](https://www.python.org/dev/peps/pep-0518) introduces the `pyproject.toml` file and [recommends](https://www.python.org/dev/peps/pep-0518/#tool-table) specifying tool configuration data in the `[tool]` table. Having all configurations in one place makes it easier...

enhancement

### Issue description or question For the following code ``` def elapsed(self): if self.count == self.total: elapsed = self.last_update - self.start else: elapsed = time.time() - self.start return elapsed ```...

enhancement

### Issue description or question In the following function, Sourcery only suggests to refactor the `outfile` `open()`/`close()` set to a `with` block, but doesn't make any suggestions about the `infile`...

enhancement

### Issue description or question I noticed a unnecessary None checking that could be simplified: ```python from typing import List, Optional def func(items: Optional[List]): if items is not None and...

enhancement

Right now if you have @sourcery-ai-bot installed for your GitHub repository it opens a separate PR. In this new PR it simply adds all refactorings without comments. If you let...

enhancement