Skip to content

Commit 8a818ce

Browse files
authoredApr 8, 2024··
fix(docs): improve the contribution guidelines (#2552)
* ci(coverage): improve c8 configs * docs: improve Contribute.md * ci: exclude dirs from c8 coverage * ci: adapt c8 limits * ci: adapt Codecov limits * docs: fix typo
1 parent 0f08c7c commit 8a818ce

File tree

4 files changed

+64
-3
lines changed

4 files changed

+64
-3
lines changed
 

‎.nycrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"all": true,
3+
"include": ["index.js", "promise.js", "lib/**/*.js"],
4+
"exclude": ["mysqldata/**", "node_modules/**", "test/**"],
5+
"reporter": ["text", "lcov", "cobertura"],
6+
"statements": 88,
7+
"branches": 84,
8+
"functions": 78,
9+
"lines": 88,
10+
"checkCoverage": true,
11+
"clean": true
12+
}

‎Contributing.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Contributions are always welcomed. You can help **MySQL2** community in various
1616
- Performance improvements
1717
- Add Features
1818

19+
---
20+
1921
## Security Issues
2022

2123
Please contact project maintainers privately before opening a security issue on Github. It will allow us to fix the issue before attackers know about it.
@@ -24,18 +26,22 @@ Please contact project maintainers privately before opening a security issue on
2426

2527
- Andrey Sidorov, sidorares@yandex.ru
2628

29+
---
30+
2731
## New Features
2832

2933
It's better to discuss an API before actually start implementing it. You can open an issue on Github. We can discuss design of API and implementation ideas.
3034

35+
---
36+
3137
## Development
3238

3339
We assume you already have these tools installed on your system:
3440

3541
- MySQL Server
3642
- Node.JS
3743

38-
As **MySQL2** is purely JS based you can develop it on Linux, Mac or Windows. Please follow these steps
44+
As **MySQL2** is purely JS based, you can develop it on Linux, Mac or Windows. Please follow these steps
3945

4046
```bash
4147
# clone node-mysql2
@@ -47,6 +53,40 @@ cd /path/to/node-mysql2
4753
npm install
4854
```
4955

56+
---
57+
58+
### Commits and Pull Request Titles
59+
60+
To ensure a clean commit history pattern, please use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format.
61+
62+
Prefixes that will trigger a new release version:
63+
64+
- `fix:` for patches, e.g., bug fixes that result in a patch version release.
65+
- `feat:` for new features, e.g., additions that result in a minor version release.
66+
67+
Examples:
68+
69+
- `fix: message`
70+
- `feat: message`
71+
- `docs: message`
72+
- `fix(module): message`
73+
- `feat(module): message`
74+
- etc.
75+
76+
---
77+
78+
### Including Tests
79+
80+
#### Fixes
81+
82+
Where possible, provide an error test case that your fix covers.
83+
84+
#### Features
85+
86+
Please ensure test cases to cover your features.
87+
88+
---
89+
5090
### Running Tests
5191

5292
Running tests requires MySQL server and an empty database. You can run `bash` command given below to create `test` database
@@ -77,3 +117,12 @@ FILTER='test-timestamp' npm run test
77117
# or
78118
FILTER='timeout' npm run test
79119
```
120+
121+
> [!Tip]
122+
> You can also run a single test by performing `node ./test/path-to-test-file`.
123+
124+
For testing **coverage**:
125+
126+
```bash
127+
npm run coverage-test
128+
```

‎codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ coverage:
22
status:
33
project:
44
default:
5-
target: 90%
5+
target: 89%
66
threshold: 2%

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test": "poku --debug --include=\"test/esm,test/unit,test/integration\"",
1414
"test:bun": "poku --debug --platform=\"bun\" --include=\"test/esm,test/unit,test/integration\"",
1515
"test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"",
16-
"coverage-test": "c8 -r cobertura -r lcov -r text npm run test",
16+
"coverage-test": "c8 npm run test",
1717
"benchmark": "node ./benchmarks/benchmark.js",
1818
"prettier": "prettier --single-quote --trailing-comma none --write \"{lib,test}/**/*.js\"",
1919
"prettier:docs": "prettier --single-quote --trailing-comma none --write README.md",

0 commit comments

Comments
 (0)
Please sign in to comment.