Skip to content

Commit

Permalink
Bump rubocop-jekyll to 0.13.0 and fix rubocop issues (#252)
Browse files Browse the repository at this point in the history
Merge pull request 252
  • Loading branch information
dunkmann00 authored Mar 2, 2023
1 parent a6e9e59 commit e8abde0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AllCops:
- vendor/**/*
- script/*

Metrics/LineLength:
Layout/LineLength:
Enabled: false

Metrics/BlockLength:
Expand All @@ -24,6 +24,9 @@ Metrics/MethodLength:
Style/AccessModifierDeclarations:
Enabled: false

Style/FetchEnvVar:
Enabled: false

Style/FrozenStringLiteralComment:
Exclude:
- lib/jekyll-github-metadata/site_github_munger.rb
Expand Down
2 changes: 1 addition & 1 deletion jekyll-github-metadata.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "pry"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec", "~> 3.12.0"
spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0"
spec.add_development_dependency "rubocop-jekyll", "~> 0.13.0"
end
6 changes: 3 additions & 3 deletions lib/jekyll-github-metadata/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ def client_inspect
def pluck_auth_method
if ENV["JEKYLL_GITHUB_TOKEN"] || Octokit.access_token
{ :access_token => ENV["JEKYLL_GITHUB_TOKEN"] || Octokit.access_token }
elsif !ENV["NO_NETRC"] && File.exist?(File.join(ENV["HOME"], ".netrc")) && safe_require("netrc")
elsif !ENV["NO_NETRC"] && File.exist?(File.join(Dir.home, ".netrc")) && safe_require("netrc")
{ :netrc => true }
else
GitHubMetadata.log :warn, "No GitHub API authentication could be found." \
" Some fields may be missing or have incorrect data."
GitHubMetadata.log :warn, "No GitHub API authentication could be found. " \
"Some fields may be missing or have incorrect data."
{}.freeze
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/jekyll-github-metadata/repository_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def nwo
nwo_from_git_origin_remote || \
proc do
raise NoRepositoryError, "No repo name found. " \
"Specify using PAGES_REPO_NWO environment variables, " \
"'repository' in your configuration, or set up an 'origin' " \
"git remote pointing to your github.com repository."
"Specify using PAGES_REPO_NWO environment variables, " \
"'repository' in your configuration, or set up an 'origin' " \
"git remote pointing to your github.com repository."
end.call
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/edit_link_tag_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

subject do
tag = described_class.parse(tag_name, markup, tokenizer, parse_context)
tag.instance_variable_set("@context", render_context)
tag.instance_variable_set(:@context, render_context)
tag
end

Expand Down
2 changes: 1 addition & 1 deletion spec/metadata_drop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

context "with fallback data" do
let(:fallback_data) { { "foo" => "bar" } }
before { subject.instance_variable_set("@fallback_data", fallback_data) }
before { subject.instance_variable_set(:@fallback_data, fallback_data) }

it "returns the mutated value via #[]" do
expect(subject["foo"]).to eql("bar")
Expand Down

0 comments on commit e8abde0

Please sign in to comment.