Skip to content

Latest commit

 

History

History
116 lines (80 loc) · 2.34 KB

CONTRIBUTING.md

File metadata and controls

116 lines (80 loc) · 2.34 KB

Contributing

We love every form of contribution. By participating to this project, you agree to abide to the fakedata code of conduct.

Setup your machine

Our Makefile is the entry point for most of the activities you will run into as a contributor. To get a basic understanding of what you can do with it, you can run:

make help

Which shows documented targets. fakedata is written in Go. Here is a list of prerequisites to build and test the code:

Clone fakedata from source:

$ git clone https://github.com/lucapette/fakedata.git
# Cloning into 'fakedata'...
# etc..
$ cd fakedata

A good way of making sure everything is all right is running the test suite:

make test

Open an issue if you run into any problem.

Building and running fakedata

You can build the entire application by running make without arguments:

make

since build is the default target.

You can run fakedata following the steps:

make
$ ./fakedata username -l 3
RussellBishop
g3d
rude

Testing

We try to cover as much as we can with testing. The goal is having each single feature covered by one or more tests. Adding more tests is a great way of contributing to the project!

Running the tests

Once you are setup, you can run the test suite with one command:

make test

You can run only a subset of the tests using the TEST_PATTERN variable:

make test TEST_PATTERN=TheAnswerIsFortyTwo

You can use pass options to go test through the TEST_OPTIONS variable:

make test TEST_OPTIONS=-v

You can combine the two options which is very helpful if you are working on a specific feature and want immediate feedback. Like so:

make test TEST_OPTIONS=-v TEST_PATTERN=TheAnswerIsFortyTwo

Test your change

You can create a branch for your changes and try to build from the source as you go:

make build

When you are satisfied with the changes, we suggest running:

make lint

This command runs the linters and the tests the same way we run them in our CI system.

Submit a pull request

Push your branch to your fakedata fork and open a pull request against the main branch.