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

rubyfmt compatibility #482

Open
fables-tales opened this issue Nov 10, 2022 · 2 comments
Open

rubyfmt compatibility #482

fables-tales opened this issue Nov 10, 2022 · 2 comments

Comments

@fables-tales
Copy link

there was only one formatting issue when we compat checked standard and rubyfmt which is how it formats something like this:

module Foo
  
  # the blankline above is what rubyfmt does, standard removes it
  def bees
  end
end

if we fix this then standard should be formattingwise compatible with rubyfmt

@schpet
Copy link

schpet commented Feb 2, 2023

i was hoping to start using rubyfmt in my project and ran into a few conflicts. i setup a small repro here:

schpet/ruby-fmt-standard#1

the github actions output show some of the errors:

  example.rb:4:7: Layout/SpaceInLambdaLiteral: Do not use spaces between `->` and `(` in lambda literals.
  example.rb:11:1: Layout/EmptyLinesAroundExceptionHandlingKeywords: Extra empty line detected before the `rescue`.
  example.rb:17:17: Style/MethodCallWithoutArgsParentheses: Do not use parentheses for method calls with no arguments.

as a workaround i can use rubocop's --except Layout,Style

bundle exec standardrb --except Layout,Style

but i'm wondering if it would make sense to be able to turn these off in the standard.yml file (i.e. formatting: false or similar)

@searls
Copy link
Contributor

searls commented Feb 16, 2023

@schpet thanks for posting this! The long-term goal of Standard & rubyfmt has always been eventual agreement in formatting rules. FWIW, my opinion here is the Layout/EmptyLinesAroundExceptionHandlingKeywords and Style/MethodCallWithoutArgsParentheses rules are appropriate and I'd like to keep them.

I am indifferent about Layout/SpaceInLambdaLiteral and could probably be swayed that stabby lambdas (->()) are kinda weird and it'd be more consistent to put a space there if other folks aren't too in love with that style

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

No branches or pull requests

3 participants