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
DGtal uses [pre-commit](https://pre-commit.com/) to ensure code quality and consistency. Before making contributions, we highly recommend setting up pre-commit hooks:
54
+
55
+
### Installation
56
+
57
+
1.**Install pre-commit** (if not already installed):
58
+
```bash
59
+
pip install pre-commit
60
+
```
61
+
62
+
2.**Install the hooks** in your local repository:
63
+
```bash
64
+
cd /path/to/DGtal
65
+
pre-commit install
66
+
```
67
+
68
+
### What the hooks do
69
+
70
+
The current pre-commit configuration (`/.pre-commit-config.yaml`) includes:
71
+
- Removes trailing whitespace
72
+
- Ensures files end with a newline
73
+
- Validates YAML syntax
74
+
- Prevents large files from being committed
75
+
- Checks for broken symlinks
76
+
- Detects case conflicts in filenames
77
+
78
+
### Running hooks manually
79
+
80
+
To run all hooks on all files:
81
+
```bash
82
+
pre-commit run --all-files
83
+
```
84
+
85
+
To run hooks on specific files:
86
+
```bash
87
+
pre-commit run --files path/to/your/files
88
+
```
89
+
90
+
### Updating hooks
91
+
92
+
To update to the latest versions of the hooks:
93
+
```bash
94
+
pre-commit autoupdate
95
+
pre-commit run --all-files
96
+
```
97
+
98
+
### Skipping hooks (not recommended)
99
+
100
+
If you absolutely need to skip hooks (not recommended for regular development):
101
+
```bash
102
+
git commit --no-verify -m "Commit message"
103
+
```
104
+
105
+
### Troubleshooting
106
+
107
+
- If hooks fail, fix the reported issues and try committing again
108
+
- For persistent issues, you can temporarily disable specific hooks in `/.pre-commit-config.yaml`
109
+
- Ensure you're using a compatible Python version (3.6+)
Copy file name to clipboardExpand all lines: ChangeLog.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
5
5
-*Project*
6
6
- pre-commit hooks have been activated for sanity checks on files before running the git commit (David Coeurjolly, [#1835](https://github.com/DGtal-team/DGtal/pull/1835))
0 commit comments