commit | bdb35b1214bade0bd5ec0bfa4deaa9856472212b | [log] [tgz] |
---|---|---|
author | Oliver Newman <olivernewman@google.com> | Thu Sep 14 16:35:02 2023 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Sep 14 16:35:02 2023 +0000 |
tree | 77e44a6c62eec79b9ea6f337ce45c8df49552dc2 | |
parent | 05e1298cadc202649644567585c0c31635b85a54 [diff] |
[scm] Don't try to parse invalid ls-files output If an error occurred on the `ls-files` command or a previous git command, `g.err` will be set and will cause subsequent `g.run()` calls to short-circuit and return an empty string. Trying to parse an empty string using the ls-files parsing logic causes panics, so we must skip it if an error occurred. This was causing confusing panics when a check failed before `git ls-files` was called for the first time. Change-Id: Ice428fc83ecd9e7566e74c3ff85e03635676ff19 Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/916074 Reviewed-by: Anthony Fandrianto <atyfto@google.com> Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com> Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.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.