Skip to content

Latest commit

 

History

History
138 lines (100 loc) · 5.39 KB

CONTRIBUTING.md

File metadata and controls

138 lines (100 loc) · 5.39 KB

Contributing to Clarity

The Clarity project team welcomes contributions from the community. Together, we can grow Clarity and make it a better framework.

Contribution Guidelines

Before you start working with Clarity, please complete the following steps:

Contribution Flow

Here are the typical steps in a contributor's workflow:

  • Fork the main Clarity repository.
  • Clone your fork and set the upstream remote to the main Clarity repository.
  • Set your name and e-mail in the Git configuration for signing.
  • Create a topic branch from where you want to base your work.
  • Setup your local environment to run and build Clarity. See our build documentation.
  • Make commits of logical units.
  • Make sure npm test passes for each of them.
  • Make sure npm run clang:check passes for each of them. If not, you can run npm run clang:format to format your code.
  • Make sure npm run tslint:check passes for each of them. If not, you can run npm run tslint:fix to try to auto-fix some of them. For certain lint failures you will have to fix them manually.
  • Make sure your commit messages are in the proper format (see below).
  • Push your changes to a topic branch in your fork of the repository.
  • Submit a pull request.

Example:

# Clone your forked repository
git clone git@github.com:<github username>/clarity.git

# Navigate to the directory
cd clarity

# Set name and e-mail configuration
git config user.name "John Doe"
git config user.email johndoe@example.com

# Setup the upstream remote
git remote add upstream https://github.com/vmware/clarity.git

# Create a topic branch for your changes
git checkout -b my-new-feature master

# After making the desired changes, test, commit and push to your fork
npm test
git commit -a -s
git push origin my-new-feature

Staying In Sync With Upstream

When your branch gets out of sync with the master branch, use the following to update:

git checkout my-new-feature
git fetch -a
git pull --rebase upstream master
git push --force-with-lease origin my-new-feature

Updating Pull Requests

If your PR fails to pass CI, or requires changes based on code review, you'll most likely want to squash these changes into existing commits.

If your pull request contains a single commit, or your changes are related to the most recent commit, you can amend the commit.

git add .
git commit --amend
git push --force-with-lease origin my-new-feature

If you need to squash changes into an earlier commit, use the following:

git add .
git commit --fixup <commit>
git rebase -i --autosquash master
git push --force-with-lease origin my-new-feature

Make sure you add a comment to the PR indicating that your changes are ready to review. GitHub does not generate a notification when you use git push.

Formatting Commit Messages

Use this format for your commit message:

[<type>] <title>
<BLANK LINE>
<detailed commit message>
<BLANK LINE>
<reference to closing an issue>
<BLANK LINE>
Signed-off-by: Your Name <your.email@example.com>

Type

Type must be one of the following:

  • UX: Research and design principles. These are typically documentation commits.
  • ICON: Implementation of Clarity's Custom Element icons.
  • UI: Implementation of Clarity's static styles, its general look-and-feel.
  • NG: Implementation of Clarity's Angular components.
  • CORE: Website, distribution, build script and tooling.

Writing Guidelines

These documents provide guidance creating a well-crafted commit message:

Contributing to Documentation

The Clarity documentation website is also housed in this repository under the new-website branch. You can contribute to the documentation by submitting pull requests against that branch.

The documentation website is written in Angular using angular-cli. You can serve the documentation by installing angular-cli, checking out the new-website branch, and running npm start.

Reporting Bugs and Creating Issues

You can submit an issue or a bug to our GitHub repository. You must provide:

  • The link to the reproduction scenario you created using one of the Clarity Plunker Templates
  • If possible please provide a minimal demo illustrating the issue by forking one of the Clarity Plunker Templates
  • The version number of Angular
  • The version number of Clarity
  • The browser name and version number