Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubocop check #15416

Merged
merged 5 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading