Skip to content

Commit

Permalink
Merge pull request #668 from github/rubocop-github-gem
Browse files Browse the repository at this point in the history
Use rubocop-github gem to check our code
  • Loading branch information
parkr committed Jan 24, 2020
2 parents 6d094ae + 6fc908a commit b0f8cff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
23 changes: 15 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
#
# If you disable a check, document why.

inherit_gem:
rubocop-github:
- config/default.yml

require:
- rubocop-performance

AllCops:
TargetRubyVersion: 2.3
Exclude:
Expand Down Expand Up @@ -48,10 +55,10 @@ Style/HashSyntax:
EnforcedStyle: hash_rockets
Severity: error

Layout/AlignHash:
Layout/HashAlignment:
SupportedLastArgumentHashStyles: always_ignore

Layout/AlignParameters:
Layout/ParameterAlignment:
Enabled: false # This is usually true, but we often want to roll back to
# the start of a line.

Expand All @@ -78,7 +85,7 @@ Metrics/BlockLength:
- github-pages.gemspec
- !ruby/regexp /spec\/.*.rb/

Metrics/LineLength:
Layout/LineLength:
Max: 90
Severity: warning
Exclude:
Expand Down Expand Up @@ -122,9 +129,6 @@ Metrics/ParameterLists:
Metrics/AbcSize:
Max: 20

Layout/IndentFirstHashElement:
EnforcedStyle: consistent

Style/SignalException:
EnforcedStyle: only_raise

Expand All @@ -134,10 +138,13 @@ Layout/MultilineMethodCallIndentation:
Layout/MultilineOperationIndentation:
EnforcedStyle: indented

Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
EnforcedStyle: consistent

Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

Layout/IndentFirstArrayElement:
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Layout/ExtraSpacing:
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ gemspec
gem "jekyll-octicons"

group :test do
gem "rubocop", "~> 0.79"
gem "rubocop-performance"
gem "webmock"
end
2 changes: 1 addition & 1 deletion github-pages.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Gem::Specification.new do |s|
s.add_development_dependency("jekyll_test_plugin_malicious", "~> 0.2")
s.add_development_dependency("pry", "~> 0.10")
s.add_development_dependency("rspec", "~> 3.3")
s.add_development_dependency("rubocop", "~> 0.76") # CVE-2017-8418
s.add_development_dependency("rubocop-github", "0.14.0")
end

0 comments on commit b0f8cff

Please sign in to comment.