Skip to content

Commit

Permalink
Fix messed up indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DazWorrall committed Apr 30, 2020
1 parent 985a4b7 commit cc13dc5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Expand Up @@ -47,3 +47,7 @@ Style/PerlBackrefs:
Exclude:
- app/helpers/shipit/shipit_helper.rb
- app/models/shipit/pull_request.rb

# This cop is broken https://github.com/rubocop-hq/rubocop/pull/7531
Layout/RescueEnsureAlignment:
Enabled: false
16 changes: 8 additions & 8 deletions app/models/shipit/commit_deployment.rb
Expand Up @@ -21,14 +21,14 @@ def create_deployment_on_github!

response = begin
create_deployment_on_github(author.github_api)
rescue Octokit::ClientError
raise if Shipit.github.api == author.github_api
# If the deploy author didn't gave us the permission to create the deployment we falback the the main shipit
# user.
#
# Octokit currently raise NotFound, but I'm convinced it should be Forbidden if the user can see the repository.
# So to be future proof I catch boths.
create_deployment_on_github(Shipit.github.api)
rescue Octokit::ClientError
raise if Shipit.github.api == author.github_api
# If the deploy author didn't gave us the permission to create the deployment we falback the the main shipit
# user.
#
# Octokit currently raise NotFound, but I'm convinced it should be Forbidden if the user can see the repository.
# So to be future proof I catch boths.
create_deployment_on_github(Shipit.github.api)
end
update!(github_id: response.id, api_url: response.url)
end
Expand Down
16 changes: 8 additions & 8 deletions app/models/shipit/commit_deployment_status.rb
Expand Up @@ -13,14 +13,14 @@ def create_on_github!
return if github_id?
response = begin
create_status_on_github(author.github_api)
rescue Octokit::ClientError
raise if Shipit.github.api == author.github_api
# If the deploy author didn't gave us the permission to create the deployment we falback the the main shipit
# user.
#
# Octokit currently raise NotFound, but I'm convinced it should be Forbidden if the user can see the repository.
# So to be future proof I catch boths.
create_status_on_github(Shipit.github.api)
rescue Octokit::ClientError
raise if Shipit.github.api == author.github_api
# If the deploy author didn't gave us the permission to create the deployment we falback the the main shipit
# user.
#
# Octokit currently raise NotFound, but I'm convinced it should be Forbidden if the user can see the repository.
# So to be future proof I catch boths.
create_status_on_github(Shipit.github.api)
end
update!(github_id: response.id, api_url: response.url)
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/shipit/pull_request.rb
Expand Up @@ -130,8 +130,8 @@ def self.request_merge!(stack, number, user)
stack: stack,
number: number,
)
rescue ActiveRecord::RecordNotUnique
retry
rescue ActiveRecord::RecordNotUnique
retry
end
pull_request.update!(merge_requested_by: user.presence)
pull_request.retry! if pull_request.rejected? || pull_request.canceled? || pull_request.revalidating?
Expand Down

0 comments on commit cc13dc5

Please sign in to comment.