Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ruby files to follow Ruby Style Guide #6340

Open
moki298 opened this issue Sep 26, 2019 · 11 comments

Comments

@moki298
Copy link
Contributor

commented Sep 26, 2019

This is referenced from the issue: #6314.

Updated:

Purpose:

To remove linting errors using rubocop

Current Plan

Since currently there are more than 6000 offenses I would like to break this into smaller issues, also I would like to track them all in this issue.

Active issues as of now are listed below, please feel free to create a new issue for any other directory and start refactoring the ruby files in that directory. Please reference this issue in every issue that you create for each directory so that we will have a single issue to track the progress.

Related Issues

Issue Id Files/Directory Involved PR Id/Progress
None /app/api/srch #6380 Work in progress
#6416 /app/api & /app/channels #6425 Work in progress
#6417 /app/controllers PR yet to be created
#6436 /app/helpers PR yet to be created

Rubocop help

  • Download rubocop from here
  • Once successfully downloaded run rubocop command inside the directory, this lists all the offenses in ruby files in this directory. More info here
  • Running rubocop -a fixes most of the issues automatically
@welcome

This comment has been minimized.

Copy link

commented Sep 26, 2019

Thanks for opening your first issue! This space is protected by our Code of Conduct - and we're here to help.
Please follow the issue template to help us help you 👍🎉😄
If you have screenshots or a gif to share demonstrating the issue, that's really helpful! 📸
Do join our Gitter channel for some brainstorming discussions.

@moki298

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2019

I used rubocop and found many violations, @newbazz do you think starting resolving them is a good place to start with this issue?

@newbazz

This comment has been minimized.

Copy link
Contributor

commented Sep 30, 2019

yes i think this is a good first step, you can file an issue and start working on the same. @moki298

@jywarren

This comment has been minimized.

Copy link
Contributor

commented Sep 30, 2019

@moki298

This comment has been minimized.

Copy link
Contributor Author

commented Oct 1, 2019

Ok, I found around 6000 violations across the entire repository, I don't want to do this in a single issue/PR as it would be cumbersome for the reviewers, any thoughts on that? @jywarren @newbazz

Is it any better if we do this single directory at a time? Also, how can I test locally once I do any changes? Is there a defined workflow for this?

@camillesk

This comment has been minimized.

Copy link

commented Oct 1, 2019

I'm interest to help on this issue! I thin we can fix by directories, setting a maximum of files that we can change in which PR

@discombobulateme

This comment has been minimized.

Copy link

commented Oct 4, 2019

@moki298 woooow that's an impressive work :)
How reliable is using rubocop? Does it works like a filter than if should be manually checked? Would love to learn how to use it and cooperate :)

@moki298

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2019

@camillesk @discombobulateme thanks for your interest. I believe we should break this into smaller issues. But I am waiting for comments from the @jywarren @newbazz to know what they think about this as I am new to this repo and ruby world. I would like to wait and see for a week or so and then I would start breaking this into smaller issues.

Meanwhile, it would be great if you have the environment setup and ready. @discombobulateme I think rubocop it the best way to update this codebase, manual checking is ineffective for dealing with 6000 plus offenses.

Clone this repo and install the required software and then install rubocop with instructions from here and then run rubocop from this repo you should be able to see all the offenses listed.

@discombobulateme

This comment has been minimized.

Copy link

commented Oct 5, 2019

Thanks @moki298 ! I'll do it within the next hour ;)

@newbazz

This comment has been minimized.

Copy link
Contributor

commented Oct 6, 2019

this is a good first step towards refactoring the ruby code, I would like someone to mention run the linter rubycorp before making a pull request in the contributing guidelines as well.

@moki298 moki298 closed this Oct 7, 2019
@moki298 moki298 reopened this Oct 7, 2019
@moki298

This comment has been minimized.

Copy link
Contributor Author

commented Oct 7, 2019

Ok, I will go ahead and start breaking this into smaller issues, @discombobulateme @camillesk please find the appropriate issues tagged on this topic and start working on them. Please let me know if you are stuck with something. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.