snowplow / igluctl

A command-line tool for working with Iglu schema registries
8 stars 6 forks source link

igluctl lint 0.11 breaks --skip-checks for more than one linter #157

Open drphrozen opened 1 year ago

drphrozen commented 1 year ago

igluctl version 0.11 seems to break --skip-checks when using more than one linter:

> igluctl lint schemas --skip-checks rootObject,description,stringLength,numericMinMax,optionalNull
java.lang.IllegalArgumentException: Cannot create NonEmptyList from empty list
    at cats.data.NonEmptyList$.fromListUnsafe(NonEmptyList.scala:753)
    at com.snowplowanalytics.iglu.ctl.commands.Lint$.$anonfun$check$2(Lint.scala:100)
    at scala.Option.map(Option.scala:242)
    at com.snowplowanalytics.iglu.ctl.commands.Lint$.check(Lint.scala:97)
    at com.snowplowanalytics.iglu.ctl.commands.Lint$.$anonfun$process$4(Lint.scala:53)
    at scala.collection.immutable.List.map(List.scala:250)
    at cats.data.NonEmptyList.map(NonEmptyList.scala:109)
    at com.snowplowanalytics.iglu.ctl.commands.Lint$.$anonfun$process$2(Lint.scala:53)
    at cats.data.Ior.$anonfun$bimap$2(Ior.scala:595)
    at cats.data.Ior.fold(Ior.scala:74)
    at cats.data.Ior.bimap(Ior.scala:595)
    at cats.data.Ior.map(Ior.scala:613)
    at com.snowplowanalytics.iglu.ctl.commands.Lint$.$anonfun$process$1(Lint.scala:53)
    at map @ fs2.internal.CompileScope.$anonfun$close$9(CompileScope.scala:246)
    at flatMap @ fs2.internal.CompileScope.$anonfun$close$6(CompileScope.scala:245)
    at map @ fs2.internal.CompileScope.fs2$internal$CompileScope$$traverseError(CompileScope.scala:222)
    at flatMap @ fs2.internal.CompileScope.$anonfun$close$4(CompileScope.scala:244)
    at map @ fs2.internal.CompileScope.fs2$internal$CompileScope$$traverseError(CompileScope.scala:222)
    at flatMap @ fs2.internal.CompileScope.$anonfun$close$2(CompileScope.scala:242)
    at modify @ fs2.internal.CompileScope.$anonfun$open$2(CompileScope.scala:142)
    at flatMap @ fs2.internal.CompileScope.close(CompileScope.scala:241)
    at main$ @ com.snowplowanalytics.iglu.ctl.Main$.main(Main.scala:26)
    at flatMap @ fs2.internal.FreeC$.interruptGuard$1(Algebra.scala:[43](https://gitlab.legogroup.io/tag-team/compliant-tracking/iglu-schemas/-/jobs/5448878#L43)6)
    at get @ fs2.internal.CompileScope.$anonfun$openAncestor$2(CompileScope.scala:261)
    at flatMap @ fs2.internal.CompileScope.$anonfun$openAncestor$2(CompileScope.scala:261)
    at flatMap @ fs2.internal.FreeC$.$anonfun$compile$17(Algebra.scala:5[45](https://gitlab.legogroup.io/tag-team/compliant-tracking/iglu-schemas/-/jobs/5448878#L45))

It works fine when using one linter:

igluctl lint schemas --skip-checks rootObject
drphrozen commented 1 year ago

@pondzix @voropaevp this update broke our ci, is it going to be fixed any time soon?