Skip to content

Ignore frozen-string-literal magic comment #389

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

Closed
jeremyevans opened this issue Jan 25, 2016 · 2 comments
Closed

Ignore frozen-string-literal magic comment #389

jeremyevans opened this issue Jan 25, 2016 · 2 comments
Labels

Comments

@jeremyevans
Copy link
Contributor

frozen-string-literal magic comments are parsed and appear in the rdoc output as text in the file level comment. This can result in the ignoring of a file level comment that comes after the magic comment, if there is a line of whitespace between the magic comment line and the file level comment.

@zzak
Copy link
Member

zzak commented Jan 26, 2016

Nice, sorry I missed this one.

Thanks for the report!

@zzak zzak added the bug label Mar 23, 2016
@halostatue
Copy link

halostatue commented May 3, 2016

I don’t often have file-level comments, but as I don’t typically use the Seattle-style for my class comments (below), I end up with frozen_string_literal: true in the documentation for the first class or module in the file.

# Not Seattle-style.
class Foo; end

##
# Seattle-style.
class Bar; end

If I nest namespaces in a bunch of files, I end up with frozen_string_literal: true in the documentation for the outer namespace for each file that has this construct:

# frozen_string_literal: true

module Namespace
  # A class that I care about.
  class ThatICareAbout
  end
end

Each file that contains Namespace without the “hey! here’s a documentation comment” marker (the Seattle-style ##) results in another frozen_string_literal: true being added to the top of the Namespace documentation.

@halostatue halostatue mentioned this issue May 3, 2016
jeremyevans added a commit to jeremyevans/rdoc that referenced this issue May 20, 2016
I believe that ruby supports magic comments in any order. Note
that ruby appears to support a warn_indent magic comment which
this doesn't handle.
@zzak zzak closed this as completed in 653ac30 Jul 14, 2016
zzak pushed a commit that referenced this issue Jul 14, 2016
Ignore frozen_string_literal magic comment (Fixes #389)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants