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

Feature request: Allow EnforcedStyle for Style/Lambda #2909

Closed
agrimmtt opened this issue Mar 4, 2016 · 1 comment
Closed

Feature request: Allow EnforcedStyle for Style/Lambda #2909

agrimmtt opened this issue Mar 4, 2016 · 1 comment

Comments

@agrimmtt
Copy link

agrimmtt commented Mar 4, 2016

Style/Lambda doesn't have an EnforcedStyle option. Allowing users to have an enforced_style of always using lambda would be useful for those with an existing codebase that uses lambda and wants any new code to be consistent with existing code.

@maxnordlund
Copy link

The same would be very useful for those that have the opposite, existing codebase uses -> and want new code to stay consistent with that.

Drenmi added a commit to Drenmi/rubocop that referenced this issue Apr 25, 2016
… to Style/Lambda cop

This change adds configurable styles for `Style/Lambda`, that lets you
mandate the use of either syntax for both single line and multiline lambdas.

The options are:

- `line_count_dependent` (default)

   This is the previous behaviour, and enforces `literal` style for single
   line lambdas, and `lambda` style for multiline lambdas.

- `lambda`

   This configuration enforces `lambda` style for all lambdas.

- `literal`

   This configuration enforces `literal` style for all lambdas.
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
…to Style/Lambda cop (rubocop#3076)

This change adds configurable styles for `Style/Lambda`, that lets you
mandate the use of either syntax for both single line and multiline lambdas.

The options are:

- `line_count_dependent` (default)

   This is the previous behaviour, and enforces `literal` style for single
   line lambdas, and `lambda` style for multiline lambdas.

- `lambda`

   This configuration enforces `lambda` style for all lambdas.

- `literal`

   This configuration enforces `literal` style for all lambdas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants