Skip to content

Latest commit

 

History

History
198 lines (140 loc) · 15.9 KB

CONTRIBUTING.md

File metadata and controls

198 lines (140 loc) · 15.9 KB

Contributing to GRIDdle

GRIDdle is a simple set of helpers for working with CSS Grid.

Participation in the GRIDdle community, including contributing to the GRIDdle codebases, is governed by the Sass Community Guidelines. By participating, you agree to abide by it.

Submitting Issues

  • Before creating a new issue, perform a cursory search to see if a similar issue has already been submitted. Similar issues may have different names than what you would have written, and may have been closed.
  • Can create an issue in the most relevant repository. If unable to determine which one that is, file an issue in this repository. It may be moved.
  • Please follow our Issue Guidelines when creating a new issue.
  • Do not open a pull request to resolve an issue without first receiving feedback from a at-import member and having them agree on a solution forward.
  • Include screenshots and animated GIFs whenever possible; they are immensely helpful.
  • When submitting a browser bug, please include the browser, version, operating system, and operating system version.
  • Issues that have a number of sub-items that need to be complete should use task lists to track the sub-items in the main issue comment.

Pull Requests

Pull Request Guidelines

In order to expedite the process of reviewing and merging pull requests, we request the following guidelines are adhered to.

Tips for Submitting Great PRs

Beyond just writing the code needed to resolve an issue, there are a few best practices that should be followed to submit a great PR:

  • We have EditorConfig files set up for GRIDdle. Having EditorConfig installed and used will help ensure that editors are configured to follow our conventions.
  • We have JavaScript and Sass linting set up. Before committing code, make sure that linting has been run locally and passes by running npm run lint
  • We have automated testing set up. They can be run locally by by running npm test from the command line. This will run linting, our test suite, and show code coverage. These same tests are run as part of our automated test suite and must pass for all pull requests.
  • For consistency, follow the conventions that the team has in place that aren't necessarily covered by our automated test suite. For instance, the team may be using map instead of forEach to create new arrays, or may divide out their Sass partials in a particular way.
  • Solve the issue in as few lines of code, with as few external dependencies, as possible. The most maintainable lines of code are the ones that don't exist, so keeping PRs as small, clear, and concise as possible will aid in overall project maintainability, stability, and make it easier for us to do code review.
  • Commit tests separately from implementation code.
  • PRs are easiest to review when they're small. Please keep total lines of code changed to around 200. This may mean breaking up work over multiple PRs. If this is done, one PR for tests and one PR for functionality is usually a good place to start, with tests being submitted and merged first (and skipped) and functionality being submitted and merged second (unskipping the tests)
  • Commit early and often. Small, atomic commits help us understand the thought process that went in to creating a pull request and make it easier for us to review. Do not squash or rebase your commits when submitting pull requests.
  • Do not refactor existing code unless it is absolutely necessary to resolve the issue being worked on. If there is an opportunity to refactor, please file a separate issue to discuss and implement instead.
  • Only include code that resolves the scenarios in the issue being worked on (or the specific bug being fixed). While appreciated, work that goes above-and-beyond the scenarios outlined in an issue is out-of-scope and we will not be able to accept it. Please either work with the GRIDdle team to get scenarios written for the issue being worked on, or split up the work across multiple issues and pull requests.

Developer Certificate of Origin

All contributions to GRIDdle projects must be accompanied by acknowledgment of, and agreement to, the Developer Certificate of Origin, reproduced below. Acknowledgment of and agreement to the Developer Certificate of Origin must be included in the comment section of each contribution and must take the form of DCO 1.1 Signed-off-by: FULL_NAME <EMAIL_ADDRESS>. Contributions without this acknowledgment will be required to add it before being accepted. If a contributor is unable or unwilling to agree to the Developer Certificate of Origin, their contribution will not be included.

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Git Commit Messages

Commit message should follow the template :<emoji>: <subject> with <emoji> being the name of the relevant emoji describing the changes (without wrapping ::) and subject being the description of changes. Commit messages may have multiple emoji. Some emoji have semantic meaning for releases, so please those are used properly. Commit messages should follow the following guidelines:

  • Use the present tense ("Add feature" not "Added Feature")
  • Use the imperative mood ("Move cursor to…" not "Moves cursor to…")
  • Limit the first line (not including emoji) to 72 characters or less

Example commits may look something like the following:

git commit -m ":art: Refactor lookup system"

git commit -m ":lock: Fix XSS vulnerability"

