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

comment on first method in a class << super block is aligned incorrectly #412

Open
alexdean opened this issue Feb 15, 2023 · 2 comments · Fixed by #420
Open

comment on first method in a class << super block is aligned incorrectly #412

alexdean opened this issue Feb 15, 2023 · 2 comments · Fixed by #420

Comments

@alexdean
Copy link

alexdean commented Feb 15, 2023

  • Ruby version: 2.6.4 and 3.1.2 (maybe others. those were the 2 i checked.)
  • Rubyfmt git sha: unsure. installed via homebrew.
-> % rubyfmt -V
rubyfmt-main 0.8.1

Input file

class A
  class << self
    # docstring for foo
    def foo
    end
  end
end

Rubyfmt's output

class A
  class << self
  # docstring for foo
    def foo
    end
  end
end

This breaks because

The comment is no longer aligned with the method it is intended to describe.

@alexdean
Copy link
Author

superficially this seems similar to #295, but i'm not sure if that's actually the case or not.

@reese
Copy link
Collaborator

reese commented Dec 6, 2023

(Reopening this because I had to revert the fix for this in #441, I/anyone can try and re-land this eventually)

@reese reese reopened this Dec 6, 2023
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 a pull request may close this issue.

2 participants