2
0
salt-formula/docs/CONTRIBUTING.rst
Imran Iqbal ebfeba2c4f
feat: use semantic-release cross-formula standard structure
* Semi-automated using https://github.com/myii/ssf-formula/pull/31
* Includes:
  - Update TOFS
  - Use `bin/kitchen`
  - Use `dist: bionic` in Travis
  - Add `yamllint` and apply rules
  - Use `pillars_from_files` throughout
  - Replace EOL images in Kitchen & Travis
  - Add `develop` images in Kitchen & Travis
* Fix (or ignore)  errors shown below:

```bash
salt-formula$ yamllint -s .
./pillar.example
  1:1       warning  missing document start "---"  (document-start)
  5:23      warning  truthy value should be one of [false, true]  (truthy)
  8:25      warning  truthy value should be one of [false, true]  (truthy)
  11:25     warning  truthy value should be one of [false, true]  (truthy)
  19:21     warning  truthy value should be one of [false, true]  (truthy)
  40:89     error    line too long (108 > 88 characters)  (line-length)
  41:89     error    line too long (112 > 88 characters)  (line-length)
  43:89     error    line too long (112 > 88 characters)  (line-length)
  45:89     error    line too long (110 > 88 characters)  (line-length)
  47:89     error    line too long (89 > 88 characters)  (line-length)
  74:27     warning  truthy value should be one of [false, true]  (truthy)
  82:9      error    wrong indentation: expected 10 but found 8  (indentation)
  101:14    warning  truthy value should be one of [false, true]  (truthy)
  102:20    warning  truthy value should be one of [false, true]  (truthy)
  103:89    error    line too long (119 > 88 characters)  (line-length)
  121:7     warning  comment not indented like content  (comments-indentation)
  122:24    error    syntax error: found character '%' that cannot start any token
  310:89    error    line too long (102 > 88 characters)  (line-length)
  330:89    error    line too long (113 > 88 characters)  (line-length)
  433:1     error    too many blank lines (1 > 0)  (empty-lines)

./salt/osmap.yaml
  4:2       error    syntax error: found character '%' that cannot start any token
  6:89      error    line too long (93 > 88 characters)  (line-length)
  22:89     error    line too long (137 > 88 characters)  (line-length)
  23:89     error    line too long (134 > 88 characters)  (line-length)
  33:89     error    line too long (149 > 88 characters)  (line-length)
  34:89     error    line too long (146 > 88 characters)  (line-length)

./salt/osfamilymap.yaml
  4:2       error    syntax error: found character '%' that cannot start any token
  6:89      error    line too long (94 > 88 characters)  (line-length)
  24:89     error    line too long (149 > 88 characters)  (line-length)
  25:89     error    line too long (146 > 88 characters)  (line-length)
  39:89     error    line too long (105 > 88 characters)  (line-length)
  40:89     error    line too long (127 > 88 characters)  (line-length)
  56:89     error    line too long (101 > 88 characters)  (line-length)

./salt/ospyvermap.yaml
  4:1       warning  missing document start "---"  (document-start)

./salt/defaults.yaml
  3:1       warning  missing document start "---"  (document-start)
  7:21      warning  truthy value should be one of [false, true]  (truthy)
  8:12      warning  truthy value should be one of [false, true]  (truthy)
  9:23      warning  truthy value should be one of [false, true]  (truthy)
  10:19     warning  truthy value should be one of [false, true]  (truthy)
  14:25     warning  truthy value should be one of [false, true]  (truthy)
  15:25     warning  truthy value should be one of [false, true]  (truthy)
  16:27     warning  truthy value should be one of [false, true]  (truthy)
  17:27     warning  truthy value should be one of [false, true]  (truthy)
  39:28     warning  truthy value should be one of [false, true]  (truthy)
  41:28     warning  truthy value should be one of [false, true]  (truthy)
  45:24     warning  truthy value should be one of [false, true]  (truthy)
  49:30     warning  truthy value should be one of [false, true]  (truthy)
  54:28     warning  truthy value should be one of [false, true]  (truthy)
  63:25     warning  truthy value should be one of [false, true]  (truthy)
  68:15     warning  truthy value should be one of [false, true]  (truthy)
```
2019-09-13 07:58:18 +01:00

5.0 KiB
Raw Blame History

How to contribute

This document will eventually outline all aspects of guidance to make your contributing experience a fruitful and enjoyable one. What it already contains is information about commit message formatting and how that directly affects the numerous automated processes that are used for this repo. It also covers how to contribute to this formula's documentation.

Table of Contents

Overview

Submitting a pull request is more than just code! To achieve a quality product, the tests and documentation need to be updated as well. An excellent pull request will include these in the changes, wherever relevant.

Commit message formatting

Since every type of change requires making Git commits, we will start by covering the importance of ensuring that all of your commit messages are in the correct format.

Automation of multiple processes

This formula uses semantic-release for automating numerous processes such as bumping the version number appropriately, creating new tags/releases and updating the changelog. The entire process relies on the structure of commit messages to determine the version bump, which is then used for the rest of the automation.

Full details are available in the upstream docs regarding the Angular Commit Message Conventions. The key factor is that the first line of the commit message must follow this format:

type(scope): subject
  • E.g. docs(contributing): add commit message formatting instructions.

Besides the version bump, the changelog and release notes are formatted accordingly. So based on the example above:

Documentation

  • contributing: add commit message formatting instructions
  • The type translates into a Documentation sub-heading.
  • The (scope): will be shown in bold text without the brackets.
  • The subject follows the scope as standard text.

Linting commit messages in Travis CI

This formula uses commitlint for checking commit messages during CI testing. This ensures that they are in accordance with the semantic-release settings.

For more details about the default settings, refer back to the commitlint reference rules.

Relationship between commit type and version bump

This formula applies some customisations to the defaults, as outlined in the table below, based upon the type of the commit:

Type Heading Description Bump (default) Bump (custom)
build Build System Changes related to the build system
chore Changes to the build process or auxiliary tools and libraries such as documentation generation
ci Continuous Integration Changes to the continuous integration configuration
docs Documentation Documentation only changes 0.0.1
feat Features A new feature 0.1.0
fix Bug Fixes A bug fix 0.0.1
perf Performance Improvements A code change that improves performance 0.0.1
refactor Code Refactoring A code change that neither fixes a bug nor adds a feature 0.0.1
revert Reverts A commit used to revert a previous commit 0.0.1
style Styles Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.) 0.0.1
test Tests Adding missing or correcting existing tests 0.0.1

Use BREAKING CHANGE to trigger a major version change

Adding BREAKING CHANGE to the footer of the extended description of the commit message will always trigger a major version change, no matter which type has been used. This will be appended to the changelog and release notes as well. To preserve good formatting of these notes, the following format is prescribed:

  • BREAKING CHANGE: <explanation in paragraph format>.

An example of that:

...

BREAKING CHANGE: With the removal of all of the `.sls` files under
`template package`, this formula no longer supports the installation of
packages.