You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ git fetch upstream
44
44
### 🛠️ Step 2: Build
45
45
Please run all tests that are in repository, all test should pass.
46
46
Please check do you need to activate some additional features that are repository or langauge specific.
47
-
For example in infobip-api-python-sdk, pre-commit hooks must be enabled. [Python Readme](README.md)
47
+
For example in infobip-api-python-sdk, pre-commit hooks must be enabled. See Commit section below.
48
48
49
49
### 🌱 Step 3: Branch
50
50
To keep your development environment organized, create local branches to hold your work.
@@ -66,6 +66,41 @@ Most important things to keep in mind are:
66
66
* 88 character line limits rather than 79. (differ from PEP-8)
67
67
68
68
### ✅ Step 5: Commit
69
+
70
+
#### Enable pre-commit hooks (recommended)
71
+
To enable pre-commit hooks run:
72
+
```bash
73
+
pip install -r requirements/dev.txt
74
+
```
75
+
You will need to install pre-commit hooks
76
+
Using homebrew:
77
+
```bash
78
+
brew install pre-commit
79
+
```
80
+
Using conda (via conda-forge):
81
+
```bash
82
+
conda install -c conda-forge pre-commit
83
+
```
84
+
To check installation run:
85
+
```bash
86
+
pre-commit --version
87
+
```
88
+
If installation was successful you will see version number.
89
+
You can find the Pre-commit configuration in `.pre-commit-config.yaml`.
90
+
Install the git hook scripts:
91
+
```bash
92
+
pre-commit install
93
+
```
94
+
Run against all files:
95
+
```bash
96
+
pre-commit run --all-files
97
+
```
98
+
If setup was successful pre-commit will run on every commit.
99
+
Every time you clone a project that uses pre-commit, running `pre-commit install`
100
+
should be the first thing you do.
101
+
102
+
#### Commit changes
103
+
69
104
It is recommended to keep your changes grouped logically within individual commits.
70
105
Many contributors find it easier to review changes that are split across multiple commits.
71
106
There is no limit to the number of commits in a pull request.
@@ -99,6 +134,12 @@ Bug fixes and features should always come with tests. Looking at other tests to
99
134
Before submitting your changes in a pull request, always run the full test suite.
100
135
Make sure the linter does not report any issues and that all tests pass. Please do not submit patches that fail either check.
101
136
137
+
To run tests position yourself in the project's root while your virtual environment
138
+
is active and run:
139
+
```bash
140
+
python -m pytest
141
+
```
142
+
102
143
### 🚀 Step 8: Push
103
144
Once your commits are ready to go -- with passing tests and linting -- begin the process of opening a pull request by pushing your working branch to your fork on GitHub.
0 commit comments