Skip to content

Commit

Permalink
Add missing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mlachkar committed Aug 4, 2020
1 parent 412e463 commit f0e3ce9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ final case class ScalafixArgumentsImpl(args: Args = Args.default)

override def run(): Array[ScalafixError] = {
val exit = MainOps.run(Array(), args)
println(s"exit $exit")
ScalafixErrorImpl.fromScala(exit)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ final case class ScalafixResultImpl(
override def writeResult(): Array[ScalafixError] = {
scalafixOutputs.flatMap(o => o.applyPatches()).toArray
}

override def writeResult(path: Path): Array[ScalafixError] = {
scalafixOutputs.flatMap(o => o.applyPatches()).toArray
}

}

object ScalafixResultImpl {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,33 @@ public interface ScalafixOutput {
*/
Optional<String> getUnifiedDiff();


/**
*
* @return the output file after running scalafix if no error
*/
Optional<String> getOutputFileFixed();


/**
*
* @return scalafixPatches
*/
ScalafixPatch[] getPatches();

/**
*
* @return apply all patches and write the result to file.
*/
ScalafixError[] applyPatches();

/**
*
* @return Optional<String> containes the new file if no error.
*/
Optional<String> getOutputFixedWithSelectivePatches(ScalafixPatch[] patches);

/**
*
* @return apply selected patches to file
*/
ScalafixError[] applySelectivePatches(ScalafixPatch[] patches);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package scalafix.interfaces;

public interface ScalafixPatch {

/**
* Can be RemoveGlobalImport, RemoveImportee, AddGlobalImport, AddGlobalSymbol, ReplaceSymbol
* @return
*/
String kind();

/**
*
* @return Java UUID
*/
String getId();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ public interface ScalafixResult {
Optional<String> getMessageError();

/**
* G
*
* @return ScalafixOutput[] for each file we store diagnostics and patches
* */
ScalafixOutput[] getScalafixOutputs();


/**
*
* @return if no error, write result to file configured in {@link ScalafixArguments()}
*/
ScalafixError[] writeResult();

ScalafixError[] writeResult(Path path);
}

0 comments on commit f0e3ce9

Please sign in to comment.