public abstract class FixBuckConfig extends Object implements ConfigView<BuckConfig>
Constructor and Description |
---|
FixBuckConfig() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getAutofixCommands()
List of commands that autofix is enabled for
|
com.facebook.buck.support.fix.FixBuckConfig.AutofixEnabled |
getAutofixEnabled()
When running `buck fix` automatically on command failure is enabled
|
com.google.common.collect.ImmutableMap<String,com.google.common.collect.ImmutableList<String>> |
getBuckProvidedScripts()
Get a mapping of short names to Paths for buck provided fix scripts
|
abstract BuckConfig |
getDelegate() |
Optional<com.google.common.collect.ImmutableList<String>> |
getFixScript()
Get the script to run when buck fix is invoked
|
Optional<String> |
getFixScriptContact()
Get the contact to use to tell users who to contact when `buck fix` fails
|
String |
getFixScriptMessage()
Get the message to show when invoking `buck fix`
|
com.google.common.collect.ImmutableList<String> |
getInterpolatedFixScript(com.google.common.collect.ImmutableList<String> fixScript,
Path repositoryRoot,
Path fixSpecPath)
Gets the full script to invoke in `buck fix`.
|
String |
getInterpolatedFixScriptMessage(com.google.common.collect.ImmutableList<String> interpolatedFixScript,
String fixScriptContact)
Gets the message to print to users when `buck fix` is invoked and performs some substitutions
|
Optional<com.google.common.collect.ImmutableList<String>> |
getLegacyFixScript()
Get the previous script that JASABI fixes
|
static FixBuckConfig |
of(BuckConfig delegate) |
boolean |
shouldPrintFixScriptMessage()
Determine whether to show a custom message when `buck fix` is invoked
|
boolean |
shouldRunAutofix(boolean isInteractive,
String subcommand)
Whether or not to run `buck fix` automatically
|
boolean |
shouldUseLegacyFixScript()
Determine whether to use the legacy script, or the new fix script system
|
public abstract BuckConfig getDelegate()
getDelegate
in interface ConfigView<BuckConfig>
public static FixBuckConfig of(BuckConfig delegate)
@Value.Lazy public Optional<com.google.common.collect.ImmutableList<String>> getFixScript()
@Value.Lazy public Optional<com.google.common.collect.ImmutableList<String>> getLegacyFixScript()
@Value.Lazy public Optional<String> getFixScriptContact()
@Value.Lazy public String getFixScriptMessage()
public com.facebook.buck.support.fix.FixBuckConfig.AutofixEnabled getAutofixEnabled()
public List<String> getAutofixCommands()
public boolean shouldRunAutofix(boolean isInteractive, String subcommand)
@Value.Lazy public boolean shouldPrintFixScriptMessage()
@Value.Lazy public boolean shouldUseLegacyFixScript()
public com.google.common.collect.ImmutableList<String> getInterpolatedFixScript(com.google.common.collect.ImmutableList<String> fixScript, Path repositoryRoot, Path fixSpecPath)
`{fix_spec_path}` is replaced with the path to the json file that contains details about the last run. `{repository_root}` is replaced with the absolute path to the repository root.
fixScript
- The script to run (generally from the config file) that has not been
interpolatedrepositoryRoot
- The path to use for `{repository_root}`fixSpecPath
- The path to use for `{fix_spec_path}`public String getInterpolatedFixScriptMessage(com.google.common.collect.ImmutableList<String> interpolatedFixScript, String fixScriptContact)
`{command}` is replaced with interpolatedFixScript
`{contact}` is replaced with
fixScriptContact
interpolatedFixScript
- The fix script per getInterpolatedFixScript(ImmutableList, Path, Path)
fixScriptContact
- The contact to use in the message