Introduce action to run linter and tests #750
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new GitHub CI action that takes care of running a linter process as well as the RSpec tests. It runs on every pull request change and when pushing to
master.Overcommit
Overcommit now runs as part of the CI action and will run the checks for which is configured. This includes Rubocop, so that's why it's not included in the action.
All of the offenses have been corrected.
Rubocop
First of all, config file for Rubocop has been adapted and plugins
rubocop-factory_bot,rubocop-rakeandrubocop-rspechave been added.Most of the Rubocop offenses have been corrected. Those that have not have been annotated (using
--disable-uncorrectable) so a#todocomment has been added right besides the offending code. As we keep adding changes to the code, if we happen to encounter one of these annotations, it would be convenient to address the Rubocop offense.I think there's a relevant offense that is now annotated and has to do with the use of
OpenStructwhich is now not recommended due to security and performance issues. I'll try to raise a separate PR to address this.Important: I added back the
indexed_envelope_*tables to the schema dump, otherwise they were not created and tests failed. It doesn't seem to have any impact, but @excelsior please check that I've not introduced any weird behaviour because of this.