Skip to content

Commit

Permalink
Lock RuboCop to v1.18.x (#348)
Browse files Browse the repository at this point in the history
Merge pull request 348
  • Loading branch information
ashmaroli committed Sep 17, 2021
1 parent 6d4913f commit 04b759b
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 21 deletions.
39 changes: 25 additions & 14 deletions .rubocop.yml
@@ -1,27 +1,38 @@
inherit_from: .rubocop_todo.yml

require: rubocop-jekyll

inherit_gem:
rubocop-jekyll: .rubocop.yml

AllCops:
TargetRubyVersion: 2.4
Include:
- lib/**/*.rb

TargetRubyVersion: 2.5
SuggestExtensions: false
Exclude:
- .gitignore
- .rspec
- .rubocop.yml
- .travis.yml
- vendor/**/*

- Gemfile.lock
- History.markdown
- LICENSE.txt
- README.md
Layout/LineEndStringConcatenationIndentation:
Enabled: true

- script/**/*
- vendor/**/*
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
65 changes: 65 additions & 0 deletions .rubocop_todo.yml
@@ -0,0 +1,65 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-09-17 11:44:51 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
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 15
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 144

# Offense count: 3
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/jekyll-feed_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 3
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
Performance/StringInclude:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'spec/jekyll-feed_spec.rb'
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -3,9 +3,9 @@
source "https://rubygems.org"
gemspec

gem "rss" if RUBY_VERSION >= "3.0.0"
gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
gem "kramdown-parser-gfm" if ENV["JEKYLL_VERSION"] == "~> 3.9"
gem "rss" if RUBY_VERSION >= "3.0.0"

install_if -> { Gem.win_platform? } do
gem "tzinfo", "~> 1.2"
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Expand Up @@ -11,7 +11,6 @@ environment:
- RUBY_FOLDER_VER: "26"
JEKYLL_VERSION : ">= 4.0.0.pre.alpha1"
- RUBY_FOLDER_VER: "26"
- RUBY_FOLDER_VER: "24"

install:
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%-x64\bin;%PATH%
Expand Down
4 changes: 2 additions & 2 deletions jekyll-feed.gemspec
Expand Up @@ -16,14 +16,14 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r!^spec/!)
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 "nokogiri", "~> 1.6"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop-jekyll", "~> 0.5"
spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0"
spec.add_development_dependency "typhoeus", ">= 0.7", "< 2.0"
end
5 changes: 3 additions & 2 deletions lib/jekyll-feed/generator.rb
Expand Up @@ -54,9 +54,10 @@ def feed_path(collection: "posts", category: nil)
def collections
return @collections if defined?(@collections)

@collections = if config["collections"].is_a?(Array)
@collections = case config["collections"]
when Array
config["collections"].map { |c| [c, {}] }.to_h
elsif config["collections"].is_a?(Hash)
when Hash
config["collections"]
else
{}
Expand Down
2 changes: 1 addition & 1 deletion script/fmt
@@ -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

0 comments on commit 04b759b

Please sign in to comment.