diff --git a/docs/modules/ROOT/pages/cops_lint.adoc b/docs/modules/ROOT/pages/cops_lint.adoc index 5693680f8b1..925ec93c28b 100644 --- a/docs/modules/ROOT/pages/cops_lint.adoc +++ b/docs/modules/ROOT/pages/cops_lint.adoc @@ -322,7 +322,18 @@ end | - |=== -Check that constants are fully qualified. +Check that certain constants are fully qualified. + +This is not enabled by default because it would mark a lot of offenses +unnecessarily. + +Generally, gems should fully qualify all constants to avoid conflicts with +the code that uses the gem. Enable this cop without using `Only`/`Ignore` + +Large projects will over time end up with one or two constant names that +are problematic because of a conflict with a library or just internally +using the same name a namespace and a class. To avoid too many unnecessary +offenses, Enable this cop with `Only: [The, Constant, Names, Causing, Issues]` === Examples diff --git a/lib/rubocop/cop/lint/constant_resolution.rb b/lib/rubocop/cop/lint/constant_resolution.rb index 22fcbebcb88..15eb7a755f2 100644 --- a/lib/rubocop/cop/lint/constant_resolution.rb +++ b/lib/rubocop/cop/lint/constant_resolution.rb @@ -3,7 +3,18 @@ module RuboCop module Cop module Lint - # Check that constants are fully qualified. + # Check that certain constants are fully qualified. + # + # This is not enabled by default because it would mark a lot of offenses + # unnecessarily. + # + # Generally, gems should fully qualify all constants to avoid conflicts with + # the code that uses the gem. Enable this cop without using `Only`/`Ignore` + # + # Large projects will over time end up with one or two constant names that + # are problematic because of a conflict with a library or just internally + # using the same name a namespace and a class. To avoid too many unnecessary + # offenses, Enable this cop with `Only: [The, Constant, Names, Causing, Issues]` # # @example # # By default checks every constant