[engine] Add `shac.check()` to create check objects

`shac.register_check()` now takes either a check object or a function as
its first argument. We're willing to diverge from the "one way to do
things" policy in this case because it's annoying to add the boilerplate
necessary to create a check object for registering just a simple check
function.

Unlike functions, check objects can have metadata (e.g. name) attached,
which makes it easier to declare such metadata in shared libraries and
use it in dependent repositories.

Change-Id: I9a1a766b132b6a715be402a5360fb2d51bf05b16
Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/855976
Commit-Queue: Oliver Newman <olivernewman@google.com>
Reviewed-by: Marc-Antoine Ruel <maruel@google.com>
12 files changed
tree: 9362c4554c4b1185fc7d2277a2ac714b40ab8fd7
  1. .github/
  2. doc/
  3. internal/
  4. scripts/
  5. .gitignore
  6. AUTHORS
  7. check_doc.star
  8. codecov.yml
  9. CONTRIBUTING.md
  10. go.mod
  11. go.star
  12. go.sum
  13. LICENSE
  14. licenses.star
  15. main.go
  16. OWNERS
  17. PATENTS
  18. README.md
  19. shac.star
  20. shac.textproto
README.md

shac

Scalable Hermetic Analysis and Checks.

Usage

go install go.fuchsia.dev/shac-project/shac@latest
shac check
shac doc shac.star | less

Documentation

Contributing

⚠ The source of truth is at https://fuchsia.googlesource.com/shac-project/shac.git and uses Gerrit for code review.

See CONTRIBUTING.md to submit changes.