Skip to content

Latest commit

 

History

History
80 lines (54 loc) · 2.63 KB

CONTRIBUTING.md

File metadata and controls

80 lines (54 loc) · 2.63 KB

♻️ Contributing

We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our Contributor License Agreement (CLA) first. See our license file for more details.

Getting started

Install dependencies

$ bundle install --path vendor/bundle

Run tests

$ STREAM_KEY=my_api_key STREAM_SECRET=my_api_secret bundle exec rspec spec

Run specific test

Add :focus tag on target test:

it 'can mark messages as read', :focus do
    # test something
end

And then run as following:

$ STREAM_KEY=myapi_key STREAM_SECRET=my_secret STREAM_CHAT_URL=http://127.0.0.1:3030 bundle exec rspec spec --tag focus

Linters and type check

We use Rubocop for linting and Sorbet for type checking.

To run them:

$ bundle exec rake rubocop
$ bundle exec srb tc

These linters can be easily integrated into IDEs such as RubyMine or VS Code.

For VS Code, just install the basic Ruby extension which handles Rubocop (rebornix.ruby) and the official Sorbet one (sorbet.sorbet-vscode-extension).

Recommended settings:

{
    "editor.formatOnSave": true,
    "ruby.useBundler": true,
    "ruby.lint": {
        "rubocop": {
            "useBundler": true, // enable rubocop via bundler
        }
    },
    "ruby.format": "rubocop",
    "ruby.useLanguageServer": true,
    "sorbet.enabled": true
}

Commit message convention

This repository follows a commit message convention in order to automatically generate the CHANGELOG. Make sure you follow the rules of conventional commits when opening a pull request.

Releasing a new version (for Stream developers)

In order to release new version you need to be a maintainer of the library.

  • Kick off a job called initiate_release (link).

The job creates a pull request with the changelog. Check if it looks good.

  • Merge the pull request.

Once the PR is merged, it automatically kicks off another job which will upload the Gem to RubyGems.org and creates a GitHub release.