Skip to content

Commit 254f409

Browse files
committed
add(docs): create contribute.rst for contribution guidelines and pre-commit setup
1 parent 4dce763 commit 254f409

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

docs/contribute.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
How to contribute
2+
=================
3+
4+
.. code-block:: bash
5+
git clone git@github.com:kelsoncm/sc4.git ~/projetos/PESSOAL/sc4py
6+
code ~/projetos/PESSOAL/sc4py
7+
8+
Pre-commit
9+
----------
10+
11+
This repository uses [pre-commit](https://pre-commit.com/) to run quality checks
12+
before each commit and coverage regression checks before each push.
13+
14+
**Setup:**
15+
16+
.. code-block:: bash
17+
python -m venv .venv
18+
.venv\bin\activate
19+
.\.venv\Scripts\Activate.ps1
20+
pip install --upgrade pip uv
21+
uv pip install --upgrade -e ".[dev]"
22+
pre-commit install
23+
pre-commit install --hook-type pre-push
24+
25+
Run manually:
26+
27+
.. code-block:: bash
28+
pre-commit run --all-files
29+
pre-commit run --hook-stage pre-push --all-files
30+
31+
**Hooks:**
32+
33+
* **pre-commit**
34+
* `trailing-whitespace` for eliminating trailing whitespace
35+
* `end-of-file-fixer` for ensuring files end with a newline
36+
* `check-yaml` for validating YAML files
37+
* `check-added-large-files` for preventing large files from being committed
38+
* `black` for code formatting
39+
* `ruff` for linting and static analysis
40+
* `doc8` for checking documentation style
41+
* `markdownlint` for checking Markdown style
42+
* **pre-push**:
43+
* `pytest` for running tests
44+
* `pytest-coverage-gate` for checking test coverage
45+
* **GitHub Actions only**
46+
* `semgrep` for security and code quality checks

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,4 @@ Next steps
116116
api-readers
117117
api-renders
118118
api-hydrating
119+
contribute

0 commit comments

Comments
 (0)