Summary:
The idea was that the short description is used for mechanical summaries of the hook failures, and the long description is used for human-readable "how to handle this" forms.
Instead, we had a mixture of styles, plus only ever returning the short description. Change this to only ever return the long description and fix hooks so that the long description is meaningful
Reviewed By: StanislavGlebik
Differential Revision: D15537580
fbshipit-source-id: 6289c1c9786862db8190b4464a3133c0620eb09c
Summary:
This diff includes a bit of cleanup in hooks code, like:
- removing not used `repo_name` from `ctx.info`
- moving lua code from within `.rs` files to it's own `.lua` files
- addressing linter comments on lua code and
- reducing some copy-pasta between Changeset and File hook types
Reviewed By: StanislavGlebik
Differential Revision: D13895963
fbshipit-source-id: c867e060ad40e81fe0c81f30d14df59e75e129e6
Summary:
Add a helper function for hooks that can be used to match a string to a regex.
Regex matching can either be called from ctx.regex_match(s, r) or file.path_regex_match(r)
This will later be used in the no_bad_filenames hook, but will be helpful for other
hooks too.
Reviewed By: purplefox
Differential Revision: D12941544
fbshipit-source-id: f8f73a767da5ae77f486c925b6adc1333a198c3f
Summary:
Quite a big hook that checks whether a commit is reviewed.
What makes it big are exceptions. They should all be covered with tests
Reviewed By: farnz
Differential Revision: D10467787
fbshipit-source-id: b9f439d540b64a5df8c8f131b3e7ba2924af4c29
Summary:
In our hooks we may need to get access to test plan, list of reviewers, summary etc.
Lua doesn't have regex, only patterns. So parsing this information in Lua is a bit tricky.
What's even worse is the fact that we can't add any unittests, so debugging and
fixing is harder. Instead let's add a rust function that would do it for us
Reviewed By: farnz
Differential Revision: D10461203
fbshipit-source-id: 328b76171d2c45ceaf5b2a1f5e1d0bd4c326c223
Summary:
This is based on my reading of the source code, so I may have gotten things
wrong. Feel free to editorialize!
By putting this in a doc, hopefully it makes it easier for us to reason about
the API at a high level. Obviously it would be great if we could keep this up
to date going forward.
Reviewed By: StanislavGlebik
Differential Revision: D10340604
fbshipit-source-id: 9f3e82d234842e06c52f8a8b4440f8e06c487c0b