Skip to content

Commit

Permalink
Bump RuboCop version to v1.57.x (#167)
Browse files Browse the repository at this point in the history
Merge pull request 167
  • Loading branch information
ashmaroli authored Oct 30, 2024
1 parent f98e932 commit 477573e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 44 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
- "ubuntu-latest"
- "windows-latest"
ruby_version:
- "2.6"
- "2.7"
- "3.0"
- "3.3"
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -41,7 +40,7 @@ jobs:
fail-fast: false
matrix:
ruby_version:
- 2.6
- "2.7"
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inherit_gem:
rubocop-jekyll: .rubocop.yml

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
SuggestExtensions: false
Exclude:
- vendor/**/*
Expand Down
31 changes: 3 additions & 28 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-09-22 14:14:54 UTC using RuboCop version 1.18.4.
# `rubocop --auto-gen-config --auto-gen-only-exclude`
# on 2024-10-28 15:58:10 UTC using RuboCop version 1.57.2.
# 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
Expand All @@ -14,32 +14,7 @@ Lint/ConstantDefinitionInBlock:
- 'spec/spec_helper.rb'

# Offense count: 1
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 1
# Configuration parameters: IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/PerceivedComplexity:
Max: 10

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: SafeMultiline.
Performance/DeletePrefix:
Exclude:
- 'lib/jekyll/converters/scss.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantBegin:
Exclude:
- 'lib/jekyll/converters/scss.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:
- 'lib/jekyll/converters/scss.rb'
- 'lib/jekyll/source_map_page.rb'
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ gemspec

gem "jekyll", ENV["JEKYLL_VERSION"] ? "~> #{ENV["JEKYLL_VERSION"]}" : ">= 4.0"
gem "minima"

gem "rake"
gem "rspec", "~> 3.0"
gem "rubocop-jekyll", "~> 0.14.0"
9 changes: 2 additions & 7 deletions jekyll-sass-converter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ Gem::Specification.new do |spec|
spec.files = `git ls-files -z`.split("\x0").grep(%r!^lib/!)
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.6.0"
spec.required_ruby_version = ">= 2.7.0"

spec.add_runtime_dependency "sass-embedded", "~> 1.54"

spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0"
spec.add_dependency "sass-embedded", "~> 1.54"
end
8 changes: 4 additions & 4 deletions lib/jekyll/converters/scss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def user_sass_load_paths

def sass_dir_relative_to_site_source
@sass_dir_relative_to_site_source ||=
Jekyll.sanitized_path(site_source, sass_dir).sub(site.source + "/", "")
Jekyll.sanitized_path(site_source, sass_dir).delete_prefix("#{site.source}/")
end

# rubocop:disable Metrics/AbcSize
Expand Down Expand Up @@ -190,7 +190,7 @@ def associate_page_failed?

# Returns `true` if jekyll is serving with livereload.
def livereload?
!!@config["serving"] && !!@config["livereload"]
!!(@config["serving"] && @config["livereload"])
end

# The URL of the input scss (or sass) file. This information will be used for error reporting.
Expand Down Expand Up @@ -240,7 +240,7 @@ def sass_source_root
def process_source_map(source_map)
map_data = JSON.parse(source_map)
unless associate_page_failed?
map_data["file"] = Addressable::URI.encode(sass_page.basename + ".css")
map_data["file"] = Addressable::URI.encode("#{sass_page.basename}.css")
end
source_root_url = Addressable::URI.parse(file_url_from_path("#{sass_source_root}/"))
map_data["sources"].map! do |s|
Expand All @@ -261,7 +261,7 @@ def generate_source_map_page(source_map)
def source_mapping_url
return if associate_page_failed?

Addressable::URI.encode(sass_page.basename + ".css.map")
Addressable::URI.encode("#{sass_page.basename}.css.map")
end

def site
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/source_map_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(css_page)
@site = css_page.site
@dir = css_page.dir
@data = css_page.data
@name = css_page.basename + ".css.map"
@name = "#{css_page.basename}.css.map"

process(@name)
Jekyll::Hooks.trigger :pages, :post_init, self
Expand Down

0 comments on commit 477573e

Please sign in to comment.