Skip to content

Commit

Permalink
chore: apply rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
3v0k4 committed Dec 4, 2024
1 parent 0433a46 commit dc8a00a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,25 @@ Style/StringLiteralsInInterpolation:

Layout/LineLength:
Max: 120

Metrics/ClassLength:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/BlockLength:
Enabled: false

Minitest/EmptyLineBeforeAssertionMethods:
Enabled: false

Naming/MethodParameterName:
Enabled: false

Naming/VariableNumber:
Enabled: false

Style/Documentation:
Enabled: false

5 changes: 4 additions & 1 deletion degem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ Gem::Specification.new do |spec|
spec.email = ["[email protected]"]

spec.summary = "Find unused gems in the Ruby bundle"
spec.description = "Degem finds unused gems in the Ruby bundle (ie, an app with a `Gemfile` or a gem with both a `Gemfile` and a gemspec)."
spec.description = [
"Degem finds unused gems in the Ruby bundle",
"(ie, an app with a `Gemfile` or a gem with both a `Gemfile` and a gemspec)."
].join(" ")
spec.homepage = "https://github.com/3v0k4/degem"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.1.0"
Expand Down
4 changes: 2 additions & 2 deletions lib/degem/find_unused.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def based_on_top_composite_call(rubygem, line)
regex = %r{
(?<!\w::) # Do not match if :: before
(?<!\w) # Do not match if \w before
#{rubygem.name.split("-").map(&:capitalize).join("")}
#{rubygem.name.split("-").map(&:capitalize).join}
\.
}x
regex.match?(line)
Expand Down Expand Up @@ -128,7 +128,7 @@ def based_on_require_path(rubygem, line)
require
\s+
['"]
#{rubygem.name.gsub("-", "\/")} # match foo/bar when rubygem is foo-bar
#{rubygem.name.tr("-", "/")} # match foo/bar when rubygem is foo-bar
['"]
}x
regex.match?(line)
Expand Down

0 comments on commit dc8a00a

Please sign in to comment.