Skip to content

Commit

Permalink
Merge pull request #15416 from opf/rubocop-check
Browse files Browse the repository at this point in the history
Reenable rubocop check
  • Loading branch information
toy committed May 16, 2024
2 parents 4eb90a9 + c56e604 commit d5d0311
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/rubocop-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@ name: rubocop

on:
pull_request:
branches:
- dev
- release/*
paths:
- '**.rb'

jobs:
rubocop:
name: rubocop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all commits for PR branch plus head commit of base branch
run: |
# fetch all commits of the PR branch
git fetch --shallow-exclude "${{ github.base_ref }}" origin "${{ github.ref }}"
# fix for "fatal: error in object: unshallow"
git repack -d
# fetch head commit of base branch
git fetch --deepen 1 origin "${{ github.ref }}"
- uses: ruby/setup-ruby@v1
- uses: opf/action-rubocop@v2
- uses: opf/action-rubocop@master
with:
github_token: ${{ secrets.github_token }}
rubocop_version: gemfile
rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
rubocop_extensions: rubocop-inflector:gemfile rubocop-performance:gemfile rubocop-rails:gemfile rubocop-rspec:gemfile
reporter: github-pr-check
only_changed: true
4 changes: 2 additions & 2 deletions spec/requests/api/v3/projects/copy/copy_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

subject(:response) { last_response }

# rubocop:disable RSpec/Rails/HaveHttpStatus
# rubocop:disable RSpecRails/HaveHttpStatus
# those are mock responses that don't deal well with the rails helpers
describe "#POST /api/v3/projects/:id/copy" do
describe "with empty params" do
Expand Down Expand Up @@ -203,5 +203,5 @@
end
end
end
# rubocop:enable RSpec/Rails/HaveHttpStatus
# rubocop:enable RSpecRails/HaveHttpStatus
end
2 changes: 1 addition & 1 deletion spec/requests/api/v3/work_packages/update_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@

include_context "patch request"

it { expect(response.status).to eq(200) } # rubocop:disable RSpec/Rails/HaveHttpStatus
it { expect(response.status).to eq(200) } # rubocop:disable RSpecRails/HaveHttpStatus

it "responds with updated finish date" do
expect(subject.body).to be_json_eql(duration.to_json).at_path("remainingTime")
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/oauth_clients/callback_flow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
set_cookie "oauth_state_asdf1234=#{state_cookie}"
end

# rubocop:disable RSpec/Rails/HaveHttpStatus
# rubocop:disable RSpecRails/HaveHttpStatus
shared_examples "with errors and state param with cookie, not being admin" do
it "redirects to URI referenced in the state param and held in a cookie" do
expect(response.status).to eq(302)
Expand Down Expand Up @@ -185,6 +185,6 @@

it_behaves_like "fallback redirect"
end
# rubocop:enable RSpec/Rails/HaveHttpStatus
# rubocop:enable RSpecRails/HaveHttpStatus
end
end

0 comments on commit d5d0311

Please sign in to comment.