Skip to content

Latest commit

 

History

History
111 lines (71 loc) · 3.47 KB

CONTRIBUTING.md

File metadata and controls

111 lines (71 loc) · 3.47 KB

Contributing to bashunit

We have a Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Any contributions you make will be under the MIT License

When you submit code changes, your submissions are understood to be under the same MIT that covers the project. By contributing to this project, you agree that your contributions will be licensed under its MIT.

Write bug reports with detail, background, and sample code

In your bug report, please provide the following:

  • A quick summary and/or background
  • Steps to reproduce
    • Be specific!
    • Give sample code if you can.
  • What you expected would happen
  • What actually happens
  • Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

Please post code and output as text (using proper markup). Additional screenshots to help contextualize behavior are ok.

Workflow for Pull Requests

  1. Fork/clone the repository.
  2. Create your branch from main if you plan to implement new functionality or change existing code significantly.
  3. Implement your change and add tests for it.
  4. Ensure the test suite passes.
  5. Ensure the code complies with our coding guidelines (see below).
  6. Send that pull request!

Please make sure you have set up your username and email address for use with Git. Strings such as silly nick name <root@localhost> looks bad in the commit history of a project.


Development

  • Entry point create-pr
  • Isolated testable functions inside files under the src directory

Build

You can build the whole project into a single executable script combining all files from src and the entry point.

./build.sh

Testing

Install dependencies: ./install-dependencies.sh

Run tests:

# using make
make test

# using bashunit directly
lib/bashunit tests

Coding Guidelines

ShellCheck

To contribute to this repository you must have ShellCheck installed on your local machine or IDE, since it is the static code analyzer that is being used in continuous integration pipelines.

Installation: https://github.com/koalaman/shellcheck#installing

Example of usage

# using make
make sa

# using ShellCheck itself
shellcheck ./**/**/*.sh -C

editorconfig-checker

To contribute to this repository, consider installing editorconfig-checker to check all project files regarding the .editorconfig to ensure we all fulfill the standard.

Installation: https://github.com/editorconfig-checker/editorconfig-checker#installation

To run it, use the following command:

# using make
make lint

# using editorconfig-checker itself
ec -config .editorconfig

This command will be executed on the CI to ensure the project's quality standards.

We recommend

To install the pre-commit of the project with the following command:

Please note that you will need to have ShellCheck and editorconfig-checker installed on your computer. See above how to install in your local.

make pre_commit/install

Shell Guide by Google Conventions.