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

New configuration option allowing method definitions without parenthesis around arguments #577

Closed
Florent2 opened this issue Oct 20, 2013 · 7 comments · Fixed by #681
Closed

Comments

@Florent2
Copy link

Would you accept a pull request that introduces a new configuration option allowing method definitions without parenthesis around arguments?

MethodDefinition:
  AllowNoParenthesisAroundArguments: false

If so, I can do it.

Default value would be false.

@yujinakayama
Copy link
Collaborator

Is there any difference between your proposal and just disabling the cop?

If we add a configuration about parentheses in method definitions, I think it should not allow another style, it should enforce either style.

@bbatsov
Copy link
Collaborator

bbatsov commented Oct 20, 2013

I'm totally supporting @yujinakayama's comment - allowing both styles is definitely not an option. But if you're writing method definitions all the time without parentheses I guess we could add another enforced style to the cop.

@jonas054
Copy link
Collaborator

I like

MethodDefinition:
  # Valid values are: parentheses, no_parentheses
  EnforcedStyle: parentheses

@Florent2
Copy link
Author

Thanks for your answers, I agree. I'll write a pull request implementing

MethodDefinition:
  # Valid values are: parentheses, no_parentheses
  EnforcedStyle: parentheses

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 4, 2013

@Florent2 Ping :-)

@Florent2
Copy link
Author

Florent2 commented Nov 5, 2013

thanks for the reminder and sorry for the delay, I've started implementing the new cop, should be able to send the pull request this week

@Florent2
Copy link
Author

sorry for the delay, hopefully this week it should be finished

skanev added a commit to skanev/rubocop that referenced this issue Dec 17, 2013
…tions

This change introduces enforcing a method definition style without
parentheses like this:

    def columnsort array, size
    end

This change also reworks the DefWithoutParentheses cop and replaces it
with MethodDefParentheses with EnforceStyle: no_parentheses
bbatsov added a commit that referenced this issue Dec 17, 2013
[Fix #577] A cop for requiring no parentheses in method definitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants