Comments (6)
Technically the code above does violate our style guide, since {}
are for one-liners, or single line blocks.
from hound.
You can't use do end in this unless we add a description. How would you rewrite this to
be inline for our style guide?
Thanks in advance @gylaz
from hound.
You could do (the description is not necessary):
it do
should delegate_method(:default_variant_name).
to(:default_variant).
as(:name)
end
Same could be said for expect {}
:
expect do
some_long_method_name_that_does_not_fit_on_one_line
end.to change { something }
# or
expect do
some_long_method_name_that_does_not_fit_on_one_line
end.
to change { something }
While I think the first example is fine, the second one is odd. But there isn't really a good solution for the second example without using {}
, but then that's breaking consistency of our rules. This might be a good discussion for our guides repo.
from hound.
Thanks @gylaz, should I start a discussion in the guides repo or do people not mind using a it
with no description and do end
?
from hound.
I think the conversation in guides would be helpful. We should probably figure out where to land with such blocks, especially in the expect
situation.
from hound.
We can reopen the issue when a decision has been made.
from hound.
Related Issues (20)
- .eslintrc format is invalid HOT 1
- Add support for @shopify/eslint-plugin
- [deleted]
- repos is too large ๏ผthen led to OOM
- Support golangci-lint instead of golint (deprecated)
- whitelist rubocop-graphql
- Feature request: allow to install eslint plugins and config from .eslintrc
- Bump RuboCop version to 1.21 HOT 3
- Add support for eslint v8.x HOT 1
- Where is perform method for LintersJob?
- Cannot terminate account HOT 1
- ESlint 8.1.0 does not work HOT 2
- Which permissions and events are needed in the GitHub app?
- How to do code check like hound locally and explicitly mute hound on some lines?
- houndci/linters repo not available
- Style/BlockDelimiters: Avoid using {...} for multi-line blocks. not being ignored for rspec HOT 1
- Bump Flake8 version to at least v3.9.2 HOT 1
- rubocop-solidus extension support
- Whitelist rubocop-thread_safety extension HOT 1
- Subscription issues HOT 1
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 hound.