Skip to content

Commit

Permalink
rubocop fixes for the gem's code
Browse files Browse the repository at this point in the history
  • Loading branch information
swiknaba committed Mar 19, 2024
1 parent a4543ed commit 2bc5083
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
inherit_from: ./config/dbl.yml

Sorbet/StrictSigil:
Enabled: false
17 changes: 10 additions & 7 deletions lib/generators/rubocop_dbl/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ class InstallGenerator < Rails::Generators::Base
def create_config_file
file_method = config_file_exists? ? :prepend : :create
content = defined?(Rails) ? config_file_content_rails : config_file_content
send :"#{file_method}_file", config_file_path, config_file_content
end

private
send(
:"#{file_method}_file",
config_file_path,
content,
)
end

def config_file_exists?
private def config_file_exists?
File.exist?(config_file_path)
end

def config_file_path
private def config_file_path
'.rubocop.yml'
end

def config_file_content
private def config_file_content
<<~HEREDOC
inherit_gem:
rubocop-dbl:
Expand All @@ -42,7 +45,7 @@ def config_file_content
HEREDOC
end

def config_file_content_rails
private def config_file_content_rails
<<~HEREDOC
require:
- rubocop-rails
Expand Down

0 comments on commit 2bc5083

Please sign in to comment.