-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Standard Lint #1
Conversation
TonyCTHsu
commented
May 6, 2024
- Add Standard Lint
- Update gemspec and lint target version to 2.5
- Add Github action for linting
'rubygems_mfa_required' => 'true', | ||
'source_code_uri' => 'https://github.com/lloeki/graft', | ||
s.name = "graft" | ||
s.version = "0.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically a case where I feel a rule makes the code less readable.
@@ -119,11 +119,11 @@ def wrapper(hook) | |||
strategy: hook.point.instance_variable_get(:@strategy), | |||
args: args, | |||
kwargs: kwargs, | |||
block: block, | |||
block: block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one is soooo annoying: every time you add an item it's making a diff on two lines.
} | ||
supa = proc { |*args, &block| super(*args, &block) } | ||
mid = proc { |_, env| { return: supa.call(*env[:args], &env[:block]) } } | ||
mid = proc { |_, env| {return: supa.call(*env[:args], &env[:block])} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very personal, but my mind just balks at these. It's kind of strange because arrays don't cause me such a reaction.
Maybe that's because arrays are <delimiter><value>, <value><delimiter>
and it parses easily, whereas hashes are <delimiter><key>: <value>, <key>, <value><delimiter>
which binds the <delimiter>
and the <key>
in a single token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said:
irb> {:a=>:b, :c=>:d}.inspect
=> "{:a=>:b, :c=>:d}"
|
||
gem 'rake', '~> 13.1.0' | ||
gem "rake", "~> 13.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm annoyed by this one, because it misses something very real happening:
# frozen_string_literal: true
a = "foo"
a.frozen? # => true
b = "bar #{a}"
b.frozen? # => false
IOW the rule that makes it so '
is used only when there's interpolation indirectly translates to imply '
is a frozen string and "
is not.
Also, "
requires a shift while '
does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not quibble and move forward.