Comments (10)
approved
from code-style.
Wouldn't it make sense to disable this rule only for certain types of files (configuration, specs, migrations, etc)? I think it's pretty useful for the regular code.
from code-style.
@akxcv This forces to replace
Foo = Struct.new(:foo) do
with
Foo = Struct.new(:foo)
class Foo
After some thinking, i realised that second variant is someway better, because class defenition always better than class_exec. Anyway, it requies some guidelines to leave it enabled in app/ and lib/
from code-style.
In most cases, max block length is restricted by module length or method length, so it seems to be useless in regular code
from code-style.
Yeah, that makes sense. If it's restricted by module/method (class?) length anyway, I'm for disabling block length completely.
from code-style.
What's the status of this? What are we waiting for?
from code-style.
Right now i don't sure, that long class_exec and module_exec blocks are good in general. If they are not, this cop would disallow them. And the reason i wanted to disable this cop is exactly that it disallowed them
from code-style.
The problem is, e.g., we have Struct.new() do
and whole class defenition is not recognized as a class defenition by static analizers
from code-style.
Well, I think we should generally avoid metaprogramming outside library code. But, if that's the primary reason for disabling the cop, we shouldn't IMO.
We could disable it for configs, specs, and migrations and leave it in for business logic.
from code-style.
Seems reasonable. We can discuss it at monday
from code-style.
Related Issues (12)
- Update ESLint config dependencies HOT 1
- ESLint rules from plugins should be optional HOT 3
- [Rubocop] Security/YAMLLoad HOT 2
- What is better naming, eslint or javascript? HOT 7
- [ESLint] Up to v4.0.0 HOT 4
- [Stylelint] Separate config for styled-components HOT 1
- [General] Setup github contribution system HOT 6
- Metrics/BlockLength for *.rake files
- extract AR-based rules from rails HOT 4
- CI Build subsystem (rubocop) HOT 1
- [Rubocop] Change authors section in gemspec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code-style.