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
3.Requirement C: Make sure [unity-meta](https://internaldocs.hq.unity3d.com/unity-meta/setup/) is installed and its requirements are fulfilled. It will be used by the format code hook to ensure your code complies with the convention. _Sidenote: it is the same tool used to format C++/trunk code._
18
-
4.Requirement D: Make sure you have access to the cds.github.com repositories. Usually this means following [these steps](https://docs.github.com/en/enterprise-server@2.21/github/authenticating-to-github/connecting-to-github-with-ssh) to create and upload an ssh key to [cds.github.com](https://github.cds.internal.unity3d.com/settings/keys).
28
+
1. Install [Python >= 3.6](https://www.python.org/downloads/) and make sure it is accessible in your PATH.
3. Make sure [unity-meta](https://internaldocs.hq.unity3d.com/unity-meta/setup/) is installed and its requirements are fulfilled. It will be used by the format code hook to ensure your code complies with the convention. _Sidenote: it is the same tool used to format C++/trunk code._
31
+
4. Make sure you have access to the cds.github.com repositories. Usually this means following [these steps](https://docs.github.com/en/enterprise-server@2.21/github/authenticating-to-github/connecting-to-github-with-ssh) to create and upload an ssh key to [cds.github.com](https://github.cds.internal.unity3d.com/settings/keys).
19
32
5. From the root of the repository, run `cd Tools` and `python3 ./hooks_setup.py`.
20
33
21
-
Note: If you already installed the git hooks (before November 2020), you need to follow the steps above to re-install them. This is required in order to move towards a more scalable and flexible system. _Sidenote: NodeJS and the node_modules folder are no longer required._
22
-
23
34
### Available hooks
24
35
25
-
A description of the hooks we currently have is available in the [hooks' library repository](https://github.cds.internal.unity3d.com/theo-penavaire/gfx-automation-tools#available-git-hooks).
36
+
A description of the hooks we currently have is available in the [hooks library repository](https://github.cds.internal.unity3d.com/theo-penavaire/gfx-automation-tools#available-git-hooks).
26
37
27
38
For this repository we have enabled:
28
39
@@ -75,7 +86,7 @@ Last resort: [Troubleshooting SSH section in Github docs](https://docs.github.co
75
86
76
87
**Python or pre-commit not found, even if python is installed, "/usr/bin/env: ‘python’: Permission denied"**
77
88
78
-
Make sure Python (>=3.5) is in your PATH. Commands that can help:
89
+
Make sure Python (>=3.6) is in your PATH. Commands that can help:
79
90
- On windows: `where python3`
80
91
- On Unix: `which python3`
81
92
-[How to add to the path on Windows10?](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/)
@@ -101,3 +112,15 @@ Follow the suggestions of [this StackOverflow answer](https://stackoverflow.com/
101
112
**Can't locate Win32/Process.pm in @INC...**
102
113
103
114
On Windows, Active perl is not supported by the formatting tool. Use Strawberry perl.
115
+
116
+
## Formatting
117
+
118
+
Provided you installed [unity-meta](https://internaldocs.hq.unity3d.com/unity-meta/setup/), you can manually run the formatting tool with the following command (use powershell on windows):
119
+
```
120
+
perl ~/unity-meta/Tools/Format/format.pl --hgroot $(pwd) --dry-run <folder to format>
121
+
```
122
+
To actually apply the changes:
123
+
```
124
+
perl ~/unity-meta/Tools/Format/format.pl --hgroot $(pwd) --nobackups <folder to format>
125
+
```
126
+
Use `--help` to discover more useful options (`--preview` will generate a diff file for instance)
0 commit comments