-
Notifications
You must be signed in to change notification settings - Fork 203
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
Make Style/MethodDefParentheses enabled by default (custom config) #213
Comments
What do you mean to say is unambiguous about the results? That those projects use parentheses in method definitions? In any case, we're intentionally flexible about enforcing whether method defs and invocations use parentheses, because we want to be inclusive of Rubyists from Seattle But in all seriousness, this isn't something that I think Standard should be in the business of constraining people on. The freedom to express yourself with a bare minimum of supporting syntax is one of Ruby's strengths, and tamping that down just for the sake of uniformity would be a real shame. |
Yes, that's exactly what I meant.
That's right. When comparing minitest and flog, the results where quite the opposite to the ones from the table.
Understood. |
You can if you do something like this and use standard rules, but use rubocop instead: #158 (comment) |
Thank you for pointing that. Works like a charm 🎉 For anyone who stumbled this:
require:
- standard/cop/semantic_blocks
inherit_gem:
standard: config/base.yml
Style/MethodDefParentheses:
Enabled: true
EnforcedStyle: require_parentheses |
I've run tests on usage parentheses around parameters in method definitions.
1) test counted methods defined with parenthesis around parameters.
ag --stats '^[ \t]*def +(?=.*\()'
2) test counted methods defined without parenthesis around parameters.
ag --stats '^[ \t]*def(?: +[^ \n#<;\(]+){2,}'
The results are unambiguous:
If it's not possible to enable this by default, is it possible to add this rule manually to config file?
The text was updated successfully, but these errors were encountered: