|
| 1 | +MiraGeoscience.Pre-Commit Hooks |
| 2 | +=============================== |
| 3 | + |
| 4 | +This repository provides a collection of pre-commit hooks to automate |
| 5 | +essential checks and streamline your development workflow. By utilizing |
| 6 | +these hooks, you can maintain code quality and consistency across your |
| 7 | +projects, fostering a more efficient and collaborative development |
| 8 | +environment. |
| 9 | + |
| 10 | +Included Hooks |
| 11 | +^^^^^^^^^^^^^^ |
| 12 | + |
| 13 | +- ``check-copyright``: Checks for valid copyright statements in files. |
| 14 | +- ``prepare-commit-msg``: Adds the JIRA ID found in the branch name |
| 15 | + in case it is missing from the commit message. |
| 16 | +- ``check-commit-message``: Checks that the branch name or the commit |
| 17 | + message starts with a reference to JIRA, and if the message meets the |
| 18 | + minimum required length for the summary line. Also checks that the JIRA ID in |
| 19 | + the commit message is consistEnt with the one extracted from the |
| 20 | + branch name (if any). |
| 21 | + |
| 22 | +Usage |
| 23 | +^^^^^ |
| 24 | + |
| 25 | +Example of ``.pre-commit-config.yamnl``: |
| 26 | + |
| 27 | +.. code:: yaml |
| 28 | +repos: |
| 29 | + - repo: http://github.com/MiraGeoscience/pre-commit-hooks |
| 30 | + rev: <release> |
| 31 | + hooks: |
| 32 | + - id: check-copyright |
| 33 | + types: [text] |
| 34 | + files: (^LICENSE|^README(|-dev).rst|\.py|\.pyi)$ |
| 35 | + exclude: (^\.|^docs/) |
| 36 | + - id: prepare-commit-msg |
| 37 | + - id: check-commit-msg |
| 38 | + |
| 39 | +License |
| 40 | +^^^^^^^ |
| 41 | + |
| 42 | +MIT License |
| 43 | + |
| 44 | +Copyright (c) 2024 Mira Geoscience |
| 45 | + |
| 46 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 47 | +of this software and associated documentation files (the "Software"), to deal |
| 48 | +in the Software without restriction, including without limitation the rights |
| 49 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 50 | +copies of the Software, and to permit persons to whom the Software is |
| 51 | +furnished to do so, subject to the following conditions: |
| 52 | + |
| 53 | +The above copyright notice and this permission notice shall be included in all |
| 54 | +copies or substantial portions of the Software. |
| 55 | + |
| 56 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 57 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 58 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 59 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 60 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 61 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 62 | +SOFTWARE. |
| 63 | + |
| 64 | +Copyright |
| 65 | +^^^^^^^^^ |
| 66 | +Copyright (c) 2024 Mira Geoscience Ltd. |
0 commit comments