git commit -m ":new::boom: Require author in content types" -m "Previously working content types will now throw if author is not present, so this is a breaking change"

We use ghooks with punchcard-commit-msg to enforce this convention when using command-line git.

Branching Model

  • Branches must be made off of the most current master branch of a repository
  • Branch names should be descriptive, describing what is being done in that branch
  • Pull requests must be made back in to the master branch for a repository
  • The following branch prefixes should be used when creating a new branch:

Time to Merge

In order for a pull request to be merged, it must meet the following criteria:

  • The author(s) of the code have signed off on the Developer Certificate of Origin for this pull request
  • All required integrations have passed
  • The code has been reviewed by at least one non-authoring member of the maintaining team and all comments from the review have been addressed. This may include comments related to our tips for submitting great PRs.

Creating a Release

Versioning is done through SEMVER. Whenever new code is merged in to the master branch, a new semantic release will automatically be created on NPM and in the project's GitHub Releases. The GitHub Release will also include a changelog based off of the commit messages of that release. The release version and changelog are determined by the punchcard-semantic-release module, and released using the semantic-release module based off of the emoji used in the commit messages for each commit. The following emoji correspond to different semantic versions, all other emoji are considered non-semantic:

Major Version Backwards-incompatible changes

  • 💥 :boom:

Minor Version Backwards-compatible new functionality

  • 🆕 :new:
  • 🐎 :racehorse:
  • 🔒 :lock:

Patch Version Backwards-compatible changes that do not add new functionality

  • 🐛 :bug:
  • 👕 :shirt:
  • 🎨 :art:
  • 🔧 :wrench:

Pre-Release Version In-progress release

  • 🔮 :crystal_ball:

The version that gets generated is based on the highest type of change identified; i.e. if there were five patch commits and one minor commit, the minor commit takes precedence and a new minor release will be generated. All contributing commits will be included in the changelog.

Issue Guidelines

There are generally two kinds of issues: functionality requests and bugs. Each is treated slightly differently, and there is a template for each.

Functionality Requests

Request New Functionality

New functionality always exists in relation to a specific type of user. When requesting new functionality, include the user persona the request relates to, why the user needs it, including the user's rationale for needing it. Titles should be written with the user persona first, then the a short description of their need (5-10 words).

New functionality also needs their requirements for being considered complete written out. To do so, we recommend writing the desired behavior in Gherkin syntax. Each feature and scenario pair should have a task list created to track their completion. The issue is considered done when all scenarios defined have been completed, code is covered with tests, and all tests pass.

A new request for functionality can be created by opening a new issue directly, copying our Issue Template in to the body of a new issue, or clicking the Request New Functionality link above.

Bug Report

File a Bug Report

Bug reports represent a problem in our codebase. If the problem exists because something isn't working as it was designed and implemented to work, it should be filed as a bug report. If the problem exists because something isn't working as expected or working as liked but is working as it was designed and implemented to work, it should be requested as a new functionality. Titles should be written with the Bug: first, then the a short description of the problem (5-10 words). Please do not submit bugs about CSS Grid itself! GRIDdle will not add support for CSS Grid where it doesn't already exist, or change how CSS Grid is implemented in existing browsers!

Bug reports should all include the following information:

  • Long description of problem
  • Step-by-step instructions on how to reproduce the problem
  • Screenshots and if possible animated GIFs (ideally at least one for every step)
  • Browsers, browser versions, operating systems, and operating system versions affected (for in-browser bugs)
  • Runtime version affected (for non-browser bugs, i.e. Node version)
  • Code version being used

A new bug report can be created either by opening a new issue and copying our Bug Template in to the body of the issue, or clicking the File a Bug Report link above.

Emoji Cheatsheet

When writing commits, please start the commit message with one of the following applicable Emoji, keeping in mind that some emoji have semantic meaning for releases. Emoji should not be used at the start of issue or pull request titles.

  • 🆕 :new: when adding new functionality
  • 🐛 :bug: when fixing a bug
  • 📝 :memo: when writing documentation
  • 👕 :shirt: when removing linter warnings
  • 🎨 :art: when improving the format/structure of the code, documentation, or visual styling
  • 🔥 :fire: when removing code or files
  • 🐎 :racehorse: when improving performance
  • :white_check_mark: when adding tests
  • 💚 :green_heart: when fixing the CI build
  • 🔒 :lock: when dealing with security
  • 🔮 :crystal_ball: when experimenting
  • 🔧 :wrench: when doing chore work (updating dependencies, etc…)
  • 💥 :boom: when changing in a non-backwards-compatible way current functionality