Skip to content

Commit

Permalink
Change cop name to RequireHardcodingLib
Browse files Browse the repository at this point in the history
The cop name, RelativeWithRelativePath, wasn't generic
and wasn't clear enough by the name as to what this
cop is trying to do.

Therefore, renaming to RequireHardcodingLib.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
  • Loading branch information
utkarsh2102 committed Sep 19, 2020
1 parent 8c658ef commit 3eb9c87
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Packaging/GemspecGit:
VersionAdded: '0.1'
VersionChanged: '0.1'

Packaging/RequireRelativeHardcodingLib:
Description: 'Avoid using `require_relative` with relative path to lib.'
Packaging/RequireHardcodingLib:
Description: 'Avoid using `require` with relative path to lib.'
Enabled: true
VersionAdded: '0.2'
VersionAdded: '0.4'
VersionChanged: '0.5'

Packaging/RequireWithRelativePath:
Description: 'Avoid using `require` with relative path to lib.'
Packaging/RequireRelativeHardcodingLib:
Description: 'Avoid using `require_relative` with relative path to lib.'
Enabled: true
VersionAdded: '0.4'
VersionAdded: '0.2'
VersionChanged: '0.5'
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module Packaging # :nodoc:
# # good
# require "baz/qux"
#
class RequireWithRelativePath < Base
class RequireHardcodingLib < Base
include RuboCop::Packaging::LibHelperModule
extend AutoCorrector

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/packaging_cops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

require_relative "packaging/bundler_setup_in_tests"
require_relative "packaging/gemspec_git"
require_relative "packaging/require_hardcoding_lib"
require_relative "packaging/require_relative_hardcoding_lib"
require_relative "packaging/require_with_relative_path"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe RuboCop::Cop::Packaging::RequireWithRelativePath, :config do
let(:message) { RuboCop::Cop::Packaging::RequireWithRelativePath::MSG }
RSpec.describe RuboCop::Cop::Packaging::RequireHardcodingLib, :config do
let(:message) { RuboCop::Cop::Packaging::RequireHardcodingLib::MSG }

let(:project_root) { RuboCop::ConfigLoader.project_root }

Expand Down

0 comments on commit 3eb9c87

Please sign in to comment.