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

Bump RuboCop to v1.18.x via rubocop-jekyll #291

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ jobs:
bundler-cache: true
- name: Test Gem Build
run: bundle exec gem build jekyll-sitemap.gemspec

style_check:
name: "Style Check (Ruby ${{ matrix.ruby_version }})"
runs-on: "ubuntu-latest"
strategy:
matrix:
ruby_version:
- 2.5
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: "Set Up Ruby ${{ matrix.ruby_version }}"
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Run RuboCop
run: bash script/fmt
32 changes: 31 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ inherit_gem:
rubocop-jekyll: .rubocop.yml

AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5
SuggestExtensions: false
Exclude:
- vendor/**/*

Layout/LineEndStringConcatenationIndentation:
Enabled: true

Lint/Debugger:
Exclude:
- script/console
Lint/EmptyInPattern:
Enabled: false

Naming/InclusiveLanguage:
Enabled: false
Naming/MemoizedInstanceVariableName:
Exclude:
- lib/jekyll-feed/page-without-a-file.rb

Performance/MapCompact:
Enabled: true
Performance/RedundantEqualityComparisonBlock:
Enabled: true
Performance/RedundantSplitRegexpArgument:
Enabled: true

Style/InPatternThen:
Enabled: false
Style/MultilineInPatternThen:
Enabled: false
Style/QuotedSymbols:
Enabled: true
27 changes: 11 additions & 16 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-12-06 11:55:46 +0100 using RuboCop version 0.61.1.
# on 2021-11-15 14:30:50 UTC using RuboCop version 1.18.4.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
Lint/Debugger:
Exclude:
- 'script/console'
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 138

# Offense count: 3
# Configuration parameters: CountComments, Max, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
# Offense count: 4
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/jekyll-sitemap_spec.rb'
- 'spec/test_jekyll-last-modified-at.rb'

# Offense count: 17
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 154
- 'spec/spec_helper.rb'
4 changes: 2 additions & 2 deletions jekyll-sitemap.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.4.0"
spec.required_ruby_version = ">= 2.5.0"

spec.add_dependency "jekyll", ">= 3.7", "< 5.0"

spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop-jekyll", "~> 0.4"
spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0"
end
2 changes: 1 addition & 1 deletion script/fmt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

echo "Rubocop $(bundle exec rubocop --version)"
echo "RuboCop $(bundle exec rubocop --version)"
bundle exec rubocop -D -E $@
success=$?
if ((success != 0)); then
Expand Down