@@ -22,13 +22,17 @@ object TastyInspector:
2222 /** Load and process TASTy files using TASTy reflect
2323 *
2424 * @param tastyFiles List of paths of `.tasty` files
25+ *
26+ * @return boolean value indicating whether the process succeeded
2527 */
2628 def inspectTastyFiles (tastyFiles : List [String ])(inspector : Inspector ): Boolean =
2729 inspectAllTastyFiles(tastyFiles, Nil , Nil )(inspector)
2830
2931 /** Load and process TASTy files in a `jar` file using TASTy reflect
3032 *
3133 * @param jars Path of `.jar` file
34+ *
35+ * @return boolean value indicating whether the process succeeded
3236 */
3337 def inspectTastyFilesInJar (jar : String )(inspector : Inspector ): Boolean =
3438 inspectAllTastyFiles(Nil , List (jar), Nil )(inspector)
@@ -38,6 +42,8 @@ object TastyInspector:
3842 * @param tastyFiles List of paths of `.tasty` files
3943 * @param jars List of path of `.jar` files
4044 * @param dependenciesClasspath Classpath with extra dependencies needed to load class in the `.tasty` files
45+ *
46+ * @return boolean value indicating whether the process succeeded
4147 */
4248 def inspectAllTastyFiles (tastyFiles : List [String ], jars : List [String ], dependenciesClasspath : List [String ])(inspector : Inspector ): Boolean =
4349 def checkFile (fileName : String , ext : String ): Unit =
@@ -49,7 +55,7 @@ object TastyInspector:
4955 tastyFiles.foreach(checkFile(_, " tasty" ))
5056 jars.foreach(checkFile(_, " jar" ))
5157 val files = tastyFiles ::: jars
52- files.nonEmpty && inspectFiles(dependenciesClasspath, files)(inspector)
58+ inspectFiles(dependenciesClasspath, files)(inspector)
5359
5460 private def inspectorDriver (inspector : Inspector ) =
5561 class InspectorDriver extends Driver :
@@ -100,11 +106,11 @@ object TastyInspector:
100106
101107
102108 private def inspectFiles (classpath : List [String ], classes : List [String ])(inspector : Inspector ): Boolean =
103- if ( classes.isEmpty)
104- throw new IllegalArgumentException ( " Parameter classes should no be empty " )
105-
106- val reporter = inspectorDriver(inspector).process(inspectorArgs(classpath, classes))
107- reporter.hasErrors
109+ classes match
110+ case Nil => true
111+ case _ =>
112+ val reporter = inspectorDriver(inspector).process(inspectorArgs(classpath, classes))
113+ ! reporter.hasErrors
108114
109115 end inspectFiles
110116
0 commit comments