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
Detect top-level constant usage like ::Const
#8245
Commits on Jul 6, 2020
-
Detect ::Class.new in EnforceSuperclass mixin
Detect `::Class.new` and `Class.new` in EnforceSuperclass mixin, with or without a block.
-
Detect top-level ::RUBY_VERSION in gemspec
Detect `::RUBY_VERSION` in Gemspec/RubyVersionGlobalsUsage cop.
-
Detect top-level constants in NestedMethodDefinition
Detect `::Class.new`, `::Module.new`, `::Struct.new` in top-level namespace for Lint/NestedMethodDefinition.
-
Detect ::Dir in NonDeterministicRequireOrder
Detect top-level constant `::Dir` in Lint/NonDeterministicRequireOrder.
-
Detect top-level constant `::Kernel.rand(1)` in Lint/RandOne cop.
-
Detect redundant ::Array splat
Detect redundant array splat with top-level constant `::Array`.
-
-
Detect top-level constants in UselessAccessModifier
Detect useless access modifier in `::Class.new`, `::Module.new`, `::Struct.new` blocks.
-
Detect top-level constants in class/module length cops
Detect `::Class.new`, `::Module.new` in Metrics/ClassLength and Metrics/ModuleLength cops.
-
Allow historic DateTime with ::Date constant
Allow historic DateTime using `::Date` constants in Style/DateTime cop.
-
-
Detect top-level constants in Style/EmptyLiteral
Detect `::Array.new`, `::Hash.new`, `::String.new` producing empty literals.
-
Detect ::Proc.new in Style/Proc
Detect `::Proc.new` with a block in Style/Proc.
-
-
Detect ::Kernel in Style/SignalException
Detect with top-level constant as `::Kernel.raise` and `::Kernel.fail`
-
-
-
-
Allow top-level const in Style/ZeroLengthPredicate
Allow `::File.stat`, `::Tempfile.new`, `::StringIO.new`
-
-
-
Detect top-level const in RandomWithOffset
Detect `::Random.rand`, `::Kernel.rand` in Style/RandomWithOffset.
-
Detect top-level const in ExpandPathArguments
Detect `::File.expand_path`, `::Pathname.new` in Style/ExpandPathArguments cop.
-
Allow top-level const in MutableConst
Allow top-level `::ENV`, `::Struct` in Style/MutableConstant cop.