github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/CONTRIBUTING.md (about)

     1  # Contributing
     2  
     3  We'd love to accept your patches and contributions to this project. There are
     4  just a few small guidelines you need to follow.
     5  
     6  ## Code reviews
     7  
     8  All submissions, including submissions by project members, require review. We
     9  use GitHub pull requests for this purpose. Consult
    10  [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
    11  information on using pull requests.
    12  
    13  # Local Development
    14  
    15  ## Linting your code
    16  
    17  There is a `make` rule for linting. Requirements for it are included in the docker image.
    18  
    19  ```sh
    20  source util/commands.sh
    21  wptd_exec_it make lint
    22  ```
    23  
    24  To run outside docker, you'll need to install `golint` and `eslint`.
    25  
    26  Globally (in `wpt.fyi` root):
    27  ```sh
    28  npm install -g eslint babel-eslint eslint-plugin-html
    29  make test
    30  ```
    31  
    32  Locally (in `webapp/` dir):
    33  ```sh
    34  npm install
    35  npm test
    36  ```
    37  
    38  ## Testing your code
    39  
    40  There is a number of `make` rule for testing. To run tests in docker:
    41  
    42  ```sh
    43  source util/commands.sh
    44  wptd_exec_it make test
    45  ```
    46  
    47  See [`Makefile`](/Makefile) for more fine grained targets which take less time to run.
    48  
    49  ## Git prepush
    50  
    51  You should set up your repo to run `make prepush` in docker when you're pushing, to help catch trivial build/lint errors.
    52  See [the git hooks folder](/git/hooks) for instructions.
    53  
    54  # Coding Guidelines
    55  
    56  ## License header
    57  
    58  All source files (including `.js`, `.go`, `.html`, `.css`) must begin with a comment of the below header:
    59  
    60  ```go
    61  // Copyright {YEAR} The WPT Dashboard Project. All rights reserved.
    62  // Use of this source code is governed by a BSD-style license that can be
    63  // found in the LICENSE file.
    64  ```