Skip to content

Latest commit

History

History
59 lines (46 loc) 路 2.18 KB

CONTRIBUTING.md

File metadata and controls

59 lines (46 loc) 路 2.18 KB

Contributing Code

A good pull request:

  • Is clear.

  • Works across all supported versions of Go.

  • Follows the existing style of the code base .

  • Has comments included as needed.

  • A test case that demonstrates the previous flaw that now passes with the included patch, or demonstrates the newly added feature.

  • If it adds/changes a public API, it must also include documentation for those changes.

  • Must be appropriately licensed.

Reporting An Issue/Feature

First, check to see if there's an existing issue/pull request for the bug/feature. All issues are at https://github.com/lindsaygelle/slice/issues and pull reqs are at https://github.com/lindsaygelle/slice/pulls.

If there isn't an existing issue there, please file an issue. The ideal report includes:

  • A description of the problem/suggestion.

  • How to recreate the bug.

  • If relevant, including the versions of your:

    • Go language
    • slice
    • Optionally of the other dependencies involved
  • If possible, create a pull request with a (failing) test case demonstrating what's wrong. This makes the process for fixing bugs quicker & gets issues resolved sooner.

Codestyle

This project uses Go format to enforce codstyle requirements. We've codified this process using a tool called pre-commit <https://pre-commit.com/>__. pre-commit allows us to specify a config file with all tools required for code linting, and surfaces either a git commit hook, or single command, for enforcing these.

To validate your PR prior to publishing, you can use the following installation guide <https://pre-commit.com/#install>__ to setup pre-commit.

If you don't want to use the git commit hook, you can run the below command to automatically perform the codestyle validation:

.. code-block:: bash

$ pre-commit run

This will automatically perform simple updates (such as white space clean up) and provide a list of any failing Go formatting checks. After these are addressed, you can commit the changes prior to publishing the PR. These checks are also included in our CI setup under the "Lint" workflow which will provide output on Github for anything missed locally.