|
| 1 | +<!-- |
| 2 | +SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel |
| 3 | +SPDX-License-Identifier: LicenseRef-PDL-1.0 |
| 4 | +--> |
| 5 | +# Install pre-commit hooks |
| 6 | + |
| 7 | +As a contributor to the project, you can use pre-commit hooks to perform some |
| 8 | +verifications before committing your work. This document describes how to |
| 9 | +install them. |
| 10 | + |
| 11 | +The use of these pre-commit hooks is not required, but will allow you to check |
| 12 | +things that will otherwise fail later when the GitHub Actions are run. |
| 13 | + |
| 14 | +## Installation instructions |
| 15 | + |
| 16 | +1. Install a recent version of Python 3. |
| 17 | +2. Install pre-commit using pip (see also <https://pre-commit.com/#install>): |
| 18 | + ``` |
| 19 | + pip install pre-commit |
| 20 | + ``` |
| 21 | +3. From the root of the Jaybird repository, run: |
| 22 | + ``` |
| 23 | + pre-commit install |
| 24 | + ``` |
| 25 | + |
| 26 | +Now the pre-commit hooks are installed and will run before commit. |
| 27 | + |
| 28 | +## Available pre-commit hooks |
| 29 | + |
| 30 | +Jaybird currently defines the following pre-commit hooks: |
| 31 | + |
| 32 | +### reuse |
| 33 | + |
| 34 | +Checks if appropriate copyright and license information is present, verifies |
| 35 | +compliance with the REUSE specification. |
| 36 | + |
| 37 | +If you want to be able to run `reuse` manually, follow the installation instructions on <https://github.com/fsfe/reuse-tool?tab=readme-ov-file#install>. |
| 38 | + |
| 39 | +A manual compliance check can then be run with: |
| 40 | + |
| 41 | +``` |
| 42 | +reuse lint |
| 43 | +``` |
| 44 | + |
| 45 | +## License Notice |
| 46 | + |
| 47 | +The contents of this Documentation are subject to the Public Documentation |
| 48 | +License Version 1.0 (the “License”); you may only use this Documentation if you |
| 49 | +comply with the terms of this License. A copy of the License is available at |
| 50 | +<https://firebirdsql.org/en/public-documentation-license/>. |
| 51 | + |
| 52 | +The Original Documentation is "Install pre-commit hooks". |
| 53 | +The Initial Writer of the Original Documentation is Mark Rotteveel, |
| 54 | +Copyright © 2025. All Rights Reserved. (Initial Writer contact(s): |
| 55 | +mark (at) lawinegevaar (dot) nl). |
| 56 | + |
| 57 | +<!-- |
| 58 | +Contributor(s): ______________________________________. |
| 59 | +Portions created by ______ are Copyright © _________ [Insert year(s)]. All Rights Reserved. |
| 60 | +(Contributor contact(s): ________________ [Insert hyperlink/alias]). |
| 61 | +--> |
| 62 | + |
| 63 | +The exact file history is recorded in our Git repository; see |
| 64 | +<https://github.com/FirebirdSQL/jaybird> |
0 commit comments