You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat rubocop_compact_autocorrect_bad.rb
# frozen_string_literal: true
# Foo classclass Foo # Foo::Bar class class Bar # Foo::Bar#baz method def baz 'baz' end endendmodule Foo class Bar # Foo::Bar#quux method def quux 'quux' end endend
$ ruby rubocop_compact_autocorrect_bad.rbTraceback (most recent call last):rubocop_compact_autocorrect_bad.rb:14:in `<main>': Foo is not a module (TypeError)
Steps to reproduce the problem
This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.
bundle exec rubocop -A [source]
RuboCop version
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:
…oduleChildren`
Fixesrubocop#9128.
This PR fixes an incorrect auto-correct for `Style/ClassAndModuleChildren`
when namespace is defined as a class in the same file.
It is still undetectable when class definition exists in the different file,
but it can be detected in the same file. This PR solves the latter.
…ildren`
Fixes#9128.
This PR fixes an incorrect auto-correct for `Style/ClassAndModuleChildren`
when namespace is defined as a class in the same file.
It is still undetectable when class definition exists in the different file,
but it can be detected in the same file. This PR solves the latter.
RuboCop incorrectly expands compact style class reopenings to use
module
for the parent if the parent is aClass
.Expected behavior
Describe here how you expected RuboCop to behave in this particular situation.
Input
Expected output
Actual behavior
Describe here what actually happened.
Please use
rubocop --debug
when pasting rubocop output as it contains additional information.Input
Expected output
Executing the bad correction code
Steps to reproduce the problem
This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.
bundle exec rubocop -A [source]
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler.If you see extension cop versions (e.g.
rubocop-performance
,rubocop-rspec
, and others)output by
rubocop -V
, include them as well. Here's an example:The text was updated successfully, but these errors were encountered: