Repository navigation
Embed the nilaway analyzer - #38
Merged
Merged
Conversation
The driver registered the flags of an analyzer against the global command line. A test cannot observe that registration without starting the process, because the global flag set holds every flag of the test binary. Pass the flag set in. Extraction of a function is the refactoring; the caller still passes flag.CommandLine, so no flag changes. Change-Id: I7e9778bdd0fbef324e8f535a2b58f44c94eb0ff6
An embedded analyzer can keep its configuration on a required analyzer. NilAway reads -include-pkgs from its config analyzer, which is a requirement of the analyzer that reports the diagnostics. Only the roots of the analyzer graph reached the command line, so that configuration had no flag at all. Walk the requirement graph and register the flags of every analyzer in it. Only a root gets an enable flag: a required analyzer runs because a root needs it, so it has nothing to disable. The help for an analyzer now lists the flags of its requirements, which is where a user looks when -flags shows an unfamiliar prefix. Change-Id: Id050af76326966266b5fa7dfb6cb4dcbb4e65d23
NilAway is the analyzer that constable needs the driver change for: its configuration lives on a required analyzer, so -include-pkgs and -pretty-print had no flag before. NilAway pretty-prints a multi-line explanation by default, with color when the terminal supports it. constable writes one diagnostic per line, so the adapter clears that default. A flag still turns it on. NilAway reads every dependency, including the standard library, unless it is told which packages to analyze. That costs seconds and gigabytes, and it reports flows that the analyzed repository cannot fix. The hook passes -nilaway_config.include-pkgs, and the README explains the flag. Change-Id: Id260935d2b7022737291a144cf55c23d7ff468a7
The adapter tests prove that each analyzer reports and that the wrapper drops a generated file. They do not prove that the binary runs the analyzer, because analysistest never reaches cmd/constable. Run the built binary. One test reads the flag list, which shows that a flag of a required analyzer reaches the command line. One test makes NilAway silent through -nilaway_config.include-pkgs and then non-silent without it, which shows that the analyzer reads the value. One test keeps a violation of each embedded analyzer in a generated file and expects no output. Change-Id: I2d7c3e851de3e8fb2141cd6afa903aa05239c153
A reader needs to know that constable now runs four analyzers that it does not own, that each keeps its upstream flag prefix, and that a prefix can name a required analyzer instead of the one that reports. The nilaway section carries the flag that the hook passes, so a reader who runs constable by hand gets the same cost and the same set of packages that the hook analyzes. Change-Id: I094b462e21f88a860d23a5998c3f25670a0ea2e4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.