commit | 130473d3b96e23beb6ac42e2b5958efdcdb6d48d | [log] [tgz] |
---|---|---|
author | Oliver Newman <olivernewman@google.com> | Mon Sep 11 18:39:32 2023 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Sep 11 18:39:32 2023 +0000 |
tree | 7510d0ceb2e573b26c422f1c21425320004d24aa | |
parent | 0d570d7c4e8adca7cea1faa4e7858fa07b38adc6 [diff] |
[engine] Resolve root directory using git Instead of assuming the current working directory (overridden by `--root`) contains a shac.star file, locate the root of the current git repository (if the current directory is in a git repository) and use the shac.star file there, also analyzing all files in the git directory instead of just files in the current working directory. The `--root` flag is replaced by `-C` since it's not necessarily any sort of root, instead being more analogous to the `-C` flag to git. We have to keep around the `--root` flag for backwards compatibility until references in other repos can be updated. TODO: update the <files> positional argument to accept directories, to make it possible to analyze just a single subdirectory (e.g. `shac check subdir`). Change-Id: Ic9aef678e2cb518a81ff2f36f3bec6fda969675d Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/914336 Commit-Queue: Oliver Newman <olivernewman@google.com> Reviewed-by: Marc-Antoine Ruel <maruel@google.com>
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.
go install go.fuchsia.dev/shac-project/shac@latest shac check shac doc shac.star | less
Planned features/changes, in descending order by priority:
shac.textproto
shac.star
files.shac
cache directory that checks can write toctx.scm
glob
arguments to ctx.scm.{all,affected}_files()
functions for easier filtering⚠ 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.