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
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,9 +145,11 @@ The `PySQLStagingIngestionTestSuite` namespace requires a cluster running DBR ve
145
145
The suites marked `[not documented]` require additional configuration which will be documented at a later time.
146
146
147
147
148
-
### Code formatting
148
+
### Code formatting and linting
149
149
150
-
This project uses [Black](https://pypi.org/project/black/).
150
+
This project uses [Black](https://pypi.org/project/black/) for code formatting and [Pylint](https://pylint.org/) for linting.
151
+
152
+
#### Black
151
153
152
154
```
153
155
poetry run python3 -m black src --check
@@ -157,6 +159,25 @@ Remove the `--check` flag to write reformatted files to disk.
157
159
158
160
To simplify reviews you can format your changes in a separate commit.
159
161
162
+
#### Pylint
163
+
164
+
```
165
+
poetry run pylint --rcfile=pylintrc src
166
+
```
167
+
168
+
#### Pre-commit hooks
169
+
170
+
We use [pre-commit](https://pre-commit.com/) to automatically run Black and other checks before each commit.
171
+
172
+
To set up pre-commit hooks:
173
+
174
+
```bash
175
+
# Set up the git hooks
176
+
poetry run pre-commit install
177
+
```
178
+
179
+
This will set up the hooks defined in `.pre-commit-config.yaml` to run automatically on each commit.
180
+
160
181
### Change a pinned dependency version
161
182
162
183
Modify the dependency specification (syntax can be found [here](https://python-poetry.org/docs/dependency-specification/)) in `pyproject.toml` and run one of the following in your terminal:
0 commit comments