github.com/clusterize-io/tusk@v0.6.3-0.20211001020217-cfe8a8cd0d4a/CONTRIBUTING.md (about)

     1  # Contributing
     2  
     3  All contributions are welcome and appreciated. Feel free to open issues or pull
     4  requests for any fixes, changes, or new features, and if you are not sure about
     5  anything, open it anyway. Issues and pull requests are a great forum for
     6  discussion and a great opportunity to help improve the code as a whole.
     7  
     8  ## Opening Issues
     9  
    10  A great way to contribute to the project is to open GitHub issues whenever you
    11  encounter any issue, or if you have an idea on how Tusk can improve. Missing
    12  or incorrect documentation are issues too, so feel free to open one whenever
    13  you feel there is a chance to make Tusk better.
    14  
    15  When reporting a bug, make sure to include the expected behavior and steps to
    16  reproduce. The more descriptive you can be, the faster the issue can be
    17  resolved.
    18  
    19  ## Opening Pull Requests
    20  
    21  Always feel free to open a pull request, whether it is a fix or a new addition.
    22  For big or breaking changes, you might consider opening an issue first to check
    23  interest, but it is absolutely not required to make a contribution.
    24  
    25  Tests are run automatically on each PR, and 100% test and lint pass rate is
    26  required to get the code merged in, although it is fine to have work-in-
    27  progress pull requests open while debugging. Details on how to run the test
    28  suite can be found [here](#running-tests).
    29  
    30  For features which change the spec of the configuration file, documentation
    31  should be added in [docs/spec.md][spec.md].
    32  
    33  ## Setting Up a Development Environment
    34  
    35  For local development, you will need Go version 1.11+ installed.
    36  
    37  Tusk uses go modules for dependency management, so make sure to clone the
    38  project outside of the `GOPATH`. If that doesn't mean anything to you, you're
    39  probably fine.
    40  
    41  ```bash
    42  git clone https://github.com/clusterize-io/tusk.git
    43  ```
    44  
    45  If it is not already on your path, you probably also want to have the `GOPATH`
    46  binary directory available for projects installed by `go get` and `go install`.
    47  To do so, add the following to your `.bash_profile` or `.zshrc`:
    48  
    49  ```bash
    50  export PATH="$PATH:$(go env GOPATH)/bin"
    51  ```
    52  
    53  To install Tusk:
    54  
    55  ```bash
    56  go install
    57  ```
    58  
    59  If you have already installed tusk from another source, make sure you test
    60  against the development version installed locally. If you do not get `dev` as
    61  the version, you may need to move your Go binary path earlier in your `PATH`:
    62  
    63  ```bash
    64  $ tusk --version
    65  dev
    66  ```
    67  
    68  Once `tusk` is on your path, make sure to run the `bootstrap` command to
    69  install all other dependencies:
    70  
    71  ```bash
    72  tusk bootstrap
    73  ```
    74  
    75  ## Making Changes
    76  
    77  If you have not yet done so, make sure you fork the repository so you can push
    78  your changes back to your own fork on GitHub.
    79  
    80  When starting work on a new feature, create a new branch based off the `master`
    81  branch. Pull requests should generally target the `master` branch, and releases
    82  will be cut separately.
    83  
    84  ## Running Tests
    85  
    86  To run the unit tests:
    87  
    88  ```bash
    89  tusk test
    90  ```
    91  
    92  To run the full test suite, along with the linter:
    93  
    94  ```bash
    95  tusk test -a
    96  ```
    97  
    98  If the linter fails, execution will stop short and not actually run the
    99  unit test suite. If there is a linter error that is a false-positive, or the
   100  violation is necessary for your contribution, you can disable a specific linter
   101  for that line:
   102  
   103  ```golang
   104  cmd := exec.Command("sh", "-c", command) // nolint: gosec
   105  ```
   106  
   107  [spec.md]: https://github.com/clusterize-io/tusk/blob/master/docs/spec.md