Ruby empty space have any significance? [on hold]











up vote
-2
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?










share|improve this question













put on hold as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Most cops can be configured. Just have a look at the different options for Layout/AlignHash. Btw I prefer the table style too.
    – spickermann
    2 days ago















up vote
-2
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?










share|improve this question













put on hold as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Most cops can be configured. Just have a look at the different options for Layout/AlignHash. Btw I prefer the table style too.
    – spickermann
    2 days ago













up vote
-2
down vote

favorite









up vote
-2
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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









Aparichith

1023




1023




put on hold as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – 200_success, Sᴀᴍ Onᴇᴌᴀ, Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.












  • Most cops can be configured. Just have a look at the different options for Layout/AlignHash. Btw I prefer the table style too.
    – spickermann
    2 days ago


















  • Most cops can be configured. Just have a look at the different options for Layout/AlignHash. Btw I prefer the table style too.
    – spickermann
    2 days ago
















Most cops can be configured. Just have a look at the different options for Layout/AlignHash. Btw I prefer the table style too.
– spickermann
2 days ago




Most cops can be configured. Just have a look at the different options for Layout/AlignHash. Btw I prefer the table style too.
– spickermann
2 days ago















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Morgemoulin

Scott Moir

Souastre