Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Extern config #8

wants to merge 11 commits into


None yet
1 participant

tvaughan77 commented Jul 29, 2012

This branch contains the integration with com.typesafe.config to externalize the on/off switches of the different checks we might want to run and to introduce a "Severity" level of the check failure messages.

I ran in to a bit of a wall when actually implementing the whitelist because when the compiler plugin's traverse() method gets handed an "import java.util._" statement (for example), the "pkg" paremeter passed to the Import(pkg, selectors) case statement is actually just the Tree "util", so we gotta figure out how to walk up that Tree and get the complete "java.util" statement so that we can check for its string existing in our List of configured whitelists.

tom.vaughan added some commits Jul 28, 2012

Using com.typesafe.config for externalizing some of the configuration…
… of Linter.

As of this check-in, the check for any wildcard imports now benefits from an on/off
switch along with placeholders for whitelist and blacklist respect.  Also adding
support for the concept of "severity" of the Lint failures (just "warn" or "error" right now)

Still to do:
* implement the whitelist & blacklist package regex checking
* convert the existing unit.warn(...) calls to use the annotateUnit( ) function
* decrease the nastiness of my Java-verbose val names for the config properties
Checking in a commented-out version of my attempt to respect the whit…
…elist list.

The problem I ran in to is that the "case Import(pkg, selectors)" has the pkg of type Tree, which when queried for the pkg.symbol only returns "util" (when you're importing java.util._ for example).  We need to figure out how to grab the ancestors (?) of the pkg to get the entire "java.util" package so that we can match on specific whitelist exclusions.

@tvaughan77 tvaughan77 closed this Jan 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment