timetrap
timetrap copied to clipboard
Fbuys/207 rubocop and standardrb
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:
- 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
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: https://github.com/samg/timetrap/issues/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):
Types of changes
- [x] New feature (non-breaking change which adds functionality)
Checklist:
- [x] My code follows the code style of this project.
- [x] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.