github.com/oweisse/u-root@v0.0.0-20181109060735-d005ad25fef1/CONTRIBUTING.md (about)

     1  # Contributing to u-root
     2  
     3  We need help with this project. Contributions are very welcome. See the [roadmap](roadmap.md), open [issues](https://github.com/u-root/u-root/issues), and join us in [Slack](CONTRIBUTING.md#communication) to talk about your cool ideas for the project.
     4  
     5  ## Code of Conduct
     6  
     7  Conduct collaboration around u-root in accordance to the [Code of
     8  Conduct](https://github.com/u-root/u-root/wiki/Code-of-Conduct).
     9  
    10  ## Communication
    11  
    12  - [Slack](https://u-root.slack.com), sign up
    13  [here](http://slack.u-root.com/)
    14  - [Join the mailing list](https://groups.google.com/forum/#!forum/u-root)
    15  
    16  ## Bugs
    17  
    18  - Please submit issues to https://github.com/u-root/u-root/issues
    19  
    20  ## Coding Style
    21  
    22  The ``u-root`` project aims to follow the standard formatting recommendations
    23  and language idioms set out in the [Effective Go](https://golang.org/doc/effective_go.html)
    24  guide, for example [formatting](https://golang.org/doc/effective_go.html#formatting)
    25  and [names](https://golang.org/doc/effective_go.html#names).
    26  
    27  `gofmt` and `golint` are law, although this is not automatically enforced
    28  yet and some housecleaning needs done to achieve that.
    29  
    30  We have a few rules not covered by these tools:
    31  
    32  - Standard imports are separated from other imports. Example:
    33      ```
    34      import (
    35        "regexp"
    36        "time"
    37  
    38        dhcp "github.com/krolaw/dhcp4"
    39      )
    40      ```
    41  
    42  ## Developer Sign-Off
    43  
    44  For purposes of tracking code-origination, we follow a simple sign-off
    45  process.  If you can attest to the [Developer Certificate of
    46  Origin](https://developercertificate.org/) then you append in each git
    47  commit text a line such as:
    48  ```
    49  Signed-off-by: Your Name <username@youremail.com>
    50  ```
    51  ## Patch Format
    52  
    53  Well formatted patches aide code review pre-merge and code archaeology in
    54  the future.  The abstract form should be:
    55  ```
    56  <component>: Change summary
    57  
    58  More detailed explanation of your changes: Why and how.
    59  Wrap it to 72 characters.
    60  See [here] (http://chris.beams.io/posts/git-commit/)
    61  for some more good advices.
    62  
    63  Signed-off-by: <contributor@foo.com>
    64  ```
    65  
    66  An example from this repo:
    67  ```
    68  tcz: quiet it down
    69  
    70  It had a spurious print that was both annoying and making
    71  boot just a tad slower.
    72  
    73  Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
    74  ```
    75  
    76  ## General Guidelines
    77  
    78  We want to implement some of the common commands that exist in upstream projects and elsewhere, but we don't need to copy broken behavior. CLI compatibility with existing implementations isn't required. We can add missing functionality and remove broken behavior from commands as needed.
    79  
    80  U-root needs to fit onto small flash storage, (eg. 8 or 16MB SPI). Be cognizant of of how your work is increasing u-root's footprint. The current goal is to keep the BB mode `lzma -9` compressed initramfs image under 3MB.
    81  
    82  ## Pull Requests
    83  
    84  We accept GitHub pull requests.
    85  
    86  Fork the project on GitHub, work in your fork and in branches, push
    87  these to your GitHub fork, and when ready, do a GitHub pull requests
    88  against https://github.com/u-root/u-root.
    89  
    90  `u-root` uses [dep](https://github.com/golang/dep)
    91  for its dependency management. Please run `dep ensure`, `dep prune`, and commit Gopkg.toml, Gopkg.lock and vendor/ changes before opening a pull request.
    92  
    93  Every commit in your pull request needs to be able to build and pass the CI tests.
    94  
    95  If the pull request closes an issue please note it as: `"Fixes #NNN"`.
    96  
    97  ## Code Reviews
    98  
    99  Look at the area of code you're modifying, its history, and consider
   100  tagging some of the [maintainers](https://u-root.tk/#contributors) when doing a
   101  pull request in order to instigate some code review.
   102  
   103  ## Quality Controls
   104  
   105  [CircleCI](https://circleci.com/gh/u-root/u-root) is used to test and build commits in a pull request.
   106  
   107  See [.circleci/config.yml](.circleci/config.yml) for the CI commands run. [test.sh](test.sh) is maintained as an easy way to run the commands locally. Additionally you can use [CircleCI's CLI tool](https://circleci.com/docs/2.0/local-jobs/) to run individual jobs from `.circlecl/config.yml` via Docker, eg. `circleci build --jobs dep`.