From fbf61c7149bb30a0ca4a7345f76cec572b31fae8 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 19 Aug 2021 09:34:51 +0200 Subject: [PATCH] Reformat with scalafmt 3.0.0 --- build.sbt | 80 ++++++++-------- .../gemini/epics/acm/ObserveStateSpec.scala | 26 +++--- .../main/scala/seqexec/engine/Engine.scala | 29 +++--- .../src/main/scala/seqexec/engine/Event.scala | 2 +- .../main/scala/seqexec/engine/Execution.scala | 7 +- .../main/scala/seqexec/engine/Handle.scala | 11 +-- .../main/scala/seqexec/engine/Sequence.scala | 67 ++++++------- .../src/main/scala/seqexec/engine/Step.scala | 20 ++-- .../main/scala/seqexec/engine/package.scala | 8 +- .../scala/seqexec/engine/packageSpec.scala | 5 +- .../scala/giapi/client/GiapiStatusDb.scala | 6 +- .../scala/giapi/client/commands/package.scala | 15 ++- .../src/main/scala/giapi/client/package.scala | 28 +++--- .../scala/giapi/client/GiapiCommandSpec.scala | 4 +- .../model/config/AuthenticationConfig.scala | 18 ++-- .../model/config/SeqexecConfiguration.scala | 18 ++-- .../config/SeqexecEngineConfiguration.scala | 48 ++++++---- .../model/config/SmartGcalConfiguration.scala | 6 +- .../model/config/WebServerConfiguration.scala | 24 +++-- .../seqexec/common/FixedLengthBuffer.scala | 7 +- .../scala/seqexec/model/NSSubexposure.scala | 6 +- .../main/scala/seqexec/model/ProgramId.scala | 26 +++--- .../seqexec/model/ProgramIdParsers.scala | 6 +- .../scala/seqexec/model/SequencesQueue.scala | 4 +- .../model/boopickle/ModelBooPicklers.scala | 5 +- .../seqexec/model/boopickle/package.scala | 6 +- .../scala/seqexec/model/enumerations.scala | 5 +- .../src/main/scala/seqexec/model/events.scala | 3 +- .../main/scala/gem/ocs2/model/Dataset.scala | 16 ++-- .../main/scala/gem/ocs2/pio/PioParse.scala | 7 +- .../main/scala/ocs2/config/GmosConfig.scala | 62 ++++++------- .../scala/seqexec/server/ConfigUtilOps.scala | 10 +- .../main/scala/seqexec/server/EpicsUtil.scala | 43 +++++---- .../seqexec/server/InstrumentActions.scala | 23 ++--- .../scala/seqexec/server/ObserveActions.scala | 13 ++- .../main/scala/seqexec/server/OdbProxy.scala | 2 +- .../scala/seqexec/server/SeqTranslate.scala | 2 +- .../scala/seqexec/server/SeqexecEngine.scala | 93 ++++++++++--------- .../scala/seqexec/server/SeqexecMetrics.scala | 2 +- .../server/SequenceConfiguration.scala | 5 +- .../main/scala/seqexec/server/StepsView.scala | 4 +- .../server/altair/AltairControllerEpics.scala | 5 +- .../scala/seqexec/server/gcal/GcalEpics.scala | 4 +- .../server/gmos/GmosControllerEpics.scala | 2 +- .../server/gmos/GmosInstrumentActions.scala | 2 +- .../seqexec/server/gpi/GpiStatusApply.scala | 6 +- .../scala/seqexec/server/gws/GwsEpics.scala | 4 +- .../server/keywords/DhsClientDisabled.scala | 2 +- .../server/keywords/DhsClientHttp.scala | 10 +- .../seqexec/server/keywords/package.scala | 3 +- .../server/niri/NiriControllerEpics.scala | 6 +- .../main/scala/seqexec/server/package.scala | 2 +- .../main/scala/seqexec/server/tcs/Gaos.scala | 2 +- .../server/tcs/TcsControllerEpicsCommon.scala | 9 +- .../scala/seqexec/server/tcs/TcsEpics.scala | 4 +- .../scala/seqexec/web/client/SeqexecApp.scala | 3 +- .../web/client/components/LoginBox.scala | 20 ++-- .../client/components/SessionQueueTable.scala | 18 ++-- .../components/queue/CalQueueTable.scala | 8 +- .../sequence/steps/StepConfigTable.scala | 2 +- .../sequence/steps/StepSettings.scala | 2 +- .../sequence/steps/StepsTable.scala | 29 +++--- .../components/tabs/CalibrationQueueTab.scala | 4 +- .../client/components/tabs/SequenceTab.scala | 4 +- .../client/handlers/InitialSyncHandler.scala | 5 +- .../ObservationsProgressStateHandler.scala | 2 +- .../client/handlers/TableStateHandler.scala | 6 +- .../web/client/model/ClientStatus.scala | 3 +- .../seqexec/web/client/model/ModelOps.scala | 8 +- .../seqexec/web/client/model/Pages.scala | 7 +- .../web/client/model/SequencesOnDisplay.scala | 3 +- .../client/services/SeqexecWebClient.scala | 2 +- .../scala/web/client/table/ColumnWidth.scala | 2 +- .../main/scala/web/client/table/package.scala | 4 +- .../web/server/common/LogInitialization.scala | 4 +- .../server/http4s/SeqexecCommandRoutes.scala | 8 +- .../server/logging/AppenderForClients.scala | 4 +- .../server/security/HttpAuthenticator.scala | 4 +- .../security/TestAuthenticationService.scala | 4 +- .../http4s/SeqexecCommandRoutesSpec.scala | 2 +- project/AppsCommon.scala | 49 +++++----- project/Common.scala | 29 +++--- project/Settings.scala | 8 +- project/plugins.sbt | 24 ++--- project/project/plugins.sbt | 2 +- 85 files changed, 581 insertions(+), 522 deletions(-) diff --git a/build.sbt b/build.sbt index f1f3a94793..d6dc9e89e1 100644 --- a/build.sbt +++ b/build.sbt @@ -149,8 +149,8 @@ lazy val seqexec_web_server = project buildInfoUsePackageAsPath := true, buildInfoKeys ++= Seq[BuildInfoKey](name, version, buildInfoBuildNumber), buildInfoOptions += BuildInfoOption.BuildTime, - buildInfoObject := "OcsBuildInfo", - buildInfoPackage := "seqexec.web.server" + buildInfoObject := "OcsBuildInfo", + buildInfoPackage := "seqexec.web.server" ) .dependsOn(seqexec_server) .dependsOn(seqexec_model.jvm % "compile->compile;test->test") @@ -176,26 +176,26 @@ lazy val seqexec_web_client = project // Configurations for webpack fastOptJS / webpackBundlingMode := BundlingMode.LibraryOnly(), fullOptJS / webpackBundlingMode := BundlingMode.Application, - webpackResources := (baseDirectory.value / "src" / "webpack") * "*.js", - webpackDevServerPort := 9090, - webpack / version := "4.44.1", + webpackResources := (baseDirectory.value / "src" / "webpack") * "*.js", + webpackDevServerPort := 9090, + webpack / version := "4.44.1", startWebpackDevServer / version := "3.11.0", // Use a different Webpack configuration file for production and create a single bundle without source maps - fullOptJS / webpackConfigFile := Some( + fullOptJS / webpackConfigFile := Some( baseDirectory.value / "src" / "webpack" / "prod.webpack.config.js" ), - fastOptJS / webpackConfigFile := Some( + fastOptJS / webpackConfigFile := Some( baseDirectory.value / "src" / "webpack" / "dev.webpack.config.js" ), - Test / webpackConfigFile := Some( + Test / webpackConfigFile := Some( baseDirectory.value / "src" / "webpack" / "test.webpack.config.js" ), - webpackEmitSourceMaps := false, - Test / parallelExecution := false, - installJsdom / version := "16.4.0", - Test / requireJsDomEnv := true, + webpackEmitSourceMaps := false, + Test / parallelExecution := false, + installJsdom / version := "16.4.0", + Test / requireJsDomEnv := true, // Use yarn as it is faster than npm - useYarn := true, + useYarn := true, // JS dependencies via npm Compile / npmDependencies ++= Seq( "fomantic-ui-less" -> LibraryVersions.fomanticUI, @@ -245,8 +245,8 @@ lazy val seqexec_web_client = project .settings( buildInfoUsePackageAsPath := true, buildInfoKeys ++= Seq[BuildInfoKey](name, version), - buildInfoObject := "OcsBuildInfo", - buildInfoPackage := "seqexec.web.client" + buildInfoObject := "OcsBuildInfo", + buildInfoPackage := "seqexec.web.client" ) .dependsOn(seqexec_model.js % "compile->compile;test->test") @@ -281,8 +281,8 @@ lazy val seqexec_server = project .settings( buildInfoUsePackageAsPath := true, buildInfoKeys ++= Seq[BuildInfoKey](name, version), - buildInfoObject := "OcsBuildInfo", - buildInfoPackage := "seqexec.server" + buildInfoObject := "OcsBuildInfo", + buildInfoPackage := "seqexec.server" ) .dependsOn(seqexec_engine % "compile->compile;test->test", giapi, @@ -373,20 +373,20 @@ lazy val acm = project */ lazy val seqexecCommonSettings = Seq( // Main class for launching - Compile / mainClass := Some("seqexec.web.server.http4s.WebServerLauncher"), + Compile / mainClass := Some("seqexec.web.server.http4s.WebServerLauncher"), // This is important to keep the file generation order correctly - Universal / parallelExecution := false, + Universal / parallelExecution := false, // Depend on webpack and add the assets created by webpack Compile / packageBin / mappings ++= (webpack in (seqexec_web_client, Compile, fullOptJS)).value .map(f => f.data -> f.data.getName()), // Name of the launch script - executableScriptName := "seqexec-server", + executableScriptName := "seqexec-server", // No javadocs mappings in (Compile, packageDoc) := Seq(), // Don't create launchers for Windows - makeBatScripts := Seq.empty, + makeBatScripts := Seq.empty, // Specify a different name for the config file - bashScriptConfigLocation := Some("${app_home}/../conf/launcher.args"), + bashScriptConfigLocation := Some("${app_home}/../conf/launcher.args"), bashScriptExtraDefines += """addJava "-Dlogback.configurationFile=${app_home}/../conf/logback.xml"""", bashScriptExtraDefines += """addJava "-javaagent:${app_home}/jmx_prometheus_javaagent-0.3.1.jar=6060:${app_home}/prometheus.yaml"""", // Copy logback.xml to let users customize it on site @@ -425,13 +425,13 @@ lazy val seqexecCommonSettings = Seq( */ lazy val seqexecLinux = Seq( // User/Group for execution - Linux / daemonUser := "software", - Linux / daemonGroup := "software", + Linux / daemonUser := "software", + Linux / daemonGroup := "software", Universal / maintainer := "Software Group ", // This lets us build RPMs from snapshot versions - Linux / name := "Seqexec Server", - Linux / version := { - (ThisBuild / version ).value.replace("-SNAPSHOT", "").replace("-", "_").replace(" ", "") + Linux / name := "Seqexec Server", + Linux / version := { + (ThisBuild / version).value.replace("-SNAPSHOT", "").replace("-", "_").replace(" ", "") } ) @@ -445,7 +445,7 @@ lazy val app_seqexec_server = preventPublication(project.in(file("app/seqexec-se .enablePlugins(GitBranchPrompt) .settings(seqexecCommonSettings: _*) .settings( - description := "Seqexec server for local testing", + description := "Seqexec server for local testing", // Put the jar files in the lib dir Universal / mappings += { val jar = (Compile / packageBin).value @@ -488,9 +488,9 @@ lazy val app_seqexec_server_gs_test = .settings(seqexecLinux: _*) .settings(deployedAppMappings: _*) .settings( - description := "Seqexec GS test deployment", - applicationConfName := "seqexec", - applicationConfSite := DeploymentSite.GS, + description := "Seqexec GS test deployment", + applicationConfName := "seqexec", + applicationConfSite := DeploymentSite.GS, Universal / mappings := { // filter out sjs jar files. otherwise it could generate some conflicts val universalMappings = (mappings in (app_seqexec_server, Universal)).value @@ -517,9 +517,9 @@ lazy val app_seqexec_server_gn_test = .settings(seqexecLinux: _*) .settings(deployedAppMappings: _*) .settings( - description := "Seqexec GN test deployment", - applicationConfName := "seqexec", - applicationConfSite := DeploymentSite.GN, + description := "Seqexec GN test deployment", + applicationConfName := "seqexec", + applicationConfSite := DeploymentSite.GN, Universal / mappings := { // filter out sjs jar files. otherwise it could generate some conflicts val universalMappings = (mappings in (app_seqexec_server, Universal)).value @@ -545,9 +545,9 @@ lazy val app_seqexec_server_gs = preventPublication(project.in(file("app/seqexec .settings(seqexecLinux: _*) .settings(deployedAppMappings: _*) .settings( - description := "Seqexec Gemini South server production", - applicationConfName := "seqexec", - applicationConfSite := DeploymentSite.GS, + description := "Seqexec Gemini South server production", + applicationConfName := "seqexec", + applicationConfSite := DeploymentSite.GS, Universal / mappings := { // filter out sjs jar files. otherwise it could generate some conflicts val universalMappings = (mappings in (app_seqexec_server, Universal)).value @@ -573,9 +573,9 @@ lazy val app_seqexec_server_gn = preventPublication(project.in(file("app/seqexec .settings(seqexecLinux: _*) .settings(deployedAppMappings: _*) .settings( - description := "Seqexec Gemini North server production", - applicationConfName := "seqexec", - applicationConfSite := DeploymentSite.GN, + description := "Seqexec Gemini North server production", + applicationConfName := "seqexec", + applicationConfSite := DeploymentSite.GN, Universal / mappings := { // filter out sjs jar files. otherwise it could generate some conflicts val universalMappings = (mappings in (app_seqexec_server, Universal)).value diff --git a/modules/acm/src/test/scala/edu/gemini/epics/acm/ObserveStateSpec.scala b/modules/acm/src/test/scala/edu/gemini/epics/acm/ObserveStateSpec.scala index a1b84ae6b3..74f9bf5d69 100644 --- a/modules/acm/src/test/scala/edu/gemini/epics/acm/ObserveStateSpec.scala +++ b/modules/acm/src/test/scala/edu/gemini/epics/acm/ObserveStateSpec.scala @@ -18,11 +18,9 @@ import org.scalatest.funsuite.AnyFunSuite /** * Tests of the observe state machine * - * We want to verify that the Apply state and Observe state FSM properly do - * state transitions as the EPICS channels change. - * To speed up the process the CAJContext is mocked as we don't really - * care about the state of the channels. Instead we want to only observe - * the state transitions + * We want to verify that the Apply state and Observe state FSM properly do state transitions as the + * EPICS channels change. To speed up the process the CAJContext is mocked as we don't really care + * about the state of the channels. Instead we want to only observe the state transitions */ final class ObserveStateSpec extends AnyFunSuite @@ -1149,15 +1147,15 @@ trait GenericInstMocks extends ChannelsFactory { val epicsReader = mock[EpicsReader] val epicsWriter = mock[EpicsWriter] - (epicsWriter.getEnumChannel[CadDirective] _).expects(s"${apply}.DIR", *).returns(dirChannel) - (epicsReader.getIntegerChannel _).expects(s"${apply}.VAL").returns(intChannelS) - (epicsReader.getStringChannel _).expects(s"${apply}.MESS").returns(strChannel) - (epicsReader.getIntegerChannel _).expects(s"${applyCar}.CLID").returns(intChannelS) - (epicsReader.getEnumChannel[CarState] _).expects(s"${applyCar}.VAL", *).returns(carChannel) - (epicsReader.getStringChannel _).expects(s"${applyCar}.OMSS").returns(strChannel) - (epicsReader.getIntegerChannel _).expects(s"${observeCar}.CLID").returns(intChannel) - (epicsReader.getEnumChannel[CarState] _).expects(s"${observeCar}.VAL", *).returns(carChannel) - (epicsReader.getStringChannel _).expects(s"${observeCar}.OMSS").returns(strChannel) + (epicsWriter.getEnumChannel[CadDirective] _).expects(s"$apply.DIR", *).returns(dirChannel) + (epicsReader.getIntegerChannel _).expects(s"$apply.VAL").returns(intChannelS) + (epicsReader.getStringChannel _).expects(s"$apply.MESS").returns(strChannel) + (epicsReader.getIntegerChannel _).expects(s"$applyCar.CLID").returns(intChannelS) + (epicsReader.getEnumChannel[CarState] _).expects(s"$applyCar.VAL", *).returns(carChannel) + (epicsReader.getStringChannel _).expects(s"$applyCar.OMSS").returns(strChannel) + (epicsReader.getIntegerChannel _).expects(s"$observeCar.CLID").returns(intChannel) + (epicsReader.getEnumChannel[CarState] _).expects(s"$observeCar.VAL", *).returns(carChannel) + (epicsReader.getStringChannel _).expects(s"$observeCar.OMSS").returns(strChannel) (epicsReader, epicsWriter) } } diff --git a/modules/engine/src/main/scala/seqexec/engine/Engine.scala b/modules/engine/src/main/scala/seqexec/engine/Engine.scala index 3c05da67fe..c97a6d0a11 100644 --- a/modules/engine/src/main/scala/seqexec/engine/Engine.scala +++ b/modules/engine/src/main/scala/seqexec/engine/Engine.scala @@ -50,9 +50,9 @@ class Engine[F[_]: MonadError[*[_], Throwable]: Logger, S, U](stateL: Engine.Sta } /** - * startFrom starts a sequence from an arbitrary step. It does it by marking all previous steps to be skipped and then - * modifying the state sequence as if it was run. - * If the requested step is already run or marked to be skipped, the sequence will start from the next runnable step + * startFrom starts a sequence from an arbitrary step. It does it by marking all previous steps to + * be skipped and then modifying the state sequence as if it was run. If the requested step is + * already run or marked to be skipped, the sequence will start from the next runnable step */ def startFrom(id: Observation.Id, step: StepId): HandleType[Unit] = getS(id).flatMap { @@ -133,16 +133,18 @@ class Engine[F[_]: MonadError[*[_], Throwable]: Logger, S, U](stateL: Engine.Sta /** * Refresh the steps executions of an existing sequence. Does not add nor remove steps. - * @param id sequence identifier - * @param steps List of new steps definitions + * @param id + * sequence identifier + * @param steps + * List of new steps definitions * @return */ def update(id: Observation.Id, steps: List[Step[F]]): Endo[S] = stateL.sequenceStateIndex(id).modify(_.update(steps.map(_.executions))) /** - * Adds the current `Execution` to the completed `Queue`, makes the next - * pending `Execution` the current one, and initiates the actual execution. + * Adds the current `Execution` to the completed `Queue`, makes the next pending `Execution` the + * current one, and initiates the actual execution. * * If there are no more pending `Execution`s, it emits the `Finished` event. */ @@ -179,8 +181,8 @@ class Engine[F[_]: MonadError[*[_], Throwable]: Logger, S, U](stateL: Engine.Sta ) /** - * Executes all actions in the `Current` `Execution` in parallel. When all are done it emits the `Executed` event. - * It also updates the `State` as needed. + * Executes all actions in the `Current` `Execution` in parallel. When all are done it emits the + * `Executed` event. It also updates the `State` as needed. */ // Send the expected event when the `Action` is executed // It doesn't catch run time exceptions. If desired, the Action has to do it itself. @@ -248,8 +250,8 @@ class Engine[F[_]: MonadError[*[_], Throwable]: Logger, S, U](stateL: Engine.Sta }.getOrElse(unit)) /** - * Given the index of the completed `Action` in the current `Execution`, it - * marks the `Action` as completed and returns the new updated `State`. + * Given the index of the completed `Action` in the current `Execution`, it marks the `Action` as + * completed and returns the new updated `State`. * * When the index doesn't exist it does nothing. */ @@ -306,9 +308,8 @@ class Engine[F[_]: MonadError[*[_], Throwable]: Logger, S, U](stateL: Engine.Sta }.getOrElse(unit)) /** - * For now it only changes the `Status` to `Paused` and returns the new - * `State`. In the future this function should handle the failed - * action. + * For now it only changes the `Status` to `Paused` and returns the new `State`. In the future + * this function should handle the failed action. */ private def fail(id: Observation.Id)(i: Int, e: Result.Error): HandleType[Unit] = modifyS(id)(_.mark(i)(e)) *> diff --git a/modules/engine/src/main/scala/seqexec/engine/Event.scala b/modules/engine/src/main/scala/seqexec/engine/Event.scala index e3045313a1..8cf09039cf 100644 --- a/modules/engine/src/main/scala/seqexec/engine/Event.scala +++ b/modules/engine/src/main/scala/seqexec/engine/Event.scala @@ -98,7 +98,7 @@ object Event { r: Result.Partial[R] ): Event[F, Nothing, Nothing] = EventSystem[F](PartialResult(id, stepId, i, r)) - def paused[F[_]](id: Observation.Id, i: Int, c: Result.Paused[F]): Event[F, Nothing, Nothing] = + def paused[F[_]](id: Observation.Id, i: Int, c: Result.Paused[F]): Event[F, Nothing, Nothing] = EventSystem[F](Paused[F](id, i, c)) def breakpointReached[F[_]](id: Observation.Id): Event[F, Nothing, Nothing] = EventSystem[F](BreakpointReached(id)) diff --git a/modules/engine/src/main/scala/seqexec/engine/Execution.scala b/modules/engine/src/main/scala/seqexec/engine/Execution.scala index d3ea6ce931..f13df1e652 100644 --- a/modules/engine/src/main/scala/seqexec/engine/Execution.scala +++ b/modules/engine/src/main/scala/seqexec/engine/Execution.scala @@ -11,8 +11,8 @@ import mouse.boolean._ import seqexec.engine.Action.ActionState /** - * This structure holds the current `Execution` under execution. It carries - * information about which `Action`s have been completed. + * This structure holds the current `Execution` under execution. It carries information about which + * `Action`s have been completed. */ final case class Execution[F[_]](execution: List[Action[F]]) { @@ -60,8 +60,7 @@ object Execution { def empty[F[_]]: Execution[F] = Execution[F](Nil) /** - * Make an `Execution` `Current` only if all the `Action`s in the execution - * are pending. + * Make an `Execution` `Current` only if all the `Action`s in the execution are pending. */ def currentify[F[_]](as: ParallelActions[F]): Option[Execution[F]] = as.forall(_.state.runState.isIdle).option(Execution(as.toList)) diff --git a/modules/engine/src/main/scala/seqexec/engine/Handle.scala b/modules/engine/src/main/scala/seqexec/engine/Handle.scala index f90b9441b0..cdcc514cd2 100644 --- a/modules/engine/src/main/scala/seqexec/engine/Handle.scala +++ b/modules/engine/src/main/scala/seqexec/engine/Handle.scala @@ -11,14 +11,11 @@ import cats.syntax.all._ import fs2.Stream /** - * Type constructor where all Seqexec side effect are managed. - * Handle is a State machine inside a F, which can produce Streams as output. It is combined with the - * input stream to run seqexec engine. + * Type constructor where all Seqexec side effect are managed. Handle is a State machine inside a F, + * which can produce Streams as output. It is combined with the input stream to run seqexec engine. * - * Its type parameters are: - * A: Type of the output (usually Unit) - * V: Type of the events - * D: Type of the state machine state. + * Its type parameters are: A: Type of the output (usually Unit) V: Type of the events D: Type of + * the state machine state. */ final case class Handle[F[_], D, V, A](run: StateT[F, D, (A, Option[Stream[F, V]])]) diff --git a/modules/engine/src/main/scala/seqexec/engine/Sequence.scala b/modules/engine/src/main/scala/seqexec/engine/Sequence.scala index 6006d2f1cc..7117913c6c 100644 --- a/modules/engine/src/main/scala/seqexec/engine/Sequence.scala +++ b/modules/engine/src/main/scala/seqexec/engine/Sequence.scala @@ -25,8 +25,7 @@ object Sequence { def empty[F[_]](id: Observation.Id): Sequence[F] = Sequence(id, Nil) /** - * Sequence Zipper. This structure is optimized for the actual `Sequence` - * execution. + * Sequence Zipper. This structure is optimized for the actual `Sequence` execution. */ final case class Zipper[F[_]]( id: Observation.Id, @@ -39,12 +38,11 @@ object Sequence { pending.span(st => st.skipMark.self) /** - * Runs the next execution. If the current `Step` is completed it adds the - * `StepZ` under focus to the list of completed `Step`s and makes the next - * pending `Step` the current one. + * Runs the next execution. If the current `Step` is completed it adds the `StepZ` under focus + * to the list of completed `Step`s and makes the next pending `Step` the current one. * - * If there are still `Execution`s that have not finished in the current - * `Step` or if there are no more pending `Step`s it returns `None`. + * If there are still `Execution`s that have not finished in the current `Step` or if there are + * no more pending `Step`s it returns `None`. * * It skips steps, but honoring breakpoints. */ @@ -88,8 +86,8 @@ object Sequence { } else this.some /** - * Obtain the resulting `Sequence` only if all `Step`s have been completed. - * This is a special way of *unzipping* a `Zipper`. + * Obtain the resulting `Sequence` only if all `Step`s have been completed. This is a special + * way of *unzipping* a `Zipper`. */ val uncurrentify: Option[Sequence[F]] = if (remaining.isEmpty) @@ -104,8 +102,8 @@ object Sequence { else None /** - * Unzip a `Zipper`. This creates a single `Sequence` with either - * completed `Step`s or pending `Step`s. + * Unzip a `Zipper`. This creates a single `Sequence` with either completed `Step`s or pending + * `Step`s. */ val toSequence: Sequence[F] = Sequence( @@ -118,8 +116,8 @@ object Sequence { object Zipper { /** - * Make a `Zipper` from a `Sequence` only if all the `Step`s in the - * `Sequence` are pending. This is a special way of *zipping* a `Sequence`. + * Make a `Zipper` from a `Sequence` only if all the `Step`s in the `Sequence` are pending. This + * is a special way of *zipping* a `Sequence`. */ def currentify[F[_]](seq: Sequence[F]): Option[Zipper[F]] = seq.steps match { @@ -167,12 +165,11 @@ object Sequence { sealed trait State[F[_]] { /** - * Returns a new `State` where the next pending `Step` is been made the - * current `Step` under execution and the previous current `Step` is - * placed in the completed `Sequence`. + * Returns a new `State` where the next pending `Step` is been made the current `Step` under + * execution and the previous current `Step` is placed in the completed `Sequence`. * - * If the current `Step` has `Execution`s not completed or there are no more - * pending `Step`s it returns `None`. + * If the current `Step` has `Execution`s not completed or there are no more pending `Step`s it + * returns `None`. */ val next: Option[State[F]] @@ -200,8 +197,8 @@ object Sequence { val done: List[Step[F]] /** - * Given an index of a current `Action` it replaces such `Action` with the - * `Result` and returns the new modified `State`. + * Given an index of a current `Action` it replaces such `Action` with the `Result` and returns + * the new modified `State`. * * If the index doesn't exist, the new `State` is returned unmodified. */ @@ -210,16 +207,17 @@ object Sequence { def start(i: Int): State[F] /** - * Updates the steps executions. - * It preserves the number of steps. - * @param stepDefs New executions. - * @return Updated state + * Updates the steps executions. It preserves the number of steps. + * @param stepDefs + * New executions. + * @return + * Updated state */ def update(stepDefs: List[List[ParallelActions[F]]]): State[F] /** - * Unzip `State`. This creates a single `Sequence` with either completed `Step`s - * or pending `Step`s. + * Unzip `State`. This creates a single `Sequence` with either completed `Step`s or pending + * `Step`s. */ val toSequence: Sequence[F] @@ -279,11 +277,14 @@ object Sequence { .getOrElse(Final(q, SequenceState.Idle)) /** - * Rebuilds the state of a sequence with a new steps definition, but preserving breakpoints and skip marks - * The sequence must not be running. - * @param steps New sequence definition - * @param st Old sequence state - * @return The new sequence state + * Rebuilds the state of a sequence with a new steps definition, but preserving breakpoints and + * skip marks The sequence must not be running. + * @param steps + * New sequence definition + * @param st + * Old sequence state + * @return + * The new sequence state */ def reload[F[_]](steps: List[Step[F]], st: State[F]): State[F] = if (st.status.isRunning) st @@ -423,8 +424,8 @@ object Sequence { } /** - * Final `State`. This doesn't have any `Step` under execution, there are - * only completed `Step`s. + * Final `State`. This doesn't have any `Step` under execution, there are only completed + * `Step`s. */ final case class Final[F[_]](seq: Sequence[F], status: SequenceState) extends State[F] { self => diff --git a/modules/engine/src/main/scala/seqexec/engine/Step.scala b/modules/engine/src/main/scala/seqexec/engine/Step.scala index e6e7622e67..fc35d9dd9b 100644 --- a/modules/engine/src/main/scala/seqexec/engine/Step.scala +++ b/modules/engine/src/main/scala/seqexec/engine/Step.scala @@ -91,11 +91,11 @@ object Step { ) { self => /** - * Adds the `Current` `Execution` to the list of completed `Execution`s and - * makes the next pending `Execution` the `Current` one. + * Adds the `Current` `Execution` to the list of completed `Execution`s and makes the next + * pending `Execution` the `Current` one. * - * If there are still `Action`s that have not finished in `Current` or if - * there are no more pending `Execution`s it returns `None`. + * If there are still `Action`s that have not finished in `Current` or if there are no more + * pending `Execution`s it returns `None`. */ val next: Option[Zipper[F]] = pending match { @@ -110,8 +110,8 @@ object Step { self.copy(pending = rolledback._2, focus = rolledback._1, done = Nil) /** - * Obtain the resulting `Step` only if all `Execution`s have been completed. - * This is a special way of *unzipping* a `Zipper`. + * Obtain the resulting `Step` only if all `Execution`s have been completed. This is a special + * way of *unzipping* a `Zipper`. */ val uncurrentify: Option[Step[F]] = if (pending.isEmpty) @@ -119,8 +119,8 @@ object Step { else None /** - * Unzip a `Zipper`. This creates a single `Step` with either completed - * `Exection`s or pending `Execution`s. + * Unzip a `Zipper`. This creates a single `Step` with either completed `Exection`s or pending + * `Execution`s. */ val toStep: Step[F] = Step( @@ -159,8 +159,8 @@ object Step { } /** - * Make a `Zipper` from a `Step` only if all the `Execution`s in the `Step` are - * pending. This is a special way of *zipping* a `Step`. + * Make a `Zipper` from a `Step` only if all the `Execution`s in the `Step` are pending. This is + * a special way of *zipping* a `Step`. */ def currentify[F[_]](step: Step[F]): Option[Zipper[F]] = calcRolledback(step.executions).map { case (x, exes) => diff --git a/modules/engine/src/main/scala/seqexec/engine/package.scala b/modules/engine/src/main/scala/seqexec/engine/package.scala index bf60deff92..b323176969 100644 --- a/modules/engine/src/main/scala/seqexec/engine/package.scala +++ b/modules/engine/src/main/scala/seqexec/engine/package.scala @@ -12,8 +12,7 @@ package object engine { // Top level synonyms /** - * This represents an actual real-world action to be done in the underlying - * systems. + * This represents an actual real-world action to be done in the underlying systems. */ def fromF[F[_]](kind: ActionType, t: F[Result[F]]*): Action[F] = Action(kind = kind, @@ -22,9 +21,8 @@ package object engine { ) /** - * `ParallelActions` is a group of `Action`s that need to be run in parallel - * without interruption. A *sequential* `Execution` can be represented with - * an `Execution` with a single `Action`. + * `ParallelActions` is a group of `Action`s that need to be run in parallel without interruption. + * A *sequential* `Execution` can be represented with an `Execution` with a single `Action`. */ type ParallelActions[F[_]] = NonEmptyList[Action[F]] diff --git a/modules/engine/src/test/scala/seqexec/engine/packageSpec.scala b/modules/engine/src/test/scala/seqexec/engine/packageSpec.scala index a081df4009..587e573d2b 100644 --- a/modules/engine/src/test/scala/seqexec/engine/packageSpec.scala +++ b/modules/engine/src/test/scala/seqexec/engine/packageSpec.scala @@ -559,9 +559,8 @@ class packageSpec extends AnyFlatSpec with NonImplicitAssertions { .unsafeRunSync() /** - * First state update must have the action started. - * Second state update must have the action finished. - * The value in `dummy` must change. That is prove that the `Action` run. + * First state update must have the action started. Second state update must have the action + * finished. The value in `dummy` must change. That is prove that the `Action` run. */ inside(sfs) { case a :: b :: _ => assert(TestState.sequenceStateIndex(seqId).getOption(a).exists(_.getSingleState(c).started)) diff --git a/modules/giapi/src/main/scala/giapi/client/GiapiStatusDb.scala b/modules/giapi/src/main/scala/giapi/client/GiapiStatusDb.scala index afbe352226..c3726272d4 100644 --- a/modules/giapi/src/main/scala/giapi/client/GiapiStatusDb.scala +++ b/modules/giapi/src/main/scala/giapi/client/GiapiStatusDb.scala @@ -138,8 +138,10 @@ object GiapiStatusDb { /** * Creates a new status db that listens for status items as they are produced * - * @param url Url of the giapi server - * @param items List of items to monitor + * @param url + * Url of the giapi server + * @param items + * List of items to monitor */ def newStatusDb[F[_]: ConcurrentEffect]( url: String, diff --git a/modules/giapi/src/main/scala/giapi/client/commands/package.scala b/modules/giapi/src/main/scala/giapi/client/commands/package.scala index 2d59512137..7917e16039 100644 --- a/modules/giapi/src/main/scala/giapi/client/commands/package.scala +++ b/modules/giapi/src/main/scala/giapi/client/commands/package.scala @@ -87,11 +87,16 @@ package object commands { /** * Send a command over giapi - * @param commandsClient Client interface to send the command to the client and await the response - * @param command The actual command sent - * @param timeout Timeout to await a response, often 2 seconds - * @tparam F Effect type - * @return the result of the operation + * @param commandsClient + * Client interface to send the command to the client and await the response + * @param command + * The actual command sent + * @param timeout + * Timeout to await a response, often 2 seconds + * @tparam F + * Effect type + * @return + * the result of the operation */ def sendCommand[F[_]: Async]( commandsClient: CommandSenderClient, diff --git a/modules/giapi/src/main/scala/giapi/client/package.scala b/modules/giapi/src/main/scala/giapi/client/package.scala index 10545bf49c..0aeafa0a43 100644 --- a/modules/giapi/src/main/scala/giapi/client/package.scala +++ b/modules/giapi/src/main/scala/giapi/client/package.scala @@ -66,7 +66,8 @@ package client { /** * Represents a connection to a GIAPi based instrument * - * @tparam F Effect type + * @tparam F + * Effect type */ trait GiapiConnection[F[_]] { def connect: F[Giapi[F]] @@ -75,12 +76,14 @@ package client { /** * Algebra to interact with a GIAPI instrument * - * @tparam F Effect Type + * @tparam F + * Effect Type */ trait Giapi[F[_]] { /** - * Returns a value for the status item. If not found or there is an error, an exception could be thrown + * Returns a value for the status item. If not found or there is an error, an exception could be + * thrown */ def get[A: ItemGetter](statusItem: String): F[A] @@ -90,11 +93,10 @@ package client { def getO[A: ItemGetter](statusItem: String): F[Option[A]] /** - * Executes a command as defined on GIAPI - * Note that commands can end in ERROR or COMPLETED - * Giapi has an extra case where we have a command ACCEPTED and it will complete in the future - * That makes handling easier with callbacks on Java land but on IO-land it makes more sense to - * wait for ERROR/COMPLETED and do async calls above this level + * Executes a command as defined on GIAPI Note that commands can end in ERROR or COMPLETED Giapi + * has an extra case where we have a command ACCEPTED and it will complete in the future That + * makes handling easier with callbacks on Java land but on IO-land it makes more sense to wait + * for ERROR/COMPLETED and do async calls above this level * * This decision may be review in the future */ @@ -180,8 +182,10 @@ package client { /** * Interpreter on F * - * @param url Url to connect to - * @tparam F Effect type + * @param url + * Url to connect to + * @tparam F + * Effect type */ def giapiConnection[F[_]: Timer: ConcurrentEffect]( url: String @@ -247,7 +251,7 @@ package client { */ def giapiConnectionId: GiapiConnection[Id] = new GiapiConnection[Id] { override def connect: Id[Giapi[Id]] = new Giapi[Id] { - override def get[A: ItemGetter](statusItem: String): Id[A] = + override def get[A: ItemGetter](statusItem: String): Id[A] = sys.error(s"Cannot read $statusItem") override def getO[A: ItemGetter](statusItem: String): Id[Option[A]] = None override def stream[A: ItemGetter](statusItem: String): Id[Stream[Id, A]] = @@ -266,7 +270,7 @@ package client { F: ApplicativeError[F, Throwable] ): GiapiConnection[F] = new GiapiConnection[F] { override def connect: F[Giapi[F]] = F.pure(new Giapi[F] { - override def get[A: ItemGetter](statusItem: String): F[A] = + override def get[A: ItemGetter](statusItem: String): F[A] = F.raiseError(new RuntimeException(s"Cannot read $statusItem")) override def getO[A: ItemGetter](statusItem: String): F[Option[A]] = F.pure(None) override def stream[A: ItemGetter](statusItem: String): F[Stream[F, A]] = diff --git a/modules/giapi/src/test/scala/giapi/client/GiapiCommandSpec.scala b/modules/giapi/src/test/scala/giapi/client/GiapiCommandSpec.scala index 80b5e24219..03804fa0f0 100644 --- a/modules/giapi/src/test/scala/giapi/client/GiapiCommandSpec.scala +++ b/modules/giapi/src/test/scala/giapi/client/GiapiCommandSpec.scala @@ -10,9 +10,9 @@ import edu.gemini.jms.activemq.provider.ActiveMQJmsProvider import edu.gemini.aspen.giapi.commands.{ Activity, Command => JCommand, - SequenceCommand, CompletionListener, - HandlerResponse + HandlerResponse, + SequenceCommand } import edu.gemini.aspen.giapi.commands.HandlerResponse.Response import edu.gemini.aspen.gmp.commands.jms.clientbridge.CommandMessagesBridgeImpl diff --git a/modules/model/jvm/src/main/scala/seqexec/model/config/AuthenticationConfig.scala b/modules/model/jvm/src/main/scala/seqexec/model/config/AuthenticationConfig.scala index f8874b51e0..cf928d0ff7 100644 --- a/modules/model/jvm/src/main/scala/seqexec/model/config/AuthenticationConfig.scala +++ b/modules/model/jvm/src/main/scala/seqexec/model/config/AuthenticationConfig.scala @@ -10,12 +10,18 @@ import org.http4s.Uri /** * Configuration for the general authentication service - * @param devMode Indicates if we are in development mode, In this mode there is an internal list of users - * @param sessionLifeHrs How long will the session live in hours - * @param cookieName Name of the cookie to store the token - * @param secretKey Secret key to encrypt jwt tokens - * @param useSSL Whether we use SSL setting the cookie to be https only - * @param ldap URL of the ldap servers + * @param devMode + * Indicates if we are in development mode, In this mode there is an internal list of users + * @param sessionLifeHrs + * How long will the session live in hours + * @param cookieName + * Name of the cookie to store the token + * @param secretKey + * Secret key to encrypt jwt tokens + * @param useSSL + * Whether we use SSL setting the cookie to be https only + * @param ldap + * URL of the ldap servers */ final case class AuthenticationConfig( sessionLifeHrs: FiniteDuration, diff --git a/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecConfiguration.scala b/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecConfiguration.scala index 1d8204055e..02751c608c 100644 --- a/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecConfiguration.scala +++ b/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecConfiguration.scala @@ -8,12 +8,18 @@ import lucuma.core.enum.Site /** * Top configuration of the seqexec - * @param site Site this seqexec instance handles (GN/GS) - * @param mode Execution mode - * @param seqexecEngine Configuration of the engine - * @param webServer Web side configuration - * @param smartGcal Configuration to reach SmartGCal - * @param authentication Configuration to support authentication + * @param site + * Site this seqexec instance handles (GN/GS) + * @param mode + * Execution mode + * @param seqexecEngine + * Configuration of the engine + * @param webServer + * Web side configuration + * @param smartGcal + * Configuration to reach SmartGCal + * @param authentication + * Configuration to support authentication */ final case class SeqexecConfiguration( site: Site, diff --git a/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecEngineConfiguration.scala b/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecEngineConfiguration.scala index 56da3b025b..d4a07a11a6 100644 --- a/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecEngineConfiguration.scala +++ b/modules/model/jvm/src/main/scala/seqexec/model/config/SeqexecEngineConfiguration.scala @@ -14,22 +14,38 @@ trait GhostSettings /** * Configuration of the Seqexec Engine - * @param odb Location of the odb server - * @param dhsServer Location of the dhs server proxy - * @param systemControl Control of the subsystems - * @param odbNotifications Indicates if we notify the odb of sequence events - * @param instForceError Used for testing to simulate errors - * @param failAt At what step to fail if we simulate errors - * @param odbQueuePollingInterval frequency to check the odb queue - * @param gpiUrl URL for the GPI GMP - * @param gpiGDS URL for GPI's GDS - * @param ghostUrl URL for GHOST GMP - * @param ghostGDS URL for GHOST's GDS - * @param tops Used to select the top component for epics subsystems - * @param epicsCaAddrList List of IPs for the epics subsystem - * @param readRetries Number of retries when reading a channel - * @param ioTimeout Timeout to listen for EPICS events - * @param dhsTimeout Timeout for DHS operations + * @param odb + * Location of the odb server + * @param dhsServer + * Location of the dhs server proxy + * @param systemControl + * Control of the subsystems + * @param odbNotifications + * Indicates if we notify the odb of sequence events + * @param instForceError + * Used for testing to simulate errors + * @param failAt + * At what step to fail if we simulate errors + * @param odbQueuePollingInterval + * frequency to check the odb queue + * @param gpiUrl + * URL for the GPI GMP + * @param gpiGDS + * URL for GPI's GDS + * @param ghostUrl + * URL for GHOST GMP + * @param ghostGDS + * URL for GHOST's GDS + * @param tops + * Used to select the top component for epics subsystems + * @param epicsCaAddrList + * List of IPs for the epics subsystem + * @param readRetries + * Number of retries when reading a channel + * @param ioTimeout + * Timeout to listen for EPICS events + * @param dhsTimeout + * Timeout for DHS operations */ final case class SeqexecEngineConfiguration( odb: Uri, diff --git a/modules/model/jvm/src/main/scala/seqexec/model/config/SmartGcalConfiguration.scala b/modules/model/jvm/src/main/scala/seqexec/model/config/SmartGcalConfiguration.scala index e4506e995f..3fc9f7d9a4 100644 --- a/modules/model/jvm/src/main/scala/seqexec/model/config/SmartGcalConfiguration.scala +++ b/modules/model/jvm/src/main/scala/seqexec/model/config/SmartGcalConfiguration.scala @@ -10,8 +10,10 @@ import org.http4s.Uri /** * Configuration for Smart Gcal - * @param smartGCalHost Host where smartgcal runs - * @param smartGcalDir Local directory to store cached files + * @param smartGCalHost + * Host where smartgcal runs + * @param smartGcalDir + * Local directory to store cached files */ final case class SmartGcalConfiguration( smartGCalHost: Uri, diff --git a/modules/model/jvm/src/main/scala/seqexec/model/config/WebServerConfiguration.scala b/modules/model/jvm/src/main/scala/seqexec/model/config/WebServerConfiguration.scala index cf18b4b45c..0a3d91248b 100644 --- a/modules/model/jvm/src/main/scala/seqexec/model/config/WebServerConfiguration.scala +++ b/modules/model/jvm/src/main/scala/seqexec/model/config/WebServerConfiguration.scala @@ -9,9 +9,12 @@ import cats.Eq /** * Configuration for the TLS server - * @param keyStore Location where to find the keystore - * @param keyStorePwd Password for the keystore - * @param certPwd Password for the certificate used for TLS + * @param keyStore + * Location where to find the keystore + * @param keyStorePwd + * Password for the keystore + * @param certPwd + * Password for the certificate used for TLS */ final case class TLSConfig(keyStore: Path, keyStorePwd: String, certPwd: String) @@ -23,11 +26,16 @@ object TLSConfig { /** * Configuration for the web server side of the seqexec - * @param host Host name to listen, typicall 0.0.0.0 - * @param port Port to listen for web requestes - * @param insecurePort Port where we setup a redirect server to send to https - * @param externalBaseUrl Redirects need an external facing name - * @param tls Configuration of TLS, optional + * @param host + * Host name to listen, typicall 0.0.0.0 + * @param port + * Port to listen for web requestes + * @param insecurePort + * Port where we setup a redirect server to send to https + * @param externalBaseUrl + * Redirects need an external facing name + * @param tls + * Configuration of TLS, optional */ final case class WebServerConfiguration( host: String, diff --git a/modules/model/shared/src/main/scala/seqexec/common/FixedLengthBuffer.scala b/modules/model/shared/src/main/scala/seqexec/common/FixedLengthBuffer.scala index d73c21226f..6c4de54e4d 100644 --- a/modules/model/shared/src/main/scala/seqexec/common/FixedLengthBuffer.scala +++ b/modules/model/shared/src/main/scala/seqexec/common/FixedLengthBuffer.scala @@ -60,8 +60,8 @@ object FixedLengthBuffer { Eq.by(x => (x.maxLength, x.toChain)) /** - * @typeclass Traverse - * Based on traverse implementation for List + * @typeclass + * Traverse Based on traverse implementation for List */ implicit val instance: Traverse[FixedLengthBuffer] = new Traverse[FixedLengthBuffer] { override def traverse[G[_], A, B](fa: FixedLengthBuffer[A])(f: A => G[B])(implicit @@ -88,8 +88,7 @@ object FixedLengthBuffer { } /** - * Immutable Fixed Length Buffer. It will accumulate items in order - * and discard old ones when full + * Immutable Fixed Length Buffer. It will accumulate items in order and discard old ones when full */ sealed trait FixedLengthBuffer[A] { diff --git a/modules/model/shared/src/main/scala/seqexec/model/NSSubexposure.scala b/modules/model/shared/src/main/scala/seqexec/model/NSSubexposure.scala index 48a2127788..8bf90f12d0 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/NSSubexposure.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/NSSubexposure.scala @@ -11,9 +11,9 @@ import seqexec.model.enum.NodAndShuffleStage._ import shapeless.tag final case class NSSubexposure private ( - totalCycles: NsCycles, // Total amount of cycles for a N&S step - cycle: NsCycles, // Cycle for this sub exposure - stageIndex: Int, // Nod or stage index (between 0 and 3) + totalCycles: NsCycles, // Total amount of cycles for a N&S step + cycle: NsCycles, // Cycle for this sub exposure + stageIndex: Int, // Nod or stage index (between 0 and 3) stage: NodAndShuffleStage // Subexposure stage ) { val firstSubexposure: Boolean = (cycle: Int) === 0 && stageIndex === 0 diff --git a/modules/model/shared/src/main/scala/seqexec/model/ProgramId.scala b/modules/model/shared/src/main/scala/seqexec/model/ProgramId.scala index 1f0a1a6220..f7a71499e6 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/ProgramId.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/ProgramId.scala @@ -20,11 +20,10 @@ import seqexec.model.enum.DailyProgramType import seqexec.model.parser.ProgramIdParsers /** - * A science program id, which has three constructors: - * for standard programs - * for standard daily engineering and calibration programs - * and for all others. - * @group Program Model + * A science program id, which has three constructors: for standard programs for standard daily + * engineering and calibration programs and for all others. + * @group Program + * Model */ sealed trait ProgramId extends Product with Serializable { @@ -135,9 +134,9 @@ object ProgramId { } /** - * Parser for a non-standard program id of the general form `site-semester-type-tail` where - * any subset of the structured portion is permitted as long as it appears in the proper order. - * This is the catch-all type for otherwise unparseable ids, so it is guaranteed that the string + * Parser for a non-standard program id of the general form `site-semester-type-tail` where any + * subset of the structured portion is permitted as long as it appears in the proper order. This + * is the catch-all type for otherwise unparseable ids, so it is guaranteed that the string * representation of a `Nonstandard` via `.format` is *not* parseable in to a standard science or * daily program id. This data type has no public constructor and no `.copy` method, as these * could violate the above invariant. The only way to get an instance is via `.fromString`. @@ -153,8 +152,8 @@ object ProgramId { /** * Format the components of a `Nonstandard`, which may result in a string that *cannot* be - * re-parsed into a Nonstandard program id because it instead parses into a more structured - * type (i.e., Daily or Science). Nonstandard is the fallback. + * re-parsed into a Nonstandard program id because it instead parses into a more structured type + * (i.e., Daily or Science). Nonstandard is the fallback. */ def format( siteOption: Option[Site], @@ -183,8 +182,8 @@ object ProgramId { } /** - * Programs are ordered lexically by prodict prefix (Daily, Nonstandard, then Science) and then - * by the defined orderings for individual cases when constructors match. + * Programs are ordered lexically by prodict prefix (Daily, Nonstandard, then Science) and then by + * the defined orderings for individual cases when constructors match. */ implicit val ProgramIdOrder: Order[ProgramId] = Order.from { @@ -196,7 +195,8 @@ object ProgramId { /** * `Ordering` instance for Scala standard library. - * @see ProgramIdOrder + * @see + * ProgramIdOrder */ implicit val ProgramIdOrdering: scala.math.Ordering[ProgramId] = ProgramIdOrder.toOrdering diff --git a/modules/model/shared/src/main/scala/seqexec/model/ProgramIdParsers.scala b/modules/model/shared/src/main/scala/seqexec/model/ProgramIdParsers.scala index 423ce6e6d8..9d6e3d1bfe 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/ProgramIdParsers.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/ProgramIdParsers.scala @@ -38,9 +38,9 @@ trait ProgramIdParsers { (site <~ hyphen, dailyProgramType, yyyymmdd).mapN(Daily.apply).named("daily") /** - * Parser for the components of a nonstandard program id (which has no public constructor). - * This parser is greedy and will read as much structured information as possible rather than - * leaving it in the tail. + * Parser for the components of a nonstandard program id (which has no public constructor). This + * parser is greedy and will read as much structured information as possible rather than leaving + * it in the tail. */ def nonstandard: Parser[(Option[Site], Option[Semester], Option[ProgramType], String)] = (opt(site <~ hyphen), opt(semester <~ hyphen), opt(programType <~ hyphen), nonWhitespace).tupled diff --git a/modules/model/shared/src/main/scala/seqexec/model/SequencesQueue.scala b/modules/model/shared/src/main/scala/seqexec/model/SequencesQueue.scala index d5d1a96ef4..77bea03c44 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/SequencesQueue.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/SequencesQueue.scala @@ -14,8 +14,8 @@ import seqexec.model.Observation import seqexec.model.enum.Instrument /** - * Represents a queue with different levels of details. E.g. it could be a list of Ids - * Or a list of fully hydrated SequenceViews + * Represents a queue with different levels of details. E.g. it could be a list of Ids Or a list of + * fully hydrated SequenceViews */ @Lenses final case class SequencesQueue[T]( diff --git a/modules/model/shared/src/main/scala/seqexec/model/boopickle/ModelBooPicklers.scala b/modules/model/shared/src/main/scala/seqexec/model/boopickle/ModelBooPicklers.scala index b0c9092647..594b37c084 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/boopickle/ModelBooPicklers.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/boopickle/ModelBooPicklers.scala @@ -37,9 +37,8 @@ import shapeless.tag.@@ import squants.time.TimeConversions._ /** - * Contains boopickle implicit picklers of model objects - * Boopickle can auto derive encoders but it is preferred to make - * them explicitly + * Contains boopickle implicit picklers of model objects Boopickle can auto derive encoders but it + * is preferred to make them explicitly */ trait ModelBooPicklers extends BooPicklerSyntax { implicit val yearPickler: Pickler[Year] = transformPickler(Year.of)(_.getValue) diff --git a/modules/model/shared/src/main/scala/seqexec/model/boopickle/package.scala b/modules/model/shared/src/main/scala/seqexec/model/boopickle/package.scala index ad90eac28e..37cd6ae131 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/boopickle/package.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/boopickle/package.scala @@ -12,7 +12,7 @@ import seqexec.model.events.SeqexecEvent package boopickle { - trait BooPicklerSyntax { + trait BooPicklerSyntax { implicit class PicklerPrismOps[A, B <: AnyRef](p: Prism[A, B])(implicit PA: Pickler[A]) { def toPickler: Pickler[B] = new Pickler[B] { @@ -50,8 +50,8 @@ package boopickle { package object boopickle extends ModelBooPicklers { /** - * In most cases http4s will use the limit of a byte buffer but not for websockets - * This method trims the binary array to be sent on the WS channel + * In most cases http4s will use the limit of a byte buffer but not for websockets This method + * trims the binary array to be sent on the WS channel */ def trimmedArray(e: SeqexecEvent): Array[Byte] = { val byteBuffer = Pickle.intoBytes(e) diff --git a/modules/model/shared/src/main/scala/seqexec/model/enumerations.scala b/modules/model/shared/src/main/scala/seqexec/model/enumerations.scala index a5ff67872e..42e1468345 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/enumerations.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/enumerations.scala @@ -4,9 +4,8 @@ package seqexec.model /** - * Unfortunatly we'll have to store this here too to avoid exposing - * spModel to the client - * Should be gone when we integrate into gem + * Unfortunatly we'll have to store this here too to avoid exposing spModel to the client Should be + * gone when we integrate into gem */ object enumerations { object filter { diff --git a/modules/model/shared/src/main/scala/seqexec/model/events.scala b/modules/model/shared/src/main/scala/seqexec/model/events.scala index 49a238afe2..0c4007e17d 100644 --- a/modules/model/shared/src/main/scala/seqexec/model/events.scala +++ b/modules/model/shared/src/main/scala/seqexec/model/events.scala @@ -19,8 +19,7 @@ object events { } /** - * Events implementing ForClient will be delivered only to the given - * clientId + * Events implementing ForClient will be delivered only to the given clientId */ sealed trait ForClient extends SeqexecEvent { def clientId: ClientId diff --git a/modules/ocs2_api/src/main/scala/gem/ocs2/model/Dataset.scala b/modules/ocs2_api/src/main/scala/gem/ocs2/model/Dataset.scala index 2319a18ed3..2c2236431b 100644 --- a/modules/ocs2_api/src/main/scala/gem/ocs2/model/Dataset.scala +++ b/modules/ocs2_api/src/main/scala/gem/ocs2/model/Dataset.scala @@ -14,7 +14,8 @@ import seqexec.model.Observation /** * A labeled, timestamped data file. - * @group Sequence Model + * @group Sequence + * Model */ final case class Dataset( label: Dataset.Label, @@ -26,7 +27,8 @@ object Dataset { /** * Datasets are labeled by observation and index. - * @group Data Types + * @group Data + * Types */ final case class Label(observationId: Observation.Id, index: Int) { override def toString = @@ -37,7 +39,8 @@ object Dataset { /** * Labels are ordered by observation and index. - * @group Typeclass Instances + * @group Typeclass + * Instances */ implicit val LabelOrder: Order[Label] = Order.by(a => (a.observationId, a.index)) @@ -68,9 +71,10 @@ object Dataset { } /** - * Datasets are ordered by their labels, which are normally unique. For completeness they are further - * ordered by timestamp and filename. - * @group Typeclass Instances + * Datasets are ordered by their labels, which are normally unique. For completeness they are + * further ordered by timestamp and filename. + * @group Typeclass + * Instances */ implicit val DatasetOrder: Order[Dataset] = Order.by(a => (a.label, a.timestamp, a.filename)) diff --git a/modules/ocs2_api/src/main/scala/gem/ocs2/pio/PioParse.scala b/modules/ocs2_api/src/main/scala/gem/ocs2/pio/PioParse.scala index 8cfdd01bc3..5802ed1096 100644 --- a/modules/ocs2_api/src/main/scala/gem/ocs2/pio/PioParse.scala +++ b/modules/ocs2_api/src/main/scala/gem/ocs2/pio/PioParse.scala @@ -27,10 +27,9 @@ object PioParse { PioParse(dictionary.toMap.lift) /** - * Builds a PioParse for an `Enumerated` instance, assuming that the enum - * tags will be used as the lookup keys. In other words, this is an option - * for enumerations whose OCS2 export happen to match the new model enum - * tags. + * Builds a PioParse for an `Enumerated` instance, assuming that the enum tags will be used as the + * lookup keys. In other words, this is an option for enumerations whose OCS2 export happen to + * match the new model enum tags. */ def enumFromTag[A](as: List[A])(implicit ev: Enumerated[A]): PioParse[A] = PioParse(as.map(a => ev.tag(a) -> a).toMap.lift) diff --git a/modules/ocs2_api/src/main/scala/ocs2/config/GmosConfig.scala b/modules/ocs2_api/src/main/scala/ocs2/config/GmosConfig.scala index 35efa11178..c78e265581 100644 --- a/modules/ocs2_api/src/main/scala/ocs2/config/GmosConfig.scala +++ b/modules/ocs2_api/src/main/scala/ocs2/config/GmosConfig.scala @@ -15,13 +15,14 @@ import monocle._ /** * Additional type hierarchy over the low-level GMOS enums. - * @group Instrument-Specific Models + * @group Instrument-Specific + * Models */ object GmosConfig { /** - * Nod-and-shuffle offset in detector rows, which must be positive, non-zero. - * This class essentially provides a newtype for Int. + * Nod-and-shuffle offset in detector rows, which must be positive, non-zero. This class + * essentially provides a newtype for Int. */ sealed abstract case class GmosShuffleOffset(detectorRows: Int) { @@ -32,25 +33,25 @@ object GmosConfig { object GmosShuffleOffset extends GmosShuffleOffsetOptics { /** - * Constructs the shuffle offset with the given number of detector rows, - * provided it is a positive number. + * Constructs the shuffle offset with the given number of detector rows, provided it is a + * positive number. * - * @return `Some(GmosShuffleOffset(rows))` if `rows` is positive, - * `None` otherwise + * @return + * `Some(GmosShuffleOffset(rows))` if `rows` is positive, `None` otherwise */ def fromRowCount(rows: Int): Option[GmosShuffleOffset] = if (rows > 0) Some(new GmosShuffleOffset(rows) {}) else None /** - * Constructs the shuffle offset with the given number of detector rows - * provided `rows` is positive, or throws an exception if zero or negative. + * Constructs the shuffle offset with the given number of detector rows provided `rows` is + * positive, or throws an exception if zero or negative. */ def unsafeFromRowCount(rows: Int): GmosShuffleOffset = fromRowCount(rows).getOrElse(sys.error(s"Expecting positive detector row count, not $rows")) /** - * Constructs a shuffle offset using the default number of detector rows - * associated with the detector. + * Constructs a shuffle offset using the default number of detector rows associated with the + * detector. */ def defaultFromDetector(detector: GmosDetector): GmosShuffleOffset = fromRowCount(detector.shuffleOffset) @@ -69,8 +70,8 @@ object GmosConfig { } /** - * The number of nod-and-shuffle cycles, which must be at least 1. This class - * essentially provides a newtype for Int. + * The number of nod-and-shuffle cycles, which must be at least 1. This class essentially provides + * a newtype for Int. */ sealed abstract case class GmosShuffleCycles(toInt: Int) { @@ -87,15 +88,15 @@ object GmosConfig { /** * Constructs the shuffle cycles from a count if `cycles` is positive. * - * @return `Some(GmosShuffleCycles(cycles))` if `cycles` is positive, - * `None` otherwise + * @return + * `Some(GmosShuffleCycles(cycles))` if `cycles` is positive, `None` otherwise */ def fromCycleCount(cycles: Int): Option[GmosShuffleCycles] = if (cycles > 0) Some(new GmosShuffleCycles(cycles) {}) else None /** - * Constructs the shuffle cycles with the given `cycles` count provided it - * is positive, or else throws an exception if 0 or negative. + * Constructs the shuffle cycles with the given `cycles` count provided it is positive, or else + * throws an exception if 0 or negative. */ def unsafeFromCycleCount(cycles: Int): GmosShuffleCycles = fromCycleCount(cycles).getOrElse(sys.error(s"Expecting positive shuffle cycles, not $cycles")) @@ -191,22 +192,22 @@ object GmosConfig { (yMin.toInt, yMin + yRange) /** - * Returns `true` if the pixels specified by this custom ROI entry overlap - * with the pixels specified by `that` entry. + * Returns `true` if the pixels specified by this custom ROI entry overlap with the pixels + * specified by `that` entry. */ def overlaps(that: GmosCustomRoiEntry): Boolean = columnsOverlap(that) && rowsOverlap(that) /** - * Returns `true` if the columns spanned this custom ROI entry overlap with - * the columns spanned by `that` entry. + * Returns `true` if the columns spanned this custom ROI entry overlap with the columns spanned + * by `that` entry. */ def columnsOverlap(that: GmosCustomRoiEntry): Boolean = overlapCheck(that, _.columns) /** - * Returns `true` if the rows spanned this custom ROI entry overlap with - * the rows spanned by `that` entry. + * Returns `true` if the rows spanned this custom ROI entry overlap with the rows spanned by + * `that` entry. */ def rowsOverlap(that: GmosCustomRoiEntry): Boolean = overlapCheck(that, _.rows) @@ -417,9 +418,8 @@ object GmosConfig { } /** - * Custom mask definition, which is available as an alternative to using a - * builtin FPU. Either both these parameters are set or neither are set in a - * GMOS observation + * Custom mask definition, which is available as an alternative to using a builtin FPU. Either + * both these parameters are set or neither are set in a GMOS observation */ final case class GmosCustomMask( maskDefinitionFilename: String, @@ -448,12 +448,12 @@ object GmosConfig { } /** - * GMOS grating configuration, parameterized on the disperser type. These - * are grouped because they only apply when using a grating. That is, all - * are defined or none or defined in the dynamic config. + * GMOS grating configuration, parameterized on the disperser type. These are grouped because they + * only apply when using a grating. That is, all are defined or none or defined in the dynamic + * config. * - * @tparam D disperser type, expected to be `GmosNorthDisperser` or - * `GmosSouthDisperser` + * @tparam D + * disperser type, expected to be `GmosNorthDisperser` or `GmosSouthDisperser` */ final case class GmosGrating[D]( disperser: D, diff --git a/modules/server/src/main/scala/seqexec/server/ConfigUtilOps.scala b/modules/server/src/main/scala/seqexec/server/ConfigUtilOps.scala index 3297eba0ee..8d79c59ec9 100644 --- a/modules/server/src/main/scala/seqexec/server/ConfigUtilOps.scala +++ b/modules/server/src/main/scala/seqexec/server/ConfigUtilOps.scala @@ -28,11 +28,11 @@ object ConfigUtilOps { /** * ExtractFailures are failures that occur when information cannot be extracted correctly. - * 1. KeyNotFound should be used when an expected key is absent. - * 2. ConversionError occurs when the given item was found in the step configuration, but cannot - * be read as the requested type. - * 3. ContentError occurs when there is a logical error in the contents of a step configuration. - * A typical example would be when the value of one item implies the presence of another, which is missing. + * 1. KeyNotFound should be used when an expected key is absent. 2. ConversionError occurs when + * the given item was found in the step configuration, but cannot be read as the requested + * type. 3. ContentError occurs when there is a logical error in the contents of a step + * configuration. A typical example would be when the value of one item implies the presence + * of another, which is missing. */ sealed trait ExtractFailure final case class KeyNotFound(key: ItemKey) extends ExtractFailure diff --git a/modules/server/src/main/scala/seqexec/server/EpicsUtil.scala b/modules/server/src/main/scala/seqexec/server/EpicsUtil.scala index d942745ab2..0b8ae5d8a3 100644 --- a/modules/server/src/main/scala/seqexec/server/EpicsUtil.scala +++ b/modules/server/src/main/scala/seqexec/server/EpicsUtil.scala @@ -279,8 +279,8 @@ object EpicsUtil { Sync[F].delay(Option(get.value)) /** - * Tries to read a value of type A from a channel - * Null results are raised as error and other errors are captured + * Tries to read a value of type A from a channel Null results are raised as error and other + * errors are captured */ def safeAttributeWrapF[F[_]: Sync, A >: Null](channel: String, get: => A): F[A] = Sync[F] @@ -340,30 +340,39 @@ object EpicsUtil { /** * Decides to set a param comparing the current value and the value to be set - * @param c Current value on the system - * @param d Value to be set - * @param f Action to set the parameter + * @param c + * Current value on the system + * @param d + * Value to be set + * @param f + * Action to set the parameter */ def applyParam[F[_], A: Eq](c: A, d: A, f: A => F[Unit]): Option[F[Unit]] = if (c =!= d) f(d).some else none /** - * Test if we should set a value d given that the current value c and - * a given tolerance - * @param t Max relative tolerance allowed between the current and destination value - * @param c Current value on the system - * @param d Value to be set + * Test if we should set a value d given that the current value c and a given tolerance + * @param t + * Max relative tolerance allowed between the current and destination value + * @param c + * Current value on the system + * @param d + * Value to be set */ private def areValuesDifferentEnough(t: Double, c: Double, d: Double): Boolean = !(d === 0.0 && c === 0.0) && (d === 0.0 || abs((c - d) / d) > t) /** - * Decides to set a param comparing the current value and the value to be set with - * a given tolerance - * @param relTolerance Max relative tolerance allowed between the current and destination value - * @param c Current value on the system - * @param d Value to be set - * @param set Action to set the parameter + * Decides to set a param comparing the current value and the value to be set with a given + * tolerance + * @param relTolerance + * Max relative tolerance allowed between the current and destination value + * @param c + * Current value on the system + * @param d + * Value to be set + * @param set + * Action to set the parameter */ def applyParamT[F[_]]( relTolerance: Double @@ -441,7 +450,7 @@ object EpicsUtil { implicit class AddSystemNameToCmdErrorOp[F[_]: MonadError[*[_], Throwable], A](f: F[A]) { def addSystemNameToCmdError(sysName: String): F[A] = f.adaptError { case e: CaCommandError => - new CaCommandError(s"Error from ${sysName}: ${e.getMessage}") + new CaCommandError(s"Error from $sysName: ${e.getMessage}") } } diff --git a/modules/server/src/main/scala/seqexec/server/InstrumentActions.scala b/modules/server/src/main/scala/seqexec/server/InstrumentActions.scala index e203863bb8..4775d7872e 100644 --- a/modules/server/src/main/scala/seqexec/server/InstrumentActions.scala +++ b/modules/server/src/main/scala/seqexec/server/InstrumentActions.scala @@ -16,36 +16,33 @@ import seqexec.model.ActionType import seqexec.model.dhs.ImageFileId /** - * Algebra to generate actions for an observation. - * Most instruments behave the same but in some cases we need to customize - * behavior. The two prime examples are: - * GPI A&C - * GMOS N&S - * In both cases the InstrumentActions for the instrument can provide the correct behavior + * Algebra to generate actions for an observation. Most instruments behave the same but in some + * cases we need to customize behavior. The two prime examples are: GPI A&C GMOS N&S In both cases + * the InstrumentActions for the instrument can provide the correct behavior */ trait InstrumentActions[F[_]] { /** * Produce a progress stream for the given observe - * @param env Properties of the observation + * @param env + * Properties of the observation */ def observationProgressStream( env: ObserveEnvironment[F] ): Stream[F, Result[F]] /** - * Builds a list of actions to run while observing - * In most cases it is just a plain observe but could be skipped or made more complex - * if needed. It should include the progress updates. - * @param env Properties of the observation + * Builds a list of actions to run while observing In most cases it is just a plain observe but + * could be skipped or made more complex if needed. It should include the progress updates. + * @param env + * Properties of the observation */ def observeActions( env: ObserveEnvironment[F] ): List[ParallelActions[F]] /** - * Indicates if we should run the initial observe actions - * e.g. requesting a file Id + * Indicates if we should run the initial observe actions e.g. requesting a file Id */ def runInitialAction(stepType: StepType): Boolean } diff --git a/modules/server/src/main/scala/seqexec/server/ObserveActions.scala b/modules/server/src/main/scala/seqexec/server/ObserveActions.scala index f2c737088a..0fbdc8985d 100644 --- a/modules/server/src/main/scala/seqexec/server/ObserveActions.scala +++ b/modules/server/src/main/scala/seqexec/server/ObserveActions.scala @@ -93,8 +93,8 @@ trait ObserveActions { env.otherSys.traverse_(_.notifyObserveStart) /** - * Tell each subsystem that an observe will end - * Unlike observe start we also tell the instrumetn about it + * Tell each subsystem that an observe will end Unlike observe start we also tell the instrumetn + * about it */ def notifyObserveEnd[F[_]: Applicative](env: ObserveEnvironment[F]): F[Unit] = (env.inst +: env.otherSys).traverse_(_.notifyObserveEnd) @@ -106,8 +106,8 @@ trait ObserveActions { env.inst.keywordsClient.closeImage(id) /** - * Preamble for observations. It tells the odb, the subsystems - * send the start headers and finally sends an observe + * Preamble for observations. It tells the odb, the subsystems send the start headers and finally + * sends an observe */ def observePreamble[F[_]: Concurrent: Logger]( fileId: ImageFileId, @@ -128,9 +128,8 @@ trait ObserveActions { } yield r /** - * End of an observation for a typical instrument - * It tells the odb and each subsystem and also sends the end - * observation keywords + * End of an observation for a typical instrument It tells the odb and each subsystem and also + * sends the end observation keywords */ def okTail[F[_]: Concurrent]( fileId: ImageFileId, diff --git a/modules/server/src/main/scala/seqexec/server/OdbProxy.scala b/modules/server/src/main/scala/seqexec/server/OdbProxy.scala index b17f05c999..fecb56a68c 100644 --- a/modules/server/src/main/scala/seqexec/server/OdbProxy.scala +++ b/modules/server/src/main/scala/seqexec/server/OdbProxy.scala @@ -46,7 +46,7 @@ object OdbProxy { }).widenRethrowT def queuedSequences: F[List[Observation.Id]] = cmds.queuedSequences - def datasetStart(obsId: Observation.Id, dataId: DataId, fileId: ImageFileId): F[Boolean] = + def datasetStart(obsId: Observation.Id, dataId: DataId, fileId: ImageFileId): F[Boolean] = cmds.datasetStart(obsId, dataId, fileId) def datasetComplete(obsId: Observation.Id, dataId: DataId, fileId: ImageFileId): F[Boolean] = cmds.datasetComplete(obsId, dataId, fileId) diff --git a/modules/server/src/main/scala/seqexec/server/SeqTranslate.scala b/modules/server/src/main/scala/seqexec/server/SeqTranslate.scala index d794922175..df1c4a9a91 100644 --- a/modules/server/src/main/scala/seqexec/server/SeqTranslate.scala +++ b/modules/server/src/main/scala/seqexec/server/SeqTranslate.scala @@ -776,7 +776,7 @@ object SeqTranslate { ((_: KeywordsClient[F]) => (_: HeaderExtraData) => List.empty[Header[F]]) .pure[F] // No headers for A&C - case StepType.Gems(_) => + case StepType.Gems(_) => { kwClient: KeywordsClient[F] => ctx: HeaderExtraData => List( commonHeaders(config, allButGaos.toList, kwClient)(ctx), diff --git a/modules/server/src/main/scala/seqexec/server/SeqexecEngine.scala b/modules/server/src/main/scala/seqexec/server/SeqexecEngine.scala index 108f67392e..d89190ed2d 100644 --- a/modules/server/src/main/scala/seqexec/server/SeqexecEngine.scala +++ b/modules/server/src/main/scala/seqexec/server/SeqexecEngine.scala @@ -202,7 +202,7 @@ trait SeqexecEngine[F[_]] { def stopQueue(q: EventQueue[F], qid: QueueId, clientId: ClientId): F[Unit] /** - * Triggers the application of a specific step configuration to a system + * Triggers the application of a specific step configuration to a system */ def configSystem( q: EventQueue[F], @@ -243,7 +243,8 @@ object SeqexecEngine { /** * Check if the resources to run a sequence are available - * @return true if resources are available + * @return + * true if resources are available */ private def checkResources(seqId: Observation.Id)(st: EngineState[F]): Boolean = { // Resources used by running sequences @@ -279,7 +280,8 @@ object SeqexecEngine { /** * Check if the target on the TCS matches the seqexec target - * @return an F that returns an optional TargetMatchResult if the targets don't match + * @return + * an F that returns an optional TargetMatchResult if the targets don't match */ private def sequenceTcsTargetMatch( step: SequenceGen.StepGen[F] @@ -295,8 +297,8 @@ object SeqexecEngine { .getOrElse(none.pure[F]) /** - * Extract the target name from a step configuration. Some processing is necessary to get the same string that - * appears in TCS. + * Extract the target name from a step configuration. Some processing is necessary to get the + * same string that appears in TCS. */ private def extractTargetName(config: CleanConfig): Option[String] = { val BasePositionKey = "Base:name" @@ -626,10 +628,11 @@ object SeqexecEngine { } yield obsseq.seq.status.isRunning).getOrElse(false) Event.modifyState[F, EngineState[F], SeqEvent] { - ((st: EngineState[F]) => { - if (!testRunning(st))(lens.withEvent(AddLoadedSequence(i, sid, user, clientId)))(st) - else (st, NotifyUser(InstrumentInUse(sid, i), clientId)) - }).toHandle + ( + (st: EngineState[F]) => + if (!testRunning(st))(lens.withEvent(AddLoadedSequence(i, sid, user, clientId)))(st) + else (st, NotifyUser(InstrumentInUse(sid, i), clientId)) + ).toHandle } } @@ -1038,13 +1041,13 @@ object SeqexecEngine { .flatMap(runSequences(_, observer, user, clientId)) /** - * runNextsInQueue continues running the queue after a sequence completes. It finds the next eligible sequences in - * the queue, and runs them. - * At any given time a queue can be running, but one of the top eligible sequences are not. That is the case if the - * sequence ended with an error or is stopped by the user. In both cases, the sequence should not be restarted - * without user intervention, nor other sequence that uses the same resources should be started. Because of that, - * runNextsInQueue only runs sequences that are now eligible because of the resources that the just completed - * sequence has freed. + * runNextsInQueue continues running the queue after a sequence completes. It finds the next + * eligible sequences in the queue, and runs them. At any given time a queue can be running, but + * one of the top eligible sequences are not. That is the case if the sequence ended with an + * error or is stopped by the user. In both cases, the sequence should not be restarted without + * user intervention, nor other sequence that uses the same resources should be started. Because + * of that, runNextsInQueue only runs sequences that are now eligible because of the resources + * that the just completed sequence has freed. */ private def runNextsInQueue( qid: QueueId, @@ -1183,7 +1186,7 @@ object SeqexecEngine { } /** - * Triggers the application of a specific step configuration to a system + * Triggers the application of a specific step configuration to a system */ override def configSystem( q: EventQueue[F], @@ -1255,17 +1258,14 @@ object SeqexecEngine { )(st) private def refreshSequence(id: Observation.Id): Endo[EngineState[F]] = (st: EngineState[F]) => - { - st.sequences.get(id).map(obsseq => updateSequenceEndo(id, obsseq)).foldLeft(st) { - case (s, f) => f(s) - } + st.sequences.get(id).map(obsseq => updateSequenceEndo(id, obsseq)).foldLeft(st) { + case (s, f) => f(s) } - private def refreshSequences: Endo[EngineState[F]] = (st: EngineState[F]) => { + private def refreshSequences: Endo[EngineState[F]] = (st: EngineState[F]) => st.sequences.map { case (id, obsseq) => updateSequenceEndo(id, obsseq) }.foldLeft(st) { case (s, f) => f(s) } - } override def setTcsEnabled( q: EventQueue[F], @@ -1366,8 +1366,8 @@ object SeqexecEngine { .toSet /** - * Resource in use = Resources used by running sequences, plus the systems that are being configured because a user - * commanded a manual configuration apply. + * Resource in use = Resources used by running sequences, plus the systems that are being + * configured because a user commanded a manual configuration apply. */ private def resourcesInUse[F[_]](st: EngineState[F]): Set[Resource] = st.sequences.values.toList @@ -1393,8 +1393,8 @@ object SeqexecEngine { } /** - * Creates a stream that will follow a heartbeat and raise an error if the heartbeat - * doesn't get emitted for timeout + * Creates a stream that will follow a heartbeat and raise an error if the heartbeat doesn't get + * emitted for timeout * * Credit: Fabio Labella * https://gitter.im/functional-streams-for-scala/fs2?at=5e0a6efbfd580457e79aaf0a @@ -1425,15 +1425,18 @@ object SeqexecEngine { } /** - * Find the observations in an execution queue that would be run next, taking into account the resources required by - * each observation and the resources currently in use. - * The order in the queue defines the priority of the observations. - * Failed or stopped sequences in the queue keep their instruments taken, preventing that the queue starts other - * sequences for those instruments. - * @param qid The execution queue id - * @param st The current engine state - * @return The set of all observations in the execution queue `qid` that can be started to run - * in parallel. + * Find the observations in an execution queue that would be run next, taking into account the + * resources required by each observation and the resources currently in use. The order in the + * queue defines the priority of the observations. Failed or stopped sequences in the queue keep + * their instruments taken, preventing that the queue starts other sequences for those + * instruments. + * @param qid + * The execution queue id + * @param st + * The current engine state + * @return + * The set of all observations in the execution queue `qid` that can be started to run in + * parallel. */ def findRunnableObservations[F[_]](qid: QueueId)(st: EngineState[F]): Set[Observation.Id] = { // Set of all resources in use @@ -1458,11 +1461,15 @@ object SeqexecEngine { /** * Find next runnable observations given that a set of resources has just being released - * @param qid The execution queue id - * @param st The current engine state - * @param freed Resources that were freed - * @return The set of all observations in the execution queue `qid` that can be started to run - * in parallel. + * @param qid + * The execution queue id + * @param st + * The current engine state + * @param freed + * Resources that were freed + * @return + * The set of all observations in the execution queue `qid` that can be started to run in + * parallel. */ private def nextRunnableObservations[F[_]](qid: QueueId, freed: Set[Resource])( st: EngineState[F] @@ -1500,8 +1507,8 @@ object SeqexecEngine { } /** - * shouldSchedule checks if a set of sequences are candidates for been run in a queue. - * It is used to check if sequences added to a queue should be started. + * shouldSchedule checks if a set of sequences are candidates for been run in a queue. It is used + * to check if sequences added to a queue should be started. */ private def shouldSchedule[F[_]](qid: QueueId, sids: Set[Observation.Id])( st: EngineState[F] diff --git a/modules/server/src/main/scala/seqexec/server/SeqexecMetrics.scala b/modules/server/src/main/scala/seqexec/server/SeqexecMetrics.scala index 20315635af..4f8a3c8c1d 100644 --- a/modules/server/src/main/scala/seqexec/server/SeqexecMetrics.scala +++ b/modules/server/src/main/scala/seqexec/server/SeqexecMetrics.scala @@ -11,7 +11,7 @@ import seqexec.model.enum.Instrument final case class SeqexecMetrics private ( site: Site, - private val qs: Gauge, // Amount of items on the list of queues + private val qs: Gauge, // Amount of items on the list of queues private val ss: Counter // Sequences started ) diff --git a/modules/server/src/main/scala/seqexec/server/SequenceConfiguration.scala b/modules/server/src/main/scala/seqexec/server/SequenceConfiguration.scala index 2fb05ed949..b5462558bc 100644 --- a/modules/server/src/main/scala/seqexec/server/SequenceConfiguration.scala +++ b/modules/server/src/main/scala/seqexec/server/SequenceConfiguration.scala @@ -55,9 +55,8 @@ trait SequenceConfiguration { .getOrElse(StepState.Failed("Logical error reading step status")) /** - * Attempts to extract the Wavelength from the sequence. - * The value is not always present thus we can get a None - * Also errors reading the value are possible thus we produce an Either + * Attempts to extract the Wavelength from the sequence. The value is not always present thus we + * can get a None Also errors reading the value are possible thus we produce an Either */ def extractWavelength(config: CleanConfig): Either[SeqexecFailure, Option[Wavelength]] = if (!config.containsKey(OBSERVING_WAVELENGTH_KEY)) diff --git a/modules/server/src/main/scala/seqexec/server/StepsView.scala b/modules/server/src/main/scala/seqexec/server/StepsView.scala index 3fad588dfa..c13844ae1d 100644 --- a/modules/server/src/main/scala/seqexec/server/StepsView.scala +++ b/modules/server/src/main/scala/seqexec/server/StepsView.scala @@ -24,8 +24,8 @@ import seqexec.server.gmos.GmosStepsView trait StepsView[F[_]] { /** - * This method creates a view of the step for the client - * The Step returned maybe a StandardStep of be specialized e.g. for N&S + * This method creates a view of the step for the client The Step returned maybe a StandardStep of + * be specialized e.g. for N&S */ def stepView( stepg: SequenceGen.StepGen[F], diff --git a/modules/server/src/main/scala/seqexec/server/altair/AltairControllerEpics.scala b/modules/server/src/main/scala/seqexec/server/altair/AltairControllerEpics.scala index 86e7ceec1f..0c5196d94a 100644 --- a/modules/server/src/main/scala/seqexec/server/altair/AltairControllerEpics.scala +++ b/modules/server/src/main/scala/seqexec/server/altair/AltairControllerEpics.scala @@ -282,7 +282,7 @@ object AltairControllerEpics { .filter(_ => strap || sfo) .map(_.bimap(ttgsOffEndo, ttgsOff(currCfg) *> _)) - private def resumeLgsMode(strap: Boolean, sfo: Boolean, starPos: (Length, Length))( + private def resumeLgsMode(strap: Boolean, sfo: Boolean, starPos: (Length, Length))( currCfg: EpicsAltairConfig )(reasons: ResumeConditionSet): Option[F[Unit]] = resumeNgsOrLgsMode(starPos, currCfg)(reasons) @@ -290,7 +290,8 @@ object AltairControllerEpics { .map(_ *> ttgsOn(strap, sfo, currCfg)) /** - * Modes LgsWithP1 and LgsWithOi don't use an Altair target. The only action required is to start or stop corrections + * Modes LgsWithP1 and LgsWithOi don't use an Altair target. The only action required is to + * start or stop corrections */ private def pauseResumeLgsWithXX( currCfg: EpicsAltairConfig diff --git a/modules/server/src/main/scala/seqexec/server/gcal/GcalEpics.scala b/modules/server/src/main/scala/seqexec/server/gcal/GcalEpics.scala index 283c612750..587c95b1a0 100644 --- a/modules/server/src/main/scala/seqexec/server/gcal/GcalEpics.scala +++ b/modules/server/src/main/scala/seqexec/server/gcal/GcalEpics.scala @@ -103,9 +103,9 @@ class GcalEpics[F[_]: Async](epicsService: CaService, tops: Map[String, String]) def createLampAttribute(name: String, longName: String): CaAttribute[BinaryOnOff] = state.addEnum[BinaryOnOff]( name + "LampState", - s"${GcalTop}${name}_LampState", + s"$GcalTop${name}_LampState", classOf[BinaryOnOff], - s"${longName} lamp state" + s"$longName lamp state" ) val lampArAttr: CaAttribute[BinaryOnOff] = createLampAttribute("Ar", "Argon") diff --git a/modules/server/src/main/scala/seqexec/server/gmos/GmosControllerEpics.scala b/modules/server/src/main/scala/seqexec/server/gmos/GmosControllerEpics.scala index 578fe00e04..d6df7a5a4e 100644 --- a/modules/server/src/main/scala/seqexec/server/gmos/GmosControllerEpics.scala +++ b/modules/server/src/main/scala/seqexec/server/gmos/GmosControllerEpics.scala @@ -335,7 +335,7 @@ object GmosControllerEpics extends GmosEncoders { //TODO Improve data model to remove this case. It is here because search includes types of // both sites. - case _ => List.empty + case _ => List.empty } //If disperser, order or wavelength are set, force mode configuration. If not, check if it needs to be set anyways diff --git a/modules/server/src/main/scala/seqexec/server/gmos/GmosInstrumentActions.scala b/modules/server/src/main/scala/seqexec/server/gmos/GmosInstrumentActions.scala index 857c39e384..217bceb4f8 100644 --- a/modules/server/src/main/scala/seqexec/server/gmos/GmosInstrumentActions.scala +++ b/modules/server/src/main/scala/seqexec/server/gmos/GmosInstrumentActions.scala @@ -143,7 +143,7 @@ class GmosInstrumentActions[ .flatMap(observeTail(fileId, env, nsCfg)) // We reach here only if the result was Paused and no command made it stop/pause/abort - case _ => Result.Partial(NSContinue).pure[F].widen[Result[F]] + case _ => Result.Partial(NSContinue).pure[F].widen[Result[F]] } diff --git a/modules/server/src/main/scala/seqexec/server/gpi/GpiStatusApply.scala b/modules/server/src/main/scala/seqexec/server/gpi/GpiStatusApply.scala index a87c458d14..4fade45596 100644 --- a/modules/server/src/main/scala/seqexec/server/gpi/GpiStatusApply.scala +++ b/modules/server/src/main/scala/seqexec/server/gpi/GpiStatusApply.scala @@ -46,10 +46,8 @@ object GpiStatusApply extends GpiLookupTables { foldConfigM(allGpiApply, db, config) /** - * ObsMode needs a special treatment. It is a meta model thus it sets - * the filter, fpm, apodizer and lyot - * We need to check that each subsystem matches or we will - * falsely not set the obs mode + * ObsMode needs a special treatment. It is a meta model thus it sets the filter, fpm, apodizer + * and lyot We need to check that each subsystem matches or we will falsely not set the obs mode */ def overrideObsMode[F[_]: Monad]( db: GiapiStatusDb[F], diff --git a/modules/server/src/main/scala/seqexec/server/gws/GwsEpics.scala b/modules/server/src/main/scala/seqexec/server/gws/GwsEpics.scala index 36d5bee94b..d249216804 100644 --- a/modules/server/src/main/scala/seqexec/server/gws/GwsEpics.scala +++ b/modules/server/src/main/scala/seqexec/server/gws/GwsEpics.scala @@ -21,8 +21,8 @@ import squants.space.Degrees import squants.thermal.Celsius /** - * GwsEpics wraps the non-functional parts of the EPICS ACM library to interact with the Weather Server. - * It has all the objects used to read TCS status values and execute TCS commands. + * GwsEpics wraps the non-functional parts of the EPICS ACM library to interact with the Weather + * Server. It has all the objects used to read TCS status values and execute TCS commands. */ final class GwsEpics[F[_]: Sync] private (epicsService: CaService) { private val state = epicsService.getStatusAcceptor("gws::state") diff --git a/modules/server/src/main/scala/seqexec/server/keywords/DhsClientDisabled.scala b/modules/server/src/main/scala/seqexec/server/keywords/DhsClientDisabled.scala index cf74e12b80..62dd38fea2 100644 --- a/modules/server/src/main/scala/seqexec/server/keywords/DhsClientDisabled.scala +++ b/modules/server/src/main/scala/seqexec/server/keywords/DhsClientDisabled.scala @@ -21,7 +21,7 @@ class DhsClientDisabled[F[_]: Sync: Logger] extends DhsClient[F] { _ <- overrideLogMessage("DHS", "setKeywords") date <- Sync[F].delay(LocalDate.now) time <- Sync[F].delay(System.currentTimeMillis % 1000) - } yield toImageFileId(f"S${date.format(format)}S${time}%04d") + } yield toImageFileId(f"S${date.format(format)}S$time%04d") override def setKeywords(id: ImageFileId, keywords: KeywordBag, finalFlag: Boolean): F[Unit] = overrideLogMessage("DHS", "setKeywords") diff --git a/modules/server/src/main/scala/seqexec/server/keywords/DhsClientHttp.scala b/modules/server/src/main/scala/seqexec/server/keywords/DhsClientHttp.scala index 9b553053ce..26d5a73738 100644 --- a/modules/server/src/main/scala/seqexec/server/keywords/DhsClientHttp.scala +++ b/modules/server/src/main/scala/seqexec/server/keywords/DhsClientHttp.scala @@ -79,7 +79,7 @@ class DhsClientHttp[F[_]: Concurrent](base: Client[F], baseURI: Uri)(implicit ti Json.obj( "setKeywords" := Json.obj( - "final" := finalFlag, + "final" := finalFlag, "keywords" := keywords.keywords ) ), @@ -155,7 +155,7 @@ object DhsClientHttp { implicit def imageParametersEncode: Encoder[DhsClient.ImageParameters] = Encoder.instance[DhsClient.ImageParameters](p => Json.obj( - "lifetime" := p.lifetime.str, + "lifetime" := p.lifetime.str, "contributors" := p.contributors ) ) @@ -163,8 +163,8 @@ object DhsClientHttp { implicit def keywordEncode: Encoder[InternalKeyword] = Encoder.instance[InternalKeyword](k => Json.obj( - "name" := DhsKeywordName.all.find(_.keyword === k.name).map(_.name).getOrElse(k.name.name), - "type" := KeywordType.dhsKeywordType(k.keywordType), + "name" := DhsKeywordName.all.find(_.keyword === k.name).map(_.name).getOrElse(k.name.name), + "type" := KeywordType.dhsKeywordType(k.keywordType), "value" := k.value ) ) @@ -187,7 +187,7 @@ private class DhsClientSim[F[_]: FlatMap: Logger](date: LocalDate, counter: Ref[ override def createImage(p: ImageParameters): F[ImageFileId] = counter.modify(x => (x + 1, x + 1)).map { c => - toImageFileId(f"S${date.format(format)}S${c}%04d") + toImageFileId(f"S${date.format(format)}S$c%04d") } override def setKeywords(id: ImageFileId, keywords: KeywordBag, finalFlag: Boolean): F[Unit] = { diff --git a/modules/server/src/main/scala/seqexec/server/keywords/package.scala b/modules/server/src/main/scala/seqexec/server/keywords/package.scala index 67facb1137..610db7d05b 100644 --- a/modules/server/src/main/scala/seqexec/server/keywords/package.scala +++ b/modules/server/src/main/scala/seqexec/server/keywords/package.scala @@ -222,7 +222,8 @@ package keywords { } /** - * @typeclass Functor + * @typeclass + * Functor */ implicit val dhvFunctor: Functor[DefaultHeaderValue] = new Functor[DefaultHeaderValue] { diff --git a/modules/server/src/main/scala/seqexec/server/niri/NiriControllerEpics.scala b/modules/server/src/main/scala/seqexec/server/niri/NiriControllerEpics.scala index 2e4d939240..0ed4f23927 100644 --- a/modules/server/src/main/scala/seqexec/server/niri/NiriControllerEpics.scala +++ b/modules/server/src/main/scala/seqexec/server/niri/NiriControllerEpics.scala @@ -148,9 +148,9 @@ object NiriControllerEpics extends NiriEncoders { new NiriController[F] { /** - * The instrument has three filter wheels with a status channel for each one. But it does not have - * a status channel for the virtual filter, so I have to calculate it. The assumption is that only - * one wheel can be in a not open position at a given time. + * The instrument has three filter wheels with a status channel for each one. But it does not + * have a status channel for the virtual filter, so I have to calculate it. The assumption is + * that only one wheel can be in a not open position at a given time. */ private def currentFilter: F[Option[String]] = { val filter1 = epicsSys.filter1 diff --git a/modules/server/src/main/scala/seqexec/server/package.scala b/modules/server/src/main/scala/seqexec/server/package.scala index 10438e1219..eaaea5b4e5 100644 --- a/modules/server/src/main/scala/seqexec/server/package.scala +++ b/modules/server/src/main/scala/seqexec/server/package.scala @@ -163,7 +163,7 @@ package object server { } } - def addSeq(sid: Observation.Id): ExecutionQueue = q.copy(queue = q.queue :+ sid) + def addSeq(sid: Observation.Id): ExecutionQueue = q.copy(queue = q.queue :+ sid) def addSeqs(sids: List[Observation.Id]): ExecutionQueue = q.copy(queue = q.queue ++ sids) def removeSeq(sid: Observation.Id): ExecutionQueue = q.copy(queue = q.queue.filter(_ =!= sid)) def moveSeq(sid: Observation.Id, delta: Int): ExecutionQueue = diff --git a/modules/server/src/main/scala/seqexec/server/tcs/Gaos.scala b/modules/server/src/main/scala/seqexec/server/tcs/Gaos.scala index f985509da0..e2652e2bc7 100644 --- a/modules/server/src/main/scala/seqexec/server/tcs/Gaos.scala +++ b/modules/server/src/main/scala/seqexec/server/tcs/Gaos.scala @@ -164,7 +164,7 @@ object Gaos { sealed case class PauseResume[F[_]]( pause: Option[F[Unit]], // None means Gaos will not be paused - resume: Option[F[Unit]] // None means Gaos will not be resumed + resume: Option[F[Unit]] // None means Gaos will not be resumed ) } diff --git a/modules/server/src/main/scala/seqexec/server/tcs/TcsControllerEpicsCommon.scala b/modules/server/src/main/scala/seqexec/server/tcs/TcsControllerEpicsCommon.scala index 7f8159fcb1..52153bf4df 100644 --- a/modules/server/src/main/scala/seqexec/server/tcs/TcsControllerEpicsCommon.scala +++ b/modules/server/src/main/scala/seqexec/server/tcs/TcsControllerEpicsCommon.scala @@ -34,8 +34,8 @@ import squants.space.LengthConversions._ import squants.time.TimeConversions._ /** - * Base implementation of an Epics TcsController - * Type parameter BaseEpicsTcsConfig is the class used to hold the current configuration + * Base implementation of an Epics TcsController Type parameter BaseEpicsTcsConfig is the class used + * to hold the current configuration */ sealed trait TcsControllerEpicsCommon[F[_]] { @@ -435,8 +435,9 @@ object TcsControllerEpicsCommon { } /** - * Positions Parked and OUT are equivalent for practical purposes. Therefore, if the current position is Parked and - * requested position is OUT (or the other way around), then it is not necessary to move the HR pickup mirror. + * Positions Parked and OUT are equivalent for practical purposes. Therefore, if the current + * position is Parked and requested position is OUT (or the other way around), then it is not + * necessary to move the HR pickup mirror. */ override def setHrPickup[C](l: Lens[C, BaseEpicsTcsConfig])( subsystems: NonEmptySet[Subsystem], diff --git a/modules/server/src/main/scala/seqexec/server/tcs/TcsEpics.scala b/modules/server/src/main/scala/seqexec/server/tcs/TcsEpics.scala index d78ab5072c..e88b2d37cf 100644 --- a/modules/server/src/main/scala/seqexec/server/tcs/TcsEpics.scala +++ b/modules/server/src/main/scala/seqexec/server/tcs/TcsEpics.scala @@ -30,8 +30,8 @@ import squants.Angle import squants.space.Degrees /** - * TcsEpics wraps the non-functional parts of the EPICS ACM library to interact with TCS. It has all the objects used - * to read TCS status values and execute TCS commands. + * TcsEpics wraps the non-functional parts of the EPICS ACM library to interact with TCS. It has all + * the objects used to read TCS status values and execute TCS commands. * * Created by jluhrs on 10/1/15. */ diff --git a/modules/web/client/src/main/scala/seqexec/web/client/SeqexecApp.scala b/modules/web/client/src/main/scala/seqexec/web/client/SeqexecApp.scala index 0e54fc1bc4..047a5ab12a 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/SeqexecApp.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/SeqexecApp.scala @@ -54,8 +54,7 @@ final class SeqexecLauncher[F[_]](implicit val F: Sync[F], L: LiftIO[F]) { } /** - * Seqexec WebApp entry point - * Exposed to the js world + * Seqexec WebApp entry point Exposed to the js world */ @JSExportTopLevel("SeqexecApp") object SeqexecApp extends IOApp { diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/LoginBox.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/LoginBox.scala index e26ff81818..bd64eba645 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/LoginBox.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/LoginBox.scala @@ -142,7 +142,7 @@ object LoginBox { action = "#", onSubmitE = attemptLogin )( - ^.id := formId, + ^.id := formId, ^.method := "post" ) ), @@ -158,13 +158,13 @@ object LoginBox { <.div( ^.cls := "ui icon input", <.input( - ^.`type` := "text", + ^.`type` := "text", ^.placeholder := "Username", - ^.name := "username", - ^.id := "username", - ^.value := s.username, + ^.name := "username", + ^.id := "username", + ^.value := s.username, ^.onChange ==> userMod, - ^.autoFocus := true + ^.autoFocus := true ), IconUser ) @@ -175,11 +175,11 @@ object LoginBox { <.div( ^.cls := "ui icon input", <.input( - ^.`type` := "password", + ^.`type` := "password", ^.placeholder := "Password", - ^.name := "password", - ^.id := "password", - ^.value := s.password, + ^.name := "password", + ^.id := "password", + ^.value := s.password, ^.onChange ==> pwdMod ), IconLock diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/SessionQueueTable.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/SessionQueueTable.scala index e197dc7599..94a1e190d3 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/SessionQueueTable.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/SessionQueueTable.scala @@ -376,7 +376,7 @@ object SessionQueueTable extends Columns { private def linkTo(p: Props, page: SeqexecPages)(mod: TagMod*) = <.a( - ^.href := p.ctl.urlFor(page).value, + ^.href := p.ctl.urlFor(page).value, ^.onClick ==> { _.preventDefaultCB }, ^.draggable := false, mod.toTagMod @@ -392,9 +392,8 @@ object SessionQueueTable extends Columns { private def linkedTextRenderer(p: Props)( f: SessionQueueRow => String ): CellRenderer[js.Object, js.Object, SessionQueueRow] = - (_, _, _, row: SessionQueueRow, _) => { + (_, _, _, row: SessionQueueRow, _) => linkTo(p, pageOf(row))(SeqexecStyles.queueTextColumn, <.p(SeqexecStyles.queueText, f(row))) - } private def statusIconRenderer( b: Backend @@ -653,7 +652,7 @@ object SessionQueueTable extends Columns { disableHeader = false, noRowsRenderer = () => <.div( - ^.cls := "ui center aligned segment noRows", + ^.cls := "ui center aligned segment noRows", SeqexecStyles.noRowsSegment, ^.height := 180.px, "Session queue empty" @@ -698,19 +697,18 @@ object SessionQueueTable extends Columns { _: Option[OnRowClick], _: Option[OnRowClick], style: Style - ) => { + ) => <.div( - ^.cls := className, + ^.cls := className, ^.draggable := b.props.canOperate, - ^.key := key, - ^.role := "row", + ^.key := key, + ^.role := "row", ^.onDragStart ==> dragStart(b, rowData.obsId), - ^.style := style.toJsObject, + ^.style := style.toJsObject, ^.onClick -->? onRowClick.map(h => h(index)), ^.onDoubleClick -->? onRowDoubleClick.map(h => h(index)), columns.toTagMod ): VdomElement - } private def initialState(p: Props): State = ( diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/queue/CalQueueTable.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/queue/CalQueueTable.scala index 6d5c33c342..caf371c2e9 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/queue/CalQueueTable.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/queue/CalQueueTable.scala @@ -234,14 +234,12 @@ object CalQueueTable { Reusability.by(x => (x.tableState, x.moved)) val obsIdRenderer: CellRenderer[js.Object, js.Object, CalQueueRow] = - (_, _, _, r: CalQueueRow, _) => { + (_, _, _, r: CalQueueRow, _) => <.p(SeqexecStyles.queueText |+| SeqexecStyles.noselect, r.obsId.format) - } val instrumentRenderer: CellRenderer[js.Object, js.Object, CalQueueRow] = - (_, _, _, r: CalQueueRow, _) => { + (_, _, _, r: CalQueueRow, _) => <.p(SeqexecStyles.queueText |+| SeqexecStyles.noselect, r.instrument.show) - } private def removeSeq(qid: QueueId, sid: Observation.Id): Callback = SeqexecCircuit.dispatchCB(RequestRemoveSeqCal(qid, sid)) @@ -384,7 +382,7 @@ object CalQueueTable { disableHeader = false, noRowsRenderer = () => <.div( - ^.cls := "ui center aligned segment noRows", + ^.cls := "ui center aligned segment noRows", SeqexecStyles.noRowsSegment, ^.height := size.height.toInt.px, "Cal queue empty" diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepConfigTable.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepConfigTable.scala index b8f4813b43..3d9115b08a 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepConfigTable.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepConfigTable.scala @@ -166,7 +166,7 @@ object StepConfigTable { disableHeader = false, noRowsRenderer = () => <.div( - ^.cls := "ui center aligned segment noRows", + ^.cls := "ui center aligned segment noRows", ^.height := size.height.toInt.px, "No configuration for step" ), diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepSettings.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepSettings.scala index c933cdebfa..1bed0317ca 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepSettings.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepSettings.scala @@ -72,7 +72,7 @@ object ExposureTimeCell { <.span(^.display := "inline-block", ^.marginLeft := 5.px, "["), <.span(^.display := "inline-block", ^.verticalAlign := "none", - ^.fontStyle := "italic", + ^.fontStyle := "italic", "s" ), <.span(^.display := "inline-block", "]") diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepsTable.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepsTable.scala index 7e3851d915..e74d1b21c6 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepsTable.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/sequence/steps/StepsTable.scala @@ -485,7 +485,7 @@ object StepsTable extends Columns { prevSequenceState: Option[SequenceState], prevRunning: Option[RunningStep], prevResourceRunRequested: SortedMap[Resource, ResourceRunOperation], - recomputeFrom: Option[Int], // Min row to recompute heights from + recomputeFrom: Option[Int], // Min row to recompute heights from runNewStep: Option[(StepId, Boolean)] // (New running step, scroll to it?) ) { @@ -540,7 +540,7 @@ object StepsTable extends Columns { def stepControlRenderer( f: StepsTableFocus, - $ : Scope, + $ : Scope, rowBreakpointHoverOnCB: Int => Callback, rowBreakpointHoverOffCB: Int => Callback, recomputeHeightsCB: Int => Callback @@ -571,7 +571,7 @@ object StepsTable extends Columns { SettingsCell(p.router, f.instrument, f.id, row.step.id, p.isPreview) def stepProgressRenderer( - f: StepsTableFocus, + f: StepsTableFocus, $ : Scope ): CellRenderer[js.Object, js.Object, StepRow] = (_, _, _, row: StepRow, _) => @@ -738,7 +738,7 @@ object StepsTable extends Columns { private def columnCellRenderer( $ : Scope, - c: TableColumn + c: TableColumn ): CellRenderer[js.Object, js.Object, StepRow] = { val optR = c match { case ControlColumn => @@ -771,7 +771,7 @@ object StepsTable extends Columns { // Columns for the table private def colBuilder( - $ : Scope, + $ : Scope, size: Size ): ColumnRenderArgs[TableColumn] => Table.ColumnArg = tb => { @@ -875,7 +875,7 @@ object StepsTable extends Columns { disableHeader = false, noRowsRenderer = () => <.div( - ^.cls := "ui center aligned segment noRows", + ^.cls := "ui center aligned segment noRows", ^.height := size.height.toInt.px, "No Steps" ), @@ -933,17 +933,17 @@ object StepsTable extends Columns { _: Option[OnRowClick], _: Option[OnRowClick], style: Style - ) => { + ) => p.rowGetter(index) match { case StepRow(s) if p.showRowDetails(s, selected) && index === s.id => <.div( - ^.key := key, + ^.key := key, ^.style := Style.toJsObject(style), SeqexecStyles.expandedRunningRow, SeqexecStyles.stepRow, <.div( - ^.cls := className, - ^.key := s"$key-top", + ^.cls := className, + ^.key := s"$key-top", SeqexecStyles.expandedTopRow, ^.height := SeqexecStyles.runningRowHeight.px, ^.onMouseDown ==> allowedClick(p, index, onRowClick), @@ -961,7 +961,7 @@ object StepsTable extends Columns { rowComponents.zipWithIndex.toTagMod { case (rowComponent, rowIdx) => <.div( - ^.key := s"$key-subRow-$rowIdx", + ^.key := s"$key-subRow-$rowIdx", SeqexecStyles.expandedBottomRow, SeqexecStyles.tableDetailRow, SeqexecStyles.tableDetailRowWithGutter @@ -977,16 +977,15 @@ object StepsTable extends Columns { ) case _ => <.div( - ^.cls := className, - ^.key := key, - ^.role := "row", + ^.cls := className, + ^.key := key, + ^.role := "row", ^.style := Style.toJsObject(style), ^.onMouseDown ==> allowedClick(p, index, onRowClick), ^.onDoubleClick -->? onRowDoubleClick.map(h => h(index)), columns.toTagMod ) } - } // Create a ref private val ref = Ref.toJsComponent(Table.component) diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/CalibrationQueueTab.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/CalibrationQueueTab.scala index 9e3cd9db1d..139c73aa09 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/CalibrationQueueTab.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/CalibrationQueueTab.scala @@ -77,9 +77,9 @@ object CalibrationQueueTab { val active = p.tab.active <.a( - ^.href := p.router.urlFor(page).value, + ^.href := p.router.urlFor(page).value, ^.onClick ==> showCalibrationQueue(p, page), - ^.cls := "item", + ^.cls := "item", ^.classSet( "active" -> (active === TabSelected.Selected) ), diff --git a/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/SequenceTab.scala b/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/SequenceTab.scala index cd5b5baebd..c3a1ca172a 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/SequenceTab.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/components/tabs/SequenceTab.scala @@ -85,9 +85,9 @@ object SequenceTab { val hasError = p.tab.status.isError <.a( - ^.href := p.router.urlFor(page).value, + ^.href := p.router.urlFor(page).value, ^.onClick ==> showSequence(p, page), - ^.cls := "item", + ^.cls := "item", ^.classSet( "active" -> (active === TabSelected.Selected) ), diff --git a/modules/web/client/src/main/scala/seqexec/web/client/handlers/InitialSyncHandler.scala b/modules/web/client/src/main/scala/seqexec/web/client/handlers/InitialSyncHandler.scala index 6d1b9f1228..20783e9b4a 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/handlers/InitialSyncHandler.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/handlers/InitialSyncHandler.scala @@ -20,9 +20,8 @@ import seqexec.web.client.circuit._ import seqexec.web.client.model.Pages._ /** - * This handler is called only once. It will be triggered when the first message - * with the full model arrives. - * Then we sync to the first running sequence or to the route we are currently on + * This handler is called only once. It will be triggered when the first message with the full model + * arrives. Then we sync to the first running sequence or to the route we are currently on */ class InitialSyncHandler[M](modelRW: ModelRW[M, InitialSyncFocus]) extends ActionHandler(modelRW) diff --git a/modules/web/client/src/main/scala/seqexec/web/client/handlers/ObservationsProgressStateHandler.scala b/modules/web/client/src/main/scala/seqexec/web/client/handlers/ObservationsProgressStateHandler.scala index 444a3dd9fd..7b163c8bba 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/handlers/ObservationsProgressStateHandler.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/handlers/ObservationsProgressStateHandler.scala @@ -109,7 +109,7 @@ class ObservationsProgressStateHandler[M](modelRW: ModelRW[M, AllObservationsPro resetStepProgress(e, obsId) // Remove the progress once the step completes - case ServerMessage(e @ StepExecuted(obsId, _)) => + case ServerMessage(e @ StepExecuted(obsId, _)) => resetStepProgress( e, obsId, diff --git a/modules/web/client/src/main/scala/seqexec/web/client/handlers/TableStateHandler.scala b/modules/web/client/src/main/scala/seqexec/web/client/handlers/TableStateHandler.scala index de5faa8914..9d5cd9622b 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/handlers/TableStateHandler.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/handlers/TableStateHandler.scala @@ -16,7 +16,7 @@ class TableStateHandler[M](modelRW: ModelRW[M, AppTableStates]) extends ActionHandler(modelRW) with Handlers[M, AppTableStates] { override def handle: PartialFunction[Any, ActionResult[M]] = { - case UpdateStepsConfigTableState(state) => + case UpdateStepsConfigTableState(state) => updatedSilentL( AppTableStates.stepConfigTable.set(state) ) // We should only do silent updates as these change too quickly @@ -26,12 +26,12 @@ class TableStateHandler[M](modelRW: ModelRW[M, AppTableStates]) AppTableStates.sessionQueueTable.set(state) ) // We should only do silent updates as these change too quickly - case UpdateStepTableState(id, state) => + case UpdateStepTableState(id, state) => updatedSilentL( AppTableStates.stepsTableAtL(id).set(Some(state)) ) // We should only do silent updates as these change too quickly - case UpdateCalTableState(id, state) => + case UpdateCalTableState(id, state) => updatedSilentL( AppTableStates.queueTableAtL(id).set(Some(state)) ) // We should only do silent updates as these change too quickly diff --git a/modules/web/client/src/main/scala/seqexec/web/client/model/ClientStatus.scala b/modules/web/client/src/main/scala/seqexec/web/client/model/ClientStatus.scala index 4e67541ad6..d8ee3b9c78 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/model/ClientStatus.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/model/ClientStatus.scala @@ -9,7 +9,8 @@ import monocle.Lens import seqexec.model.UserDetails /** - * Utility class to let components more easily switch parts of the UI depending on the user and connection state + * Utility class to let components more easily switch parts of the UI depending on the user and + * connection state */ final case class ClientStatus(u: Option[UserDetails], w: WebSocketConnection) { def isLogged: Boolean = u.isDefined diff --git a/modules/web/client/src/main/scala/seqexec/web/client/model/ModelOps.scala b/modules/web/client/src/main/scala/seqexec/web/client/model/ModelOps.scala index 237a960eb7..aa7722225d 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/model/ModelOps.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/model/ModelOps.scala @@ -74,13 +74,13 @@ object ModelOps { s.steps match { case x if x.forall(s => s.status === StepState.Pending && !s.skip) => Some(0) // No steps have been executed, start at 0 - case x if x.forall(_.isFinished) => None // All steps have been executed - case x if x.exists(_.hasError) => + case x if x.forall(_.isFinished) => None // All steps have been executed + case x if x.exists(_.hasError) => Option(x.indexWhere((s: Step) => s.hasError)).filter(_ =!= -1) - case x if x.exists(s => s.status === StepState.Paused && !s.skip) => + case x if x.exists(s => s.status === StepState.Paused && !s.skip) => Option(x.indexWhere((s: Step) => s.status === StepState.Paused)) .filter(_ =!= -1) - case x => + case x => Option(x.indexWhere((s: Step) => !s.isFinished && !s.skip)) .filter(_ =!= -1) } diff --git a/modules/web/client/src/main/scala/seqexec/web/client/model/Pages.scala b/modules/web/client/src/main/scala/seqexec/web/client/model/Pages.scala index 92e60d50ae..82f69cde5c 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/model/Pages.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/model/Pages.scala @@ -92,15 +92,14 @@ object Pages { implicit class RouterCtlOps(val r: RouterCtl[SeqexecPages]) extends AnyVal { /** - * Some pages are linked to actions. This methods lets you set the url - * and dispatch an action at the same time + * Some pages are linked to actions. This methods lets you set the url and dispatch an action at + * the same time */ def setUrlAndDispatchCB(b: SeqexecPages): Callback = r.set(b) *> SeqexecCircuit.dispatchCB(PageActionP.reverseGet(b)) /** - * Some actions are linked to a page. This methods lets you dispatch and action - * and set the url + * Some actions are linked to a page. This methods lets you dispatch and action and set the url */ def dispatchAndSetUrlCB(b: Action): Callback = PageActionP.getOption(b).map(r.set).getOrEmpty *> diff --git a/modules/web/client/src/main/scala/seqexec/web/client/model/SequencesOnDisplay.scala b/modules/web/client/src/main/scala/seqexec/web/client/model/SequencesOnDisplay.scala index a57f8133fc..103f031984 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/model/SequencesOnDisplay.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/model/SequencesOnDisplay.scala @@ -397,7 +397,8 @@ final case class SequencesOnDisplay(tabs: Zipper[SeqexecTab]) { } /** - * Contains the sequences displayed on the instrument tabs. Note that they are references to sequences on the Queue + * Contains the sequences displayed on the instrument tabs. Note that they are references to + * sequences on the Queue */ object SequencesOnDisplay { // We need to initialize the model with something so we use preview diff --git a/modules/web/client/src/main/scala/seqexec/web/client/services/SeqexecWebClient.scala b/modules/web/client/src/main/scala/seqexec/web/client/services/SeqexecWebClient.scala index f40a0c3912..5ac5b9cc37 100644 --- a/modules/web/client/src/main/scala/seqexec/web/client/services/SeqexecWebClient.scala +++ b/modules/web/client/src/main/scala/seqexec/web/client/services/SeqexecWebClient.scala @@ -61,7 +61,7 @@ object SeqexecWebClient extends ModelBooPicklers { def toggle(id: Observation.Id, enabled: Boolean, section: String): Future[Unit] = Ajax .post( - url = s"$baseUrl/commands/${encodeURI(id.format)}/${section}/$enabled" + url = s"$baseUrl/commands/${encodeURI(id.format)}/$section/$enabled" ) .void diff --git a/modules/web/client/src/main/scala/web/client/table/ColumnWidth.scala b/modules/web/client/src/main/scala/web/client/table/ColumnWidth.scala index 33291c1d2c..20dafbe242 100644 --- a/modules/web/client/src/main/scala/web/client/table/ColumnWidth.scala +++ b/modules/web/client/src/main/scala/web/client/table/ColumnWidth.scala @@ -19,7 +19,7 @@ sealed abstract class VariableColumnWidth(val percentage: Double, val minWidth: assert(percentage > 0 && percentage <= 1) assert(minWidth >= 0) override def toString: String = - s"Variable(${percentage}%, ${minWidth}px)" + s"Variable($percentage%, ${minWidth}px)" } object ColumnWidth { diff --git a/modules/web/client/src/main/scala/web/client/table/package.scala b/modules/web/client/src/main/scala/web/client/table/package.scala index 4cfc27cf21..0f7db53ddc 100644 --- a/modules/web/client/src/main/scala/web/client/table/package.scala +++ b/modules/web/client/src/main/scala/web/client/table/package.scala @@ -113,8 +113,8 @@ package object table { colWidthsO[A, B, G](items, cols, get.view.mapValues(f => (a: A) => f(a).some).toMap, minW, adj) /** - * This methods traverses a whole set of data to find the widest value per - * column, trying to traverse it in one pass + * This methods traverses a whole set of data to find the widest value per column, trying to + * traverse it in one pass */ def colWidthsO[A, B, G[_]: Foldable]( items: G[A], diff --git a/modules/web/server/src/main/scala/scala/web/server/common/LogInitialization.scala b/modules/web/server/src/main/scala/scala/web/server/common/LogInitialization.scala index b0d0bff089..43ef781b0f 100644 --- a/modules/web/server/src/main/scala/scala/web/server/common/LogInitialization.scala +++ b/modules/web/server/src/main/scala/scala/web/server/common/LogInitialization.scala @@ -16,8 +16,8 @@ import org.slf4j.bridge.SLF4JBridgeHandler trait AppBaseDir { /** - * Calculates the base dir of the application based on the location of "this" class jar file - * It will throw an exception if unable to find the base dir + * Calculates the base dir of the application based on the location of "this" class jar file It + * will throw an exception if unable to find the base dir */ def baseDir[F[_]: Sync]: F[Path] = Sync[F].delay { val clazz = this.getClass diff --git a/modules/web/server/src/main/scala/seqexec/web/server/http4s/SeqexecCommandRoutes.scala b/modules/web/server/src/main/scala/seqexec/web/server/http4s/SeqexecCommandRoutes.scala index b9a22c69e0..51252bd234 100644 --- a/modules/web/server/src/main/scala/seqexec/web/server/http4s/SeqexecCommandRoutes.scala +++ b/modules/web/server/src/main/scala/seqexec/web/server/http4s/SeqexecCommandRoutes.scala @@ -109,19 +109,19 @@ class SeqexecCommandRoutes[F[_]: Sync]( case POST -> Root / ObsIdVar(obsId) / "tcsEnabled" / BooleanVar(tcsEnabled) as user => se.setTcsEnabled(inputQueue, obsId, user, tcsEnabled) *> - Ok(s"Set TCS enable flag to '${tcsEnabled}' for sequence ${obsId.format}") + Ok(s"Set TCS enable flag to '$tcsEnabled' for sequence ${obsId.format}") case POST -> Root / ObsIdVar(obsId) / "gcalEnabled" / BooleanVar(gcalEnabled) as user => se.setGcalEnabled(inputQueue, obsId, user, gcalEnabled) *> - Ok(s"Set GCAL enable flag to '${gcalEnabled}' for sequence ${obsId.format}") + Ok(s"Set GCAL enable flag to '$gcalEnabled' for sequence ${obsId.format}") case POST -> Root / ObsIdVar(obsId) / "instEnabled" / BooleanVar(instEnabled) as user => se.setInstrumentEnabled(inputQueue, obsId, user, instEnabled) *> - Ok(s"Set instrument enable flag to '${instEnabled}' for sequence ${obsId.format}") + Ok(s"Set instrument enable flag to '$instEnabled' for sequence ${obsId.format}") case POST -> Root / ObsIdVar(obsId) / "dhsEnabled" / BooleanVar(dhsEnabled) as user => se.setDhsEnabled(inputQueue, obsId, user, dhsEnabled) *> - Ok(s"Set DHS enable flag to '${dhsEnabled}' for sequence ${obsId.format}") + Ok(s"Set DHS enable flag to '$dhsEnabled' for sequence ${obsId.format}") case req @ POST -> Root / "iq" as user => req.req.decode[ImageQuality](iq => diff --git a/modules/web/server/src/main/scala/seqexec/web/server/logging/AppenderForClients.scala b/modules/web/server/src/main/scala/seqexec/web/server/logging/AppenderForClients.scala index bc6fb00196..a90c5fc11d 100644 --- a/modules/web/server/src/main/scala/seqexec/web/server/logging/AppenderForClients.scala +++ b/modules/web/server/src/main/scala/seqexec/web/server/logging/AppenderForClients.scala @@ -15,8 +15,8 @@ import seqexec.model.enum.ServerLogLevel import seqexec.model.events._ /** - * Custom appender that can take log events from logback and send them - * to clients via the common pipe/WebSockets + * Custom appender that can take log events from logback and send them to clients via the common + * pipe/WebSockets * * This is out of the scala/http4s loop */ diff --git a/modules/web/server/src/main/scala/seqexec/web/server/security/HttpAuthenticator.scala b/modules/web/server/src/main/scala/seqexec/web/server/security/HttpAuthenticator.scala index 4ac74a4a71..da9e9b68c7 100644 --- a/modules/web/server/src/main/scala/seqexec/web/server/security/HttpAuthenticator.scala +++ b/modules/web/server/src/main/scala/seqexec/web/server/security/HttpAuthenticator.scala @@ -50,8 +50,8 @@ class Http4sAuthentication[F[_]: Sync](auth: AuthenticationService[F]) extends H } /** - * Middleware used to keep the session alive as long as authenticated request are comming - * It has some cost as it needs to decode/encode the cookie with JWT + * Middleware used to keep the session alive as long as authenticated request are comming It has + * some cost as it needs to decode/encode the cookie with JWT */ object TokenRefresher { private def replaceCookie[F[_]: Monad](service: HttpRoutes[F], auth: Http4sAuthentication[F])( diff --git a/modules/web/server/src/main/scala/seqexec/web/server/security/TestAuthenticationService.scala b/modules/web/server/src/main/scala/seqexec/web/server/security/TestAuthenticationService.scala index ce99abf172..2cc57ae062 100644 --- a/modules/web/server/src/main/scala/seqexec/web/server/security/TestAuthenticationService.scala +++ b/modules/web/server/src/main/scala/seqexec/web/server/security/TestAuthenticationService.scala @@ -9,8 +9,8 @@ import seqexec.model.UserDetails import seqexec.web.server.security.AuthenticationService.AuthResult /** - * Authentication service for testing with a hardcoded list of users - * It lets you avoid the LDAP dependency but should not be used in production + * Authentication service for testing with a hardcoded list of users It lets you avoid the LDAP + * dependency but should not be used in production */ class TestAuthenticationService[F[_]: Applicative] extends AuthService[F] { private val cannedUsers = List(UserDetails("telops", "Telops") -> "pwd") diff --git a/modules/web/server/src/test/scala/seqexec/web/server/http4s/SeqexecCommandRoutesSpec.scala b/modules/web/server/src/test/scala/seqexec/web/server/http4s/SeqexecCommandRoutesSpec.scala index 7b94e175d5..96c7e5f004 100644 --- a/modules/web/server/src/test/scala/seqexec/web/server/http4s/SeqexecCommandRoutesSpec.scala +++ b/modules/web/server/src/test/scala/seqexec/web/server/http4s/SeqexecCommandRoutesSpec.scala @@ -462,7 +462,7 @@ class SeqexecCommandRoutesSpec assert(s === Some(Status.Ok)) assert( b.unsafeRunSync() === Some( - s"Set observer name to '${obs}' for sequence ${obsId.format}" + s"Set observer name to '$obs' for sequence ${obsId.format}" ) ) } diff --git a/project/AppsCommon.scala b/project/AppsCommon.scala index e326d44435..ba3ad42a06 100644 --- a/project/AppsCommon.scala +++ b/project/AppsCommon.scala @@ -1,27 +1,30 @@ import com.typesafe.sbt.packager.MappingsHelper._ import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport._ import sbt.Keys._ -import sbt.{Project, Resolver, _} +import sbt.{ Project, Resolver, _ } /** - * Define tasks and settings used by application definitions - */ + * Define tasks and settings used by application definitions + */ object AppsCommon { - lazy val ocsJreDir = settingKey[File]("Directory where distribution JREs are stored.") - lazy val applicationConfName = settingKey[String]("Name of the application to lookup the configuration") - lazy val applicationConfSite = settingKey[DeploymentSite]("Name of the site for the application configuration") - lazy val downloadConfiguration = taskKey[Seq[File]]("Download a configuration file for an application") + lazy val ocsJreDir = settingKey[File]("Directory where distribution JREs are stored.") + lazy val applicationConfName = + settingKey[String]("Name of the application to lookup the configuration") + lazy val applicationConfSite = + settingKey[DeploymentSite]("Name of the site for the application configuration") + lazy val downloadConfiguration = + taskKey[Seq[File]]("Download a configuration file for an application") sealed trait LogType object LogType { case object ConsoleAndFiles extends LogType - case object Files extends LogType + case object Files extends LogType } sealed trait DeploymentTarget { def subdir: String } - object DeploymentTarget { + object DeploymentTarget { case object Linux64 extends DeploymentTarget { override def subdir: String = "linux" } @@ -30,7 +33,7 @@ object AppsCommon { sealed trait DeploymentSite { def site: String } - object DeploymentSite { + object DeploymentSite { case object GS extends DeploymentSite { override def site: String = "gs" } @@ -40,8 +43,8 @@ object AppsCommon { } /** - * Mappings common to applications, including configuration and logging conf - */ + * Mappings common to applications, including configuration and logging conf + */ lazy val deployedAppMappings = Seq( // Don't include the configuration on the jar. Instead we copy it to the conf dir mappings in (Compile, packageBin) ~= { _.filter(!_._1.getName.endsWith(".conf")) }, @@ -50,14 +53,15 @@ object AppsCommon { mappings in Universal in packageZipTarball += { val f = (resourceDirectory in Compile).value / "app.conf" f -> ("conf/" + f.getName) - }) + } + ) private def embeddedJreSettings(target: DeploymentTarget) = Seq( // Put the jre in the tarball mappings in Universal ++= { - val jresDir = (ocsJreDir in ThisBuild).value + val jresDir = (ocsJreDir in ThisBuild).value // Map the location of jre files - val jreLink = "JRE64_1.8" + val jreLink = "JRE64_1.8" val linux64Jre = jresDir.toPath.resolve(target.subdir).resolve(jreLink) directory(linux64Jre.toFile).map { j => j._1 -> j._2.replace(jreLink, "jre") @@ -73,13 +77,14 @@ object AppsCommon { lazy val embeddedJreSettingsLinux64 = embeddedJreSettings(DeploymentTarget.Linux64) /** - * Settings for meta projects to make them non-publishable - */ + * Settings for meta projects to make them non-publishable + */ def preventPublication(p: Project) = p.settings( - publish := {}, - publishLocal := {}, - publishArtifact := false, - publishTo := Some(Resolver.file("Unused transient repository", target.value / "fakepublish")), - packagedArtifacts := Map.empty) + publish := {}, + publishLocal := {}, + publishArtifact := false, + publishTo := Some(Resolver.file("Unused transient repository", target.value / "fakepublish")), + packagedArtifacts := Map.empty + ) } diff --git a/project/Common.scala b/project/Common.scala index de949c848f..6dfa87fcf7 100644 --- a/project/Common.scala +++ b/project/Common.scala @@ -4,24 +4,28 @@ import sbt._ import com.timushev.sbt.updates.UpdatesPlugin.autoImport._ /** - * Define tasks and settings used by module definitions - */ + * Define tasks and settings used by module definitions + */ object Common { lazy val commonSettings = Seq( // Workaround for https://github.com/sbt/sbt/issues/4109 - initialCommands += "jline.TerminalFactory.get.init\n", + initialCommands += "jline.TerminalFactory.get.init\n", scalacOptions in (Compile, doc) ++= Seq( "-groups", - "-sourcepath", (baseDirectory in LocalRootProject).value.getAbsolutePath, - "-skip-packages", "scalaz", - "-doc-title", "Gem", - "-doc-version", version.value + "-sourcepath", + (baseDirectory in LocalRootProject).value.getAbsolutePath, + "-skip-packages", + "scalaz", + "-doc-title", + "Gem", + "-doc-version", + version.value ), // Common libraries - libraryDependencies += TestLibs.value, + libraryDependencies += TestLibs.value, // Don't build javadoc when we're packaging the docker image. - mappings in (Compile, packageDoc) := Seq(), - sources in (Compile,doc) := Seq.empty, + mappings in (Compile, packageDoc) := Seq(), + sources in (Compile, doc) := Seq.empty, // We don't care to see updates about the scala language itself dependencyUpdatesFilter -= moduleFilter(name = "scala-library"), @@ -32,7 +36,10 @@ object Common { dependencyUpdatesFilter -= moduleFilter(organization = "dom4j"), dependencyUpdatesFilter -= moduleFilter(organization = "net.sf.opencsv"), dependencyUpdatesFilter -= moduleFilter(organization = "commons-httpclient"), - testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-l", "gem.test.Tags.RequiresNetwork"), // by default, ignore network tests + testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, + "-l", + "gem.test.Tags.RequiresNetwork" + ), // by default, ignore network tests // Don't worry about monocle versions that start with the same prefix. dependencyUpdatesFilter -= moduleFilter( organization = "com.github.julien-truffaut", diff --git a/project/Settings.scala b/project/Settings.scala index 69790522cf..5a5b0d240c 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -3,8 +3,8 @@ import java.lang.{ Runtime => JRuntime } import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._ /** - * Application settings and dependencies - */ + * Application settings and dependencies + */ object Settings { /** Library versions */ @@ -86,8 +86,8 @@ object Settings { } /** - * Global libraries - */ + * Global libraries + */ object Libraries { // Test Libraries val TestLibs = Def.setting( diff --git a/project/plugins.sbt b/project/plugins.sbt index d2d7c28b29..c4fb81c43e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,32 +1,32 @@ -addSbtPlugin("edu.gemini" % "sbt-lucuma" % "0.3.8") +addSbtPlugin("edu.gemini" % "sbt-lucuma" % "0.3.8") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") // sbt revolver lets launching applications from the sbt console -addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") +addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") // Extract metadata from sbt and make it available to the code -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") // Support making distributions -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") // Check the style with scalastyle -addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") +addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") // Built the version out of git -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.1") -addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") +addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.1") +addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") // Use NPM modules rather than webjars -addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0") // Used to find dependencies -addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2") -addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.0") +addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2") +addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3") onLoad in Global := { s => "dependencyUpdates" :: s } diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt index 80fab1c4cc..6c5ce3192b 100644 --- a/project/project/plugins.sbt +++ b/project/project/plugins.sbt @@ -1,2 +1,2 @@ // So the build build will use it -addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.0") +addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.0")