Skip to content

Latest commit

 

History

History
89 lines (60 loc) · 2.64 KB

CONTRIBUTING.md

File metadata and controls

89 lines (60 loc) · 2.64 KB

How to Contribute

Code Level Contributions

Contributing to this project entails submitting pull requests (PRs) to this repository.

Repository Fork

Create a repository fork via https://github.com/Constellation-Labs/tessellation/fork.

Create a clone of your repo (origin) and add the (quasi-standard named) upstream remote.

git clone https://github.com/<you-github-account>/tessellation
cd tessellation
git remote add upstream https://github.com/Constellation-Labs/tessellation

When developing, keep your changes as atomic as possible (e.g. a commit should not break the code/ci).

Feature Branch

Create a Feature-Branch (example for branch '747-update-contrib')

git checkout -b 747-update-contrib

Rebase

Especially for long running work, ensure that you sync from time to time your branch with the latest upstream changes.

git checkout 747-update-contrib
git fetch upstream
git rebase upstream/develop

PR (Pull Request)

  1. When you are ready to make a PR, again rebase with upstream as mentioned above. Then just push as usual:
# -u is the shtorcut for --set-upstream-to
git push -u origin 747-update-contrib

Create the PR from the github UI whilst following the instructions given there.

Coding Style

  • Try to mimic the existent coding style within the repository.
  • Use Scala's formatter, scalafmt, and ScalaFix. Before committing, run sbt runLinter.

Setting up scalafmt

  • For IntelliJ, click here.

Running SBT in the command-line

Run these commands from the base directory of this project.

sbt compile    # compiles the project.
sbt test       # runs the tests.
sbt runLinter  # automatically formats the code according to the style guide.

Configuring SBT

After installing SBT, per the SETUP guide, you have to configure it.

  1. Generate a Github Personal Access Token, link.
  2. Set your global SBT configuration.
    1. Create the ~/.sbt/1.0/github.sbt file.
    2. Copy into it below. Replace <TOKEN> with the Personal Access Token you generated and <GITHUB_ID> with your Github username.
credentials +=
	Credentials(
		"Github Package Registry",
		"maven.pkg.github.com",
		"<GITHUB_ID>",
		"<TOKEN>")

githubTokenSource := TokenSource.GitConfig("github.token")
  1. Create the file ~/.sbt/1.0/plugins/plugin.sbt.
    1. Copy into it: addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")