Skip to content

Commit d80ff58

Browse files
authored
readme: reorder dev secion
1 parent 9a3809a commit d80ff58

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,14 @@ If your project is using this library feel free to submit a PR or send a message
219219

220220
## Development
221221

222-
### Git Hooks
223-
224-
To install some (optional, but quite handy) `pre-commit` and `pre-push` hooks, you can run the following script.
222+
### Debugging
225223

226-
scripts/git-hooks/link-git-hooks.sh
224+
You can use the build tag `debugdemoinfocs` (i.e. `go test -tags debugdemoinfocs -v`) to print out debugging information - such as game events or unhandled demo-messages - during the parsing process.<br>
225+
Side-note: The tag isn't called `debug` to avoid naming conflicts with other libs (and underscores in tags don't work, apparently).
227226

228-
#### `pre-commit`:
229-
- check if [interfaces have been updated](#generating-interfaces)
230-
- build the code
231-
- run unit tests
227+
To change the default debugging behavior, Go's `ldflags` parameter can be used. Example for additionally printing out all server-classes with their properties: `-ldflags '-X github.com/markus-wa/demoinfocs-golang.debugServerClasses=YES'`
232228

233-
#### `pre-push`:
234-
- run regression tests
229+
Check out `debug_on.go` for any other settings that can be changed.
235230

236231
### Testing
237232

@@ -269,15 +264,6 @@ To update it you can run the following command:
269264

270265
Please don't update the `.golden` file if you are not sure it's required. Maybe the failing CI is just pointing out a regression.
271266

272-
### Debugging
273-
274-
You can use the build tag `debugdemoinfocs` (i.e. `go test -tags debugdemoinfocs -v`) to print out debugging information - such as game events or unhandled demo-messages - during the parsing process.<br>
275-
Side-note: The tag isn't called `debug` to avoid naming conflicts with other libs (and underscores in tags don't work, apparently).
276-
277-
To change the default debugging behavior, Go's `ldflags` parameter can be used. Example for additionally printing out all server-classes with their properties: `-ldflags '-X github.com/markus-wa/demoinfocs-golang.debugServerClasses=YES'`
278-
279-
Check out `debug_on.go` for any other settings that can be changed.
280-
281267
### Generating Interfaces
282268

283269
We generate interfaces such as `GameState` from structs to make it easier to keep docs in synch over structs and interfaces.
@@ -303,6 +289,20 @@ Make sure both are inside your `PATH` variable.
303289

304290
After installing these use `go generate ./msg` to generate the protobuf code. If you're on Windows you'll need to run go generate from CMD, not Bash.
305291

292+
### Git Hooks
293+
294+
To install some (optional, but quite handy) `pre-commit` and `pre-push` hooks, you can run the following script.
295+
296+
scripts/git-hooks/link-git-hooks.sh
297+
298+
#### `pre-commit`:
299+
- check if [interfaces have been updated](#generating-interfaces)
300+
- build the code
301+
- run unit tests
302+
303+
#### `pre-push`:
304+
- run regression tests
305+
306306
## Acknowledgements
307307

308308
Thanks to [@JetBrains](https://github.com/JetBrains) for sponsoring a license of their awesome [GoLand](https://www.jetbrains.com/go/) IDE for this project - go check it out!

0 commit comments

Comments
 (0)