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: README.md
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,18 +75,51 @@ hooks:
75
75
76
76
## 🔄 Migration from `pre-commit`
77
77
78
-
RustyHook can run `.pre-commit-config.yaml` directly:
78
+
RustyHook is designed to be a drop-in replacement for [pre-commit](https://pre-commit.com/), making migration as seamless as possible.
79
+
80
+
### Compatibility Mode
81
+
82
+
The easiest way to start using RustyHook is with compatibility mode, which allows RustyHook to use your existing `.pre-commit-config.yaml` file without any changes:
79
83
80
84
```sh
81
85
rh compat
82
86
```
83
87
84
-
To migrate to native format:
88
+
This command will read your `.pre-commit-config.yaml` file, set up the necessary environments, and run the hooks as defined in your pre-commit configuration.
89
+
90
+
### Converting Your Configuration
91
+
92
+
While compatibility mode works well, you'll get the best performance and features by converting to RustyHook's native configuration format:
This will create a new `.rustyhook/config.yaml` file based on your existing pre-commit configuration.
100
+
101
+
### Migrating Git Hooks
102
+
103
+
If you've installed pre-commit as a Git hook, you'll need to uninstall it and install RustyHook instead:
104
+
105
+
```sh
106
+
# Uninstall pre-commit hooks
107
+
pre-commit uninstall
108
+
109
+
# Install RustyHook hooks
110
+
rh install
111
+
```
112
+
113
+
### Key Differences
114
+
115
+
1. **Repository References**: RustyHook doesn't use the `repos` structure. Instead, it directly defines hooks with their language and version.
116
+
2. **Version Specification**: RustyHook uses package version specifiers (`version`) instead of Git revisions (`rev`).
117
+
3. **Dependencies**: RustyHook uses `dependencies` instead of `additional_dependencies`.
118
+
4. **Entry Point**: RustyHook requires an explicit `entry` field, while pre-commit infers it from the hook ID.
119
+
5. **Local Hooks**: RustyHook treats all hooks as "local" by default. There's no need for a special `local` repository designation.
120
+
121
+
For more detailed information about migrating from pre-commit to RustyHook, see the [Migration Guide](https://your-org.github.io/rustyhook/user-guide/migration.html).
0 commit comments