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

Fbuys/207 rubocop and standardrb #208

Closed
wants to merge 4 commits into from

Conversation

fbuys
Copy link
Contributor

@fbuys fbuys commented Oct 5, 2021

Description

Includes

  • CI github workflow
  • Rubocop and Standard ruby gems
  • Rubocop config

To automate linting and code standards.

RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter.
Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide.

StandardRB is built on top of RuboCop with some specific configurations for RuboCop's cops.

Further reading:

A todo config file was added so we can ignore the non-safe linting errors for now.
We can open additional issues to fix the remaining linting issues.

CI will use the todo file and therefore not fail while we have time to
fix the remaining linting issues.

IDE integration should still report on all the errors until we fix them.

Motivation and Context

Closes: #207

This change makes it easy for all contributors to maintain the same coding standard.
This should make contributing easier too.

How Has This Been Tested?

I have added a CI workflow and if the CI workflow passes then it means we have adhered to the required linting standard.

Screenshots (if appropriate):

image

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@fbuys fbuys force-pushed the fbuys/207-rubocop-and-standardrb branch 4 times, most recently from e3a31e9 to 71977fe Compare October 5, 2021 09:31
Includes
 - CI github workflow
 - Rubocop and Standard ruby gems
 - Rubocop config

To automate linting and code standards.

RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter.
Out of the box it will enforce many of the guidelines outlined in the
community Ruby Style Guide.

StandardRB is built on top of RuboCop with some specific configurations for RuboCop's cops.

Further reading:
 - https://docs.rubocop.org/rubocop/1.18/index.html
 - https://rubystyle.guide/
 - https://github.com/testdouble/standard
 - https://github.com/testdouble/standard/blob/main/config/base.yml
@fbuys fbuys force-pushed the fbuys/207-rubocop-and-standardrb branch from 7287f5d to c029a5b Compare October 5, 2021 10:09
So we can ignore the non-safe linting errors for now.
We can open additional issues to fix the remaining linting issues.

CI will use the todo file and therefore not fail while we have time to
fix the remaining linting issues.

IDE integration should still report on all the errors until we fix them.
@fbuys fbuys force-pushed the fbuys/207-rubocop-and-standardrb branch 2 times, most recently from 561e89d to fa11ae9 Compare October 6, 2021 11:09
To autocorrect all safe linting errors.
The remaining errors are in the todo file so we can look at it in
the future.
@fbuys fbuys force-pushed the fbuys/207-rubocop-and-standardrb branch from fa11ae9 to 014eb17 Compare October 6, 2021 11:12
Copy link
Contributor Author

@fbuys fbuys left a comment

Choose a reason for hiding this comment

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

🥦 rubocop -A --safe fixes only

ruby-version: '2.7'
- run: gem install rubocop bundler
- run: bundle install
- run: bundle exec rubocop -c .rubocop_with_todo.yml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🥦 CI uses todo config so it excludes unsafe linting errors.

@@ -0,0 +1,439 @@
# This configuration was generated by
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🥦 File contains the list of cops that we need to fix when we have time

$ t display

Submit bugs and feature requests to http://github.com/samg/timetrap/issues
USAGE = <<~EOF
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🥦 ~ removes the padding

@fbuys fbuys marked this pull request as ready for review October 6, 2021 11:19
@fbuys fbuys force-pushed the fbuys/207-rubocop-and-standardrb branch from cf40efb to 1e87883 Compare October 19, 2021 15:00
@fbuys fbuys closed this Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] Linting / Rubocop
1 participant