-
Notifications
You must be signed in to change notification settings - Fork 73
Skipping refactorings
Brendan Maginnis edited this page Sep 30, 2020
·
2 revisions
Sourcery can be configured to skip refactorings:
- Globally using the Sourcery configuration file.
- In the code using skip comments
Sourcery can be configured at a function level to skip refactorings.
- The whole function can be skipped with -
# sourcery skip
- Specific refactorings can be skipped with -
# sourcery skip: <refactoring_id1>, <refactoring_id2>
These comments can appear anywhere in the function.
Sourcery can be disabled on a function with a # sourcery skip
comment:
def func(a, b): # sourcery skip
c = a + b
return c
Sourcery will skip specific refactorings if their ids are included in a skip comment:
def func(a, b):
# sourcery skip: inline-immediately-returned-variable
c = a + b
return c
These refactoring ids are displayed in the plugin suggestions and GitHub Bot comments for easy lookup.
Please visit our newer docs at https://docs.sourcery.ai