Skip to content

PyCharm Usage

Brendan Maginnis edited this page Mar 6, 2020 · 11 revisions

How do I apply a refactoring?

There are 3 options:

  1. Press Alt+Enter on the suggested refactoring and apply the refactoring
  2. Hover the mouse over the refactoring and a lightbulb will appear. Click the lightbulb and apply the refactoring.
  3. Right click on the suggested refactoring in the Sourcery window and select the Refactor function option

How do I disable Sourcery on a function?

There are 3 options:

  1. Add this comment to the function definition: # sourcery off.
    For example:
    def func(a, b):  # sourcery off
        return a + b
  2. Press Alt+Enter on the suggested refactoring and select the Disable Sourcery for this function option
  3. Right click on the suggested refactoring in the code editor and select the Disable Sourcery for this function option
Clone this wiki locally