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

Expand single-letter variable names for better readability #1313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Mar 15, 2025

No description provided.

Copy link

Deploying rdoc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0b054ff
Status: ✅  Deploy successful!
Preview URL: https://1561ea3c.rdoc-6cd.pages.dev
Branch Preview URL: https://expand-variable-names.rdoc-6cd.pages.dev

View logs

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@@ -74,17 +74,17 @@ def self.alias_extension(old_ext, new_ext)
def self.binary?(file)
return false if file =~ /\.(rdoc|txt)$/

s = File.read(file, 1024) or return false
string = File.read(file, 1024) or return false
Copy link
Member

Choose a reason for hiding this comment

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

head or something may be better.

Comment on lines 291 to -292
attributes.each do |attr|
a = RDoc::Attr.new(@container, attr, rw, processed_comment, singleton: @singleton)
Copy link
Member

Choose a reason for hiding this comment

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

attributes.each do |name|
  attr = RDoc::Attr.new(@container, name, ...)

or

attributes.each do |attr_name|
  attr = RDoc::Attr.new(@container, attr_name, ...)

may be better.

handle_modifier_directive(a, line_no)
@container.add_attribute(a) if should_document?(a)
a.visibility = visibility # should set after adding to container
attr_obj = RDoc::Attr.new(nil, symbol.to_s, rw, comment, singleton: @singleton)
Copy link
Member

Choose a reason for hiding this comment

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

attr may be better.

ie.line = line_no
ie.comment = comment
record_location(ie)
include_extend_obj = @container.add(rdoc_class, name, '')
Copy link
Member

Choose a reason for hiding this comment

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

We may be able to remote _obj suffix here.

Copy link
Collaborator

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Nice. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants