Skip to content

Latest commit

 

History

History
98 lines (70 loc) · 3.14 KB

CONTRIBUTING.md

File metadata and controls

98 lines (70 loc) · 3.14 KB

Contributing to join

Table of contents

Style guides

Style guides

Git branch strategy

The Branch Strategy is based on git-flow-lite.

  • develop: points to the development of the next release, contains tested and reviewed code.
  • feature/: points to a branch with a new feature, one which is candidate for merge into develop (subject to rebase).
  • fix/: points to a branch with a fix for a particular issue ID.

Note: The latest tag is used to point to the most recent stable release.

Git commit messages

  • Use the present tense ("add feature" not "added feature").
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...").
  • Limit the first line to 80 characters or less.
  • Reference issues and pull requests liberally.
  • If your pull request fixes an existing issue, add "Fixes: " to your pull request description.

Coding style guide

  • All bash files in this project must use snake case.

  • Constants should be uppercase.

  • Functions should not be defined with the function keyword.

  • Section of code should be delimited with:

    ###########
    # SECTION #
    ###########
  • Subection of code should be delimited with:

    # subsection #

Indentation

  • For Bash files (src/*): 1 tabulation
  • For Makefile files: 1 tabulation
  • For Markdown files (*.md): 4 spaces
  • For shellspec files (spec/*_spec.sh): 1 tabulation

ShellSpec

In this project, testing is provided by ShellSpec.

First, it is recommended to consult the README.md file and the references in order to create suitable tests.

The helper directory is at helper/ and tests are in spec/.

ShellSpec uses --sandbox; for this reason, if an external command is needed, a support command should be created. If this command is only used in a spec/*_spec.sh file, the associated support command name should be prefixed by @.

Respect code hiearchy by using Describe in order to group correctly the different examples.

The following aliases should be preferred:

  • *Describe
  • *It
  • BeforeEach
  • AfterEach

For group containing only one anonymous example, Before and After should be used.

Describe "Test helper function"
    Describe "for target management"
        Describe '`get_current_target()`'
            Describe "with set configuration"
                Before setup_set_unmanaged
                After cleanup_set_unmanaged

                It
                    When call get_current_target
                    The output should eq 1
                    The status should be success
                End
            End
        End
    End
End