diff --git a/config/default.yml b/config/default.yml index 7419c02..ec0b318 100644 --- a/config/default.yml +++ b/config/default.yml @@ -1,25 +1,36 @@ # This is the default configuration file. Packaging/BundlerSetupInTests: - Description: 'Avoid using `bundler/setup` in your tests.' + Description: >- + Using `bundler/setup` in tests is redundant. Consider + removing it. Enabled: true VersionAdded: '0.4' VersionChanged: '0.5' Packaging/GemspecGit: - Description: 'Use pure Ruby alternative instead of `git ls-files`.' + Description: >- + Using `bundler/setup` in tests is redundant. Consider + Avoid using git to produce lists of files. Downstreams + often need to build your package in an environment + that does not have git (on purpose). Use some pure + Ruby alternative, like `Dir` or `Dir.glob`. Enabled: true VersionAdded: '0.1' VersionChanged: '0.1' Packaging/RequireHardcodingLib: - Description: 'Avoid using `require` with relative path to lib.' + Description: >- + Avoid using `require` with relative path to lib. Use + `require` with absolute path instead. Enabled: true VersionAdded: '0.4' VersionChanged: '0.5' Packaging/RequireRelativeHardcodingLib: - Description: 'Avoid using `require_relative` with relative path to lib.' + Description: >- + Avoid using `require_relative` with relative path to + lib. Use `require` with absolute path instead. Enabled: true VersionAdded: '0.2' VersionChanged: '0.5' diff --git a/lib/rubocop/cop/packaging/bundler_setup_in_tests.rb b/lib/rubocop/cop/packaging/bundler_setup_in_tests.rb index 77c53fd..7c811f3 100644 --- a/lib/rubocop/cop/packaging/bundler_setup_in_tests.rb +++ b/lib/rubocop/cop/packaging/bundler_setup_in_tests.rb @@ -24,7 +24,7 @@ class BundlerSetupInTests < Base # This is the message that will be displayed when RuboCop::Packaging finds # an offense of using `require "bundler/setup"` in the tests directory. - MSG = "Avoid using `bundler/setup` in your tests." + MSG = "Using `bundler/setup` in tests is redundant. Consider removing it." def_node_matcher :bundler_setup?, <<~PATTERN (send nil? :require diff --git a/lib/rubocop/cop/packaging/gemspec_git.rb b/lib/rubocop/cop/packaging/gemspec_git.rb index afa88f6..4cb5471 100644 --- a/lib/rubocop/cop/packaging/gemspec_git.rb +++ b/lib/rubocop/cop/packaging/gemspec_git.rb @@ -53,9 +53,9 @@ class GemspecGit < Base # This is the message that will be displayed when RuboCop finds an # offense of using `git ls-files`. MSG = "Avoid using git to produce lists of files. " \ - "Downstreams often need to build your package in an environment " \ - "that does not have git (on purpose). " \ - "Use some pure Ruby alternative, like `Dir` or `Dir.glob`." + "Downstreams often need to build your package in an environment " \ + "that does not have git (on purpose). " \ + "Use some pure Ruby alternative, like `Dir` or `Dir.glob`." def_node_search :xstr, <<~PATTERN (block diff --git a/lib/rubocop/cop/packaging/require_hardcoding_lib.rb b/lib/rubocop/cop/packaging/require_hardcoding_lib.rb index a7c7719..581e234 100644 --- a/lib/rubocop/cop/packaging/require_hardcoding_lib.rb +++ b/lib/rubocop/cop/packaging/require_hardcoding_lib.rb @@ -40,7 +40,8 @@ class RequireHardcodingLib < Base # This is the message that will be displayed when RuboCop::Packaging # finds an offense of using `require` with relative path to lib. - MSG = "Avoid using `require` with relative path to `lib/`." + MSG = "Avoid using `require` with relative path to `lib/`. " \ + "Use `require` with absolute path instead." def_node_matcher :require?, <<~PATTERN {(send nil? :require (str #falls_in_lib?)) diff --git a/lib/rubocop/cop/packaging/require_relative_hardcoding_lib.rb b/lib/rubocop/cop/packaging/require_relative_hardcoding_lib.rb index fcc1896..e356000 100644 --- a/lib/rubocop/cop/packaging/require_relative_hardcoding_lib.rb +++ b/lib/rubocop/cop/packaging/require_relative_hardcoding_lib.rb @@ -34,7 +34,7 @@ class RequireRelativeHardcodingLib < Base # This is the message that will be displayed when RuboCop finds an # offense of using `require_relative` with relative path to lib. MSG = "Avoid using `require_relative` with relative path to lib. " \ - "Use `require` instead." + "Use `require` with absolute path instead." def_node_matcher :require_relative, <<~PATTERN (send nil? :require_relative