Contributing
Contributions are welcome.
Code quality control
All files inside this project are automatically built, linted and tested by CircleCI.
Builds will only pass if they meet the following criteria:
- No ESLint errors: We use ESLint to lint our entire JavaScript code. The config used is eslint-config-lsage. Any lint errors will cause the build to fail.
- Test coverage >= 90%: We use istanbul to validate test coverage is at least 90 percent. Any commits not covered by tests will cause the build to fail.
- Documentation coverage >= 90%: Our source code is documented using ESDoc. We will only merge if your contribution is documented as well.
Setting up the development environment
In order to meet out coding guideline it's very useful to have your development environment set up right.
Linting files
You can lint all source files by running npm run lint
. Although most IDEs support running it directly in the editor:
Jetbrains Webstorm
Webstorm has built-in support for ESLint. Check out their documentation to set it up.
Atom
Atom has several packages that provide support for inline ESLint validation. We recommend you to use linter-eslint.
Running tests
Our mocha tests can be run by calling npm test
. If you want the tests to be run right after you saved your changes, then run npm run test:watch
.
Test coverage can be checked by running npm run test:coverage
.
Creating API documentation
Run npm run docs
to create ESDoc API documentation.
Providing fixes / adding features
Take the following steps:
- Create a new branch / fork of the beta branch, which is our development branch
- Make your changes
- Make sure CI tests pass
- Send a pull request to merge back to beta
Once we reviewed your changes, we'll merge your pull request.
Merge strategy (Maintainers only)
- Accepted changes from fix/feature branches should always be squash-merged to beta.
- Once beta is stable create a regular merge commit to merge back to master.
- After merging to master, changes should be synced back to the beta branch. To do so, run:
git checkout beta git fetch git rebase origin/master # Solve conflicts if any, accepting changes from master git commit -m 'chore: Update from master' git push