heitorpolidoro / bartholomew-smith

Unnecessary else / elif used after return PYL-R1705
Style
Major
3 occurrences in this check
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
148    """Enable the auto merge"""
149    sub_run.update(title="Enabling auto-merge", status=CheckRunStatus.IN_PROGRESS)
150    default_branch = repository.get_branch(repository.default_branch)
151    if default_branch.protected:152        if pull_request := pull_request_helper.get_existing_pull_request(
153            repository, branch_name
154        ):
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
127) -> bool:
128    """Enable the auto merge if is enabled and is not the default branch"""
129    if Config.pull_request_manager.enable_auto_merge:
130        if branch == repository.default_branch:131            ignoring_title = f"In the default branch '{branch}', ignoring."
132            sub_run.update(
133                title=ignoring_title,
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
 67) -> bool:
 68    """Try to create a Pull Request if is enabled and is not the default branch"""
 69    if Config.pull_request_manager.create_pull_request:
 70        if branch == repository.default_branch: 71            ignoring_title = f"In the default branch '{branch}', ignoring."
 72            sub_run.update(
 73                title=ignoring_title,