-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use Rufo in GraphQL-Ruby #1800
Use Rufo in GraphQL-Ruby #1800
Conversation
@@ -12,7 +13,7 @@ module Analysis | |||
# | |||
class MaxQueryDepth < GraphQL::Analysis::QueryDepth | |||
def initialize(max_depth) | |||
disallow_excessive_depth = ->(query, depth) { | |||
disallow_excessive_depth = -> (query, depth) { |
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.
The no-space Procs were originially introduced because someone wanted to support Ruby 1.9. AFAIK they gave up, and don't actually use GraphQL-Ruby after all. So this will be a big change, but probably OK.
"... and 1 more line\n" | ||
else | ||
"... and #{cause_backtrace_remainder_length} more lines\n" | ||
end |
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.
Personally I don't like it but w/e
enum Enum { | ||
VALUE | ||
} | ||
""") | ||
" "") |
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.
Wow, I guess this is just a funny bug? I think the person was imagining Python or GraphQL triple-quotes, and it happened to work because of a rarely-used string concatenation feature:
$ irb
irb(main):001:0> "abc" "def"
# => "abcdef"
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.
🤔 ruby strings aren't multiline by default though, so how would this work?
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.
irb(main):002:0> "" "some stuff
irb(main):003:0" is here" ""
=> "some stuff \nis here"
Equivalent to:
irb(main):004:0> "some stuff
irb(main):005:0" is here"
=> "some stuff \nis here"
I'm not familiar with Rufo, but it looks like a more opinionated Rubocop? Is there a reason you prefer this over Rubocop? |
only because Yeah, I'm not too crazy about its indentation rules, so I think I may just lean more on Rubocop instead. |
I'm interested in using https://github.com/ruby-formatter/rufo to standardize style, I wonder how it will work in this project.