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

[TASK] Fix the autocorrectable RuboCop warnings #171

Closed
wants to merge 1 commit into from
Closed
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
50 changes: 2 additions & 48 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 10000`
# on 2023-10-05 13:54:27 UTC using RuboCop version 1.56.4.
# `rubocop --auto-gen-config`
# on 2023-10-06 14:51:19 UTC using RuboCop version 1.56.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
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/DeprecatedAttributeAssignment:
Exclude:
- 'page_title_helper.gemspec'

# Offense count: 5
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
Gemspec/DevelopmentDependencies:
Exclude:
- 'page_title_helper.gemspec'

# Offense count: 1
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Expand All @@ -39,37 +23,7 @@ Metrics/BlockLength:
Metrics/ClassLength:
Max: 105

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'test/test_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/RootPathnameMethods:
Exclude:
- 'lib/page_title_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'page_title_helper.gemspec'

# Offense count: 1
Style/MixinUsage:
Exclude:
- 'Rakefile'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, Autocorrect.
# SupportedStyles: module_function, extend_self, forbidden
Style/ModuleFunction:
Exclude:
- 'lib/page_title_helper.rb'
4 changes: 2 additions & 2 deletions lib/page_title_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
module PageTitleHelper
# https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/interpolations.rb
module Interpolations
extend self
module_function

def self.interpolate(pattern, *args)
instance_methods(false).sort.reverse.inject(pattern.to_s.dup) do |result, tag|
Expand All @@ -25,7 +25,7 @@ def self.interpolate(pattern, *args)
end

def app(env)
env[:app] || I18n.t('app.name', default: File.basename(Rails.root).humanize)
env[:app] || I18n.t('app.name', default: Rails.root.basename.humanize)
end

def title(env)
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
module Rails
class << self
def root
@pathname ||= Pathname.new('/this/is/just/for/testing/page_title_helper')
@root ||= Pathname.new('/this/is/just/for/testing/page_title_helper')
end

def env
Expand Down