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

Add rubocop pre-commit hook; Remove redundant returns #6207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jbampton
Copy link
Contributor

We already run Rubocop on mgem-list as seen here:

https://github.com/mruby/mgem-list/blob/7944a361ab9acb0d673f15fbf0e2ce4b80f21514/.pre-commit-config.yaml#L46

This PR adds a basic Rubocop config file and the goal is to standardize the codebase.

Using rubocop -A the redundant returns have been autoremoved.

We already run Rubocop on `mgem-list` as seen here:

https://github.com/mruby/mgem-list/blob/7944a361ab9acb0d673f15fbf0e2ce4b80f21514/.pre-commit-config.yaml#L46

This PR adds a basic Rubocop config file and the goal is to standardize the codebase.

Using `rubocop -A` the redundant returns have been autoremoved.
DisabledByDefault: true
TargetRubyVersion: 3.3.0

Style/RedundantReturn:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this rule really needed? I am not sure the changes from the rule make the code more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started this PR thinking that we could use some rules from Rubocop to help organize and standardize some of the Ruby codebase.

I think it is better to be consistent and removing these redundant returns sets a code standard going forwards. These extra returns are really extra characters and data that is not needed.

Maybe this rule is not needed but I think there could be some other Rubocop rules that are useful for mruby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants