[engine] fix a race condition and optimize more

The race condition was before file.path was hacked in. The regression
was added in c7b072f2103221501544b47bd245488e402d8569. Remove the hack and
make the implementations immutable.

Cache intermediary values for ctx.scm.affected_files() and ctx.scm.all_files().

Reuse new_lines() content across subdir. This removes all duplicate
calls to new_lines().

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

shac

Shac (Scalable Hermetic Analysis and Checks) is a unified and ergonomic tool and framework for writing and running static analysis checks.

Shac checks are written in Starlark.

usage demonstration

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.