Ruby empty space have any significance?
up vote
0
down vote
favorite
I have a simple hash.
params = {
name: 'David',
country: 'IND',
state: 'KA',
adress: '#123, bangalore',
email: 'asdf@as.df'
}
At first glance it is little less readable, for more readability I have formatted the above hash to look like bellow.
params = {
name: 'David',
country: 'Canada',
state: 'Some State Name',
adress: 'City Name, #house, etc',
email: 'asdf@as.df'
}
But whenever I run rubocop
it complaints about Layout/AlignHash
offence. Does aligning hashes like second way(empty spaces) have any issues? Can I disable the cop for this?
ruby ruby-on-rails
add a comment |
up vote
0
down vote
favorite
I have a simple hash.
params = {
name: 'David',
country: 'IND',
state: 'KA',
adress: '#123, bangalore',
email: 'asdf@as.df'
}
At first glance it is little less readable, for more readability I have formatted the above hash to look like bellow.
params = {
name: 'David',
country: 'Canada',
state: 'Some State Name',
adress: 'City Name, #house, etc',
email: 'asdf@as.df'
}
But whenever I run rubocop
it complaints about Layout/AlignHash
offence. Does aligning hashes like second way(empty spaces) have any issues? Can I disable the cop for this?
ruby ruby-on-rails
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a simple hash.
params = {
name: 'David',
country: 'IND',
state: 'KA',
adress: '#123, bangalore',
email: 'asdf@as.df'
}
At first glance it is little less readable, for more readability I have formatted the above hash to look like bellow.
params = {
name: 'David',
country: 'Canada',
state: 'Some State Name',
adress: 'City Name, #house, etc',
email: 'asdf@as.df'
}
But whenever I run rubocop
it complaints about Layout/AlignHash
offence. Does aligning hashes like second way(empty spaces) have any issues? Can I disable the cop for this?
ruby ruby-on-rails
I have a simple hash.
params = {
name: 'David',
country: 'IND',
state: 'KA',
adress: '#123, bangalore',
email: 'asdf@as.df'
}
At first glance it is little less readable, for more readability I have formatted the above hash to look like bellow.
params = {
name: 'David',
country: 'Canada',
state: 'Some State Name',
adress: 'City Name, #house, etc',
email: 'asdf@as.df'
}
But whenever I run rubocop
it complaints about Layout/AlignHash
offence. Does aligning hashes like second way(empty spaces) have any issues? Can I disable the cop for this?
ruby ruby-on-rails
ruby ruby-on-rails
asked 8 mins ago
Aparichith
1063
1063
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f208326%2fruby-empty-space-have-any-significance%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown