Skip to content

Commit 0c17a90

Browse files
authored
feat: 🎸 add husky (#3)
* feat: add husky and jest * feat: 🎸 add new husky cli config * feat: 🎸 add commit lint * feat: 🎸 add ISSUE_TEMPLATE and PULL_REQUEST_TEMPLATE * feat: 🎸 add new workflows to Github actions * fix: 🐛 Fix node version CI
1 parent 3fc8c9a commit 0c17a90

File tree

12 files changed

+6007
-1724
lines changed

12 files changed

+6007
-1724
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Comportamento desejado
2+
3+
### Comportamento atual
4+
5+
### Como reproduzir o comportamento

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Briefly describe the changes.
2+
3+
## Checklist :white_check_mark:
4+
- [ ] Change X
5+
- [ ] Change Y
6+
7+
## How to test :wave:
8+
1.
9+
2.
10+
11+
## Screenshot :camera_flash:
12+
Before and after
13+
14+
## Requirements :pencil2:
15+
Kanbanize link
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"LABEL": {
3+
"name": "non-standard title",
4+
"color": "FF0000"
5+
},
6+
"CHECKS": {
7+
"regexp": "(fix|feat|test|docs|perf|chore|refactor|style|ci|build)(\\([^\\)]+\\))?: .*$",
8+
"regexpFlags": "i",
9+
"ignoreLabels": [
10+
"HOTFIX",
11+
"no-verify"
12+
]
13+
},
14+
"MESSAGES": {
15+
"success": "All OK",
16+
"failure": "Failing in title test",
17+
"notice": ""
18+
}
19+
}

.github/workflows/CI.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Sonar Cloud
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
ci:
12+
runs-on: ubuntu-latest
13+
14+
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Use Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
- name: Install Project
24+
run: npm install
25+
- name: CI
26+
run: npm ci
27+
- name: Build
28+
run: npm run build --if-present
29+
- name: Tests
30+
run: npm run test
31+
32+
33+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "PR Title Checker"
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
- labeled
9+
- unlabeled
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: thehanimo/[email protected]
16+
with:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
pass_on_octokit_error: true

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit $1

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm test

.husky/prepare-commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
exec < /dev/tty && npx git-cz --hook || true

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
}

0 commit comments

Comments
 (0)