-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add config, workflows, tools and README
Release-As: 1.0.0 [FBTLOPS-159]
- Loading branch information
0 parents
commit f4a073d
Showing
7 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
Submodule workflows
added at
0fd09e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.DEFAULT_GOAL := lint | ||
GITHUB_BASE_REF ?= master | ||
|
||
.PHONY: lint | ||
lint: | ||
commitlint -g index.js --from=$$(git rev-parse remotes/origin/$(GITHUB_BASE_REF)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Config Commitlint | ||
|
||
Commitlint configuration used at flagbit | ||
|
||
## How can I use this in my project? | ||
|
||
Create a new file named `commitlint.config.js` in your projects root directory, | ||
including this content: | ||
|
||
```javascript | ||
module.exports = { | ||
extends: ["@flagbit/config-commitlint"], | ||
parserPreset: { | ||
parserOpts: { | ||
issuePrefixes: ["FBTLOPS-"], | ||
}, | ||
}, | ||
}; | ||
``` | ||
|
||
...add (or extend an existing) Makefile to include a `lint` target: | ||
|
||
```makefile | ||
.DEFAULT_GOAL := lint | ||
GITHUB_BASE_REF ?= master | ||
|
||
.PHONY: lint | ||
lint: | ||
commitlint -g index.js --from=$$(git rev-parse remotes/origin/$(GITHUB_BASE_REF)) | ||
``` | ||
|
||
...and finally add a github-workflow to your project by placing a file named | ||
`commitlint.yml` to the `.github/workflows/`-directory in your project. If this | ||
directory is not existing, then you can simply create it. The `commitlint.yml` | ||
needs to include this content: | ||
|
||
```yml | ||
name: commitlint | ||
on: pull_request | ||
|
||
jobs: | ||
commitlint: | ||
name: Lint Commit Messages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- run: | | ||
yarn global add @commitlint/cli @flagbit/config-commitlint | ||
echo "$(yarn global bin)" >> $GITHUB_PATH | ||
- run: make lint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'body-case': [2, 'always', 'sentence-case'], | ||
'body-leading-blank': [2, 'always'], | ||
'body-max-line-length': [2, 'always', 72], | ||
'footer-leading-blank': [2, 'always'], | ||
'footer-max-line-length': [2, 'always', 72], | ||
'header-max-length': [2, 'always', 72], | ||
'header-min-length': [2, 'always', 30], | ||
'references-empty': [2, 'never'], | ||
'scope-case': [2, 'always', 'lower-case'], | ||
'subject-case': [2, 'always', 'sentence-case'], | ||
'subject-empty': [2, 'never'], | ||
'subject-full-stop': [2, 'never', '.'], | ||
'type-case': [2, 'always', 'lower-case'], | ||
'type-empty': [2, 'never'], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'build', | ||
'chore', | ||
'ci', | ||
'docs', | ||
'feat', | ||
'fix', | ||
'perf', | ||
'refactor', | ||
'revert', | ||
'style', | ||
'test', | ||
], | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@flagbit/config-commitlint", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@commitlint/config-conventional": "^12.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"@commitlint/config-conventional@^12.0.1": | ||
version "12.0.1" | ||
resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-12.0.1.tgz#7bf3bbf68bda967c5165135ebe8f2055decf1a83" | ||
integrity sha512-1ZhB135lh47zVmf1orwcjxuKuam11fJIH/bdVxW9XiQv8XPwC6iIp19knfl8FcOT78AVBnes1z6EVxgUeP2/4Q== | ||
dependencies: | ||
conventional-changelog-conventionalcommits "^4.3.1" | ||
|
||
array-ify@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" | ||
integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= | ||
|
||
compare-func@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" | ||
integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== | ||
dependencies: | ||
array-ify "^1.0.0" | ||
dot-prop "^5.1.0" | ||
|
||
conventional-changelog-conventionalcommits@^4.3.1: | ||
version "4.5.0" | ||
resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz#a02e0b06d11d342fdc0f00c91d78265ed0bc0a62" | ||
integrity sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw== | ||
dependencies: | ||
compare-func "^2.0.0" | ||
lodash "^4.17.15" | ||
q "^1.5.1" | ||
|
||
dot-prop@^5.1.0: | ||
version "5.3.0" | ||
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" | ||
integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== | ||
dependencies: | ||
is-obj "^2.0.0" | ||
|
||
is-obj@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" | ||
integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== | ||
|
||
lodash@^4.17.15: | ||
version "4.17.21" | ||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" | ||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== | ||
|
||
q@^1.5.1: | ||
version "1.5.1" | ||
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" | ||
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= |