Skip to content
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

used name from file path #473

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

rishijain
Copy link
Contributor

@rishijain rishijain commented Oct 18, 2023

Check list:

Description: It fixes this issue.

For a file foo.rb which has code:

module Foo
  class Jj; end
  def bar(x,y,z); end
  class Wtf; end
end

if we run rubycritic foo.rb, all the smells it reports is labelled under file Foo::Jj. Which is not right. For example: for smells reported for def bar(x,y,z) should not be listed under Foo:Jj as that class is closed. It should show Foo.

Snapshot of what it was before and after the change when we run rubycritic foo.rb
Before:
Screenshot 2023-10-18 at 10 55 53 PM

After:
Screenshot 2023-10-18 at 10 57 03 PM

I think it makes more sense to show the class/module name extracted from the file name rather than showing a sub-class within that file for all the smells.

Copy link
Collaborator

@nunosilva800 nunosilva800 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@nunosilva800 nunosilva800 merged commit 1623cee into whitesmith:main Oct 18, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rubycritic does not handle inline classes very well
2 participants