This guide reflects our current development practices we have adopted for all of our open source projects. This is the Ribose fork of the thoughtbot guide. It is mostly similar with some minor adjustments.
If you are contributing to any of our open source projects then it’s highly expected that you follow this guidelines, but if you have some different opinion about any of the rules then please open an Issue for detailed discussion.
High level guidelines:
-
Be consistent.
-
Don’t rewrite existing code to follow this guide.
-
Don’t violate a guideline without a good reason.
-
A reason is good when you can convince a teammate.
For Ruby-based development, we use ruby-style-guide.
Once you start a new project, please copy the contents of for_new_projects/ruby directory to your project root. Particularly, this directory contains:
Ensure that your GitHub Actions workflow includes a step to run Rubocop against your codebase, and make sure that your code passes Rubocop checks before submitting a pull request.
Source guides for Ruby are kept in src/rubocop.
Whenever you update any of those,
please run bundle exec rake build:rubocop and commit the generated changes.
We use several tools to measure and maintain code quality in our projects. The typical setup is:
- Rubocop
-
Static code analyzer for Ruby. The configuration is provided in
ci/directory which will be run as part of CI. - GitHub CodeQL
-
Performs security analysis.
- GitHub Actions
-
Continuous integration.
|
Note
|
This section is outdated. We should probably remove the mirroring setup
and just keep this repository in the riboseinc organization.
|
This repository is mirrored in every GitHub organization that Ribose
manages in order to workaround Hound CI limitation that organization-wide style
guide must be kept in a repository within that organization.
Mirrors are synchronized via GitHub Actions, specifically propagate workflow
defined in this very repository.
In order to set up another mirror, following steps should be performed:
-
Create a mirror repository on Github, e.g.
new_organization/oss-guides. -
Add the mirror repository to the
matrix:key in thepropagate.ymlworkflow. -
Add the "ribose-ci" user to the
new_organization/oss-guidesrepository with write access.
This guide is maintained by Ribose Inc.