You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When writing code, I utilize macros that accept blocks and behave like a method def. An example is the rails test macro. Because these macros look like method definitions, I'd like them to follow the rules set in Layout/EmptyLineBetweenDefs.
Describe the solution you'd like
Enhance Layout/EmptyLineBetweenDefs to format configured macros as if they were method definitions. Default configuration would be an empty list
This is how I expect it to work if I were to configure the rule with ['test']
I considered writing something specific to the test macro in Rubocop-rails. Similar to how rubocop-rspec is defined. I wanted to see if there was appetite for something a little more generic in the core rubocop rules first.
Additional context
I have some code written here that I've tested against one of my repositories, and if there's interest from the maintainers here I'll open a pull request.
The text was updated successfully, but these errors were encountered:
You might want to open a PR. I'm just a contributor, not a maintainer. But your work looks good to me.
The maintainers most likely give some feedbacks.
Is your feature request related to a problem? Please describe.
When writing code, I utilize macros that accept blocks and behave like a method def. An example is the rails test macro. Because these macros look like method definitions, I'd like them to follow the rules set in Layout/EmptyLineBetweenDefs.
Describe the solution you'd like
Enhance Layout/EmptyLineBetweenDefs to format configured macros as if they were method definitions. Default configuration would be an empty list
This is how I expect it to work if I were to configure the rule with
['test']
Describe alternatives you've considered
I considered writing something specific to the test macro in Rubocop-rails. Similar to how rubocop-rspec is defined. I wanted to see if there was appetite for something a little more generic in the core rubocop rules first.
Additional context
I have some code written here that I've tested against one of my repositories, and if there's interest from the maintainers here I'll open a pull request.
The text was updated successfully, but these errors were encountered: