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
1. Branch off of `main` (name it after the event).
29
-
2. With a pre-made virtual environment activated, run `python3 -m pip install pre-commit`.
35
+
2. Run `tree .git/hooks` and discuss output.
36
+
3. Run `less .git/hooks/pre-commit.sample` and discuss output.
37
+
4. Create a version of the file that will get run: `cp .git/hooks/pre-commit.sample .git/hooks/pre-commit`.
38
+
5. Edit the `.git/hooks/pre-commit` file to have `exit 1` near the top (automatic failure).
39
+
6. Attempt to commit the slides PDF to this branch. Discuss why it failed.
40
+
7. Run `rm .git/hooks/pre-commit` to get rid of the automatic failure hook.
41
+
8. Attempt the commit again. Discuss why it succeeds.
42
+
9. Push the changes up so the PDF version of the slides is available for everyone.
43
+
44
+
### Pre-commit package installation
45
+
46
+
1. With a pre-made virtual environment activated, run `python3 -m pip install pre-commit`.
47
+
2. Run `pre-commit --version` to show it worked.
30
48
31
49
### Install first set of hooks
32
50
33
-
1. Create `.pre-commit-config.yaml` file copying the contents from the slides.
34
-
2. Run `pre-commit install`.
35
-
3. Commit the `.pre-commit-config.yaml` file.
51
+
1. Show that `pre-commit sample-config` can be used to see what an example looks like, but mention that the version is outdated, and the contents are different than what we will use.
52
+
2. Create `.pre-commit-config.yaml` file copying the contents from the slides.
53
+
3. Run `pre-commit install`.
54
+
4. Run `less .git/hooks/pre-commit` and show that the contents are now coming from `pre-commit` and referencing the `.pre-commit-config.yaml` file.
0 commit comments