Skip to content

Commit

Permalink
Merge pull request #45 from iiwo/fix_rubocop
Browse files Browse the repository at this point in the history
Fix rubocop
  • Loading branch information
iiwo authored Dec 12, 2023
2 parents d8c890f + 4879d5d commit 09de341
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,21 @@ jobs:
- name: Run tests
run: bundle exec rspec

- name: Rubocop
run: bundle exec rubocop

- name: Report to Code Climate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: c7f705db7f3e2658ca529a196cd65b724f6b674a7ed6ac2e01928135babdac35
with:
coverageCommand: bundle exec rspec # TODO: this should not be needed, but can't make it work
coverageCommand: bundle exec rspec # TODO: this should not be needed, but can't make it work

rubocop_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Rubocop
run: bundle exec rubocop
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AllCops:
Exclude:
- gemfiles/**/*
- vendor/bundle/**/*
TargetRubyVersion: 2.5

Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods
Expand All @@ -29,6 +30,9 @@ RSpec/NestedGroups:
RSpec/MessageSpies:
Enabled: false

Metrics/MethodLength:
Max: 10

Metrics/BlockLength:
Exclude:
- Rakefile
Expand Down
2 changes: 1 addition & 1 deletion lib/easy_tags/parsers/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class << self
def parse(tag_list_string)
return [] if tag_list_string.to_s.empty?

tag_list_string.to_s.split(/,/).map(&:strip)
tag_list_string.to_s.split(',').map(&:strip)
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/easy_tags/taggable_context_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module EasyTags
# def bees_list=
class TaggableContextMethods
class << self
# rubocop:disable Metrics/MethodLength
def inject(class_instance:, context:)
class_instance.class_eval <<-RUBY, __FILE__, __LINE__ + 1 # rubocop:disable Style/DocumentDynamicEvalDefinition
has_many(
Expand Down Expand Up @@ -57,6 +58,7 @@ def #{context}_list_persisted
end
RUBY
end
# rubocop:enable Metrics/MethodLength
end
end
end

0 comments on commit 09de341

Please sign in to comment.