Skip to content

Commit

Permalink
ci(commitlint): configure commitlint
Browse files Browse the repository at this point in the history
- mention linting for go in README
- configure commitlint with the conventional config
- add Contribution section to readme

progresses #4
  • Loading branch information
catyphram committed Feb 17, 2019
1 parent b1cc6ad commit 5d273ed
Show file tree
Hide file tree
Showing 6 changed files with 1,276 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ api/api
api/api.exe
mongodb/*
!mongodb/.gitkeep
client/coverage/
client/coverage/
node_modules
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
dist: xenial
matrix:
include:
- language: node_js
node_js: "node"
script:
- commitlint-travis
- language: go
go: "1.11"
before_install:
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Once built the executable can be started with `./api -c=/path/to/config.json`, o

#### Testing

Run `UNPROCESSED_IMAGES=/path/to/image/dir PORT=3333 DATABASE=tagallery DATABASE_HOST=localhost:27017 go test ./...` to test all the packages.
Run `go tool vet .` to lint the code and `UNPROCESSED_IMAGES=/path/to/image/dir PORT=3333 DATABASE=tagallery DATABASE_HOST=localhost:27017 go test ./...` to test all the packages.

When testing multiple packages at once the config options HAVE to be set via environment variables.
A config file in the same directory won't work since `go test` changes the working directory for each test to the directory of the to-be-tested package, and specifying a path via `--config /path/to/config.json` will cause [problems](https://stackoverflow.com/a/49927684) due to the flag not being supported by all packages.
Expand All @@ -48,4 +48,13 @@ The client is written using [Vue.js](https://vuejs.org/) with [TypeScript](https

Seek the [Vue Cli ducumentation](https://cli.vuejs.org/guide/cli-service.html) for more information on how to serve, build and test the application via the command line or the Vue Cli UI.

As a quick reference: Start the Vue UI with `vue ui`, or use the scripts `yarn run serve|build|lint|test:e2e|test:unit`.
As a quick reference: Start the Vue UI with `vue ui`, or use the scripts `yarn run serve|build|lint|test:e2e|test:unit`.

### Contribution

Refer to the [API](#testing) and [Client](#client) section for testing and linting instructions.

Commit messages follow the [Conventional Commits specification](https://www.conventionalcommits.org/) and are enforeced by [Commitlint](https://conventional-changelog.github.io/commitlint/#/) using the [conventional config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum).
Keywords may be added to [close a ticket](https://help.github.com/articles/closing-issues-using-keywords/) or otherwise state the progress, e. g. `progresses #1`.

We are following a [feature branching model](https://guides.github.com/introduction/flow/). Changes to the `master` branch have to be made through PRs and need to pass the [CI pipeline](https://travis-ci.org/), which runs linters and tests, before it can be merged via Github. The PR is automatically squashed before the merge.
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"devDependencies": {
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"@commitlint/travis-cli": "^7.5.2",
"husky": "^1.3.1"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
Loading

0 comments on commit 5d273ed

Please sign in to comment.