* doc: add rules documentation
* version: add accessor for capa major version and git checkout command
* doc: rules: document version output
* doc: rules: show example error due to mismatched rule version
* doc: rules: update links
* ci: tag major rule version test
* ci: tag major rule version
* doc: update changelog
* ci: force to replace tag if exists
* ci: simplify tagging step
* Update doc/rules.md
* feat: disable tag, show error branch cmd
* doc: update major version rules branch
* Apply suggestions from code review
Co-authored-by: Willi Ballenthin <willi.ballenthin@gmail.com>
* Update capa/main.py
* black
Co-authored-by: Moritz Raabe <moritz.raabe@mandiant.com>
Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
Avoid erroneous commits. The pre-commit can be skipped with the
`--no-verify` option, which is not available with the post-commit.
Note that `pre-commit` doesn't run when rebase while post-commit did.
This allows to have a single script which is run by both hooks. This
scripts can also be used independently to run the CI setup locally.
Move the cloning all submodule option to the beginning as when using
capa in development this is the most common option. Test files are
needed to run the tests locally. Simplify the rest of the submodules
documentation, as it is easier for people to look the submodule
documentation than for us to maintain a copy. The submodule init step
shouldn't be needed to clone the rules directory.
Add the `scripts/setup-hooks.sh` script which sets the following hooks
up:
- The `post-commit` hook runs the linter after every `git commit`,
letting you know if there are code style or rule linter offenses you
need to fix.
- The `pre-push` hook runs the linter and the tests and block the `git
push` if they do not succeed.
This way you realise if everything is alright without the need of
sending a PR.