Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
fanf committed Mar 10, 2024
1 parent b2ad5e8 commit 78b7e82
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ object AclPathSegment {
*
*/
sealed trait AclPath extends Any {
def value: String = parts.toList.map(_.value).mkString("/")
def value: String = parts.toList.map(_.value).mkString("/")
def parts: NonEmptyList[AclPathSegment]
def display: String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ import com.normation.rudder.facts.nodes.MinimalNodeFactInterface
import com.normation.rudder.facts.nodes.NodeFact
import com.normation.rudder.facts.nodes.QueryContext
import scala.collection.MapView
import zio._
import zio.*
import zio.stream.ZStream
import zio.syntax._
import zio.syntax.*

/*
* This interface provide the main entry point for other part of Rudder to know
Expand Down Expand Up @@ -80,7 +80,7 @@ trait TenantService {
* Get the node with ID if it exists on ref map and qc/tenants allows to get it
*/
def nodeGetMapView(nodes: Ref[Map[NodeId, CoreNodeFact]], nodeId: NodeId)(implicit
qc: QueryContext
qc: QueryContext
): IOResult[Option[CoreNodeFact]]

}
Expand Down Expand Up @@ -117,7 +117,7 @@ class DefaultTenantService(var tenantsEnabled: Boolean, val tenantIds: Ref[Set[T
}

override def nodeFilterMapView(
nodes: Ref[Map[NodeId, CoreNodeFact]]
nodes: Ref[Map[NodeId, CoreNodeFact]]
)(implicit qc: QueryContext): IOResult[MapView[NodeId, CoreNodeFact]] = {
if (qc.nodePerms.isNone) {
MapView().succeed
Expand All @@ -140,7 +140,7 @@ class DefaultTenantService(var tenantsEnabled: Boolean, val tenantIds: Ref[Set[T
}

override def nodeGetMapView(nodes: Ref[Map[NodeId, CoreNodeFact]], nodeId: NodeId)(implicit
qc: QueryContext
qc: QueryContext
): IOResult[Option[CoreNodeFact]] = {
if (qc.nodePerms.isNone) None.succeed
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
package com.normation.rudder.tenants

import scala.util.matching.Regex
import zio.json._
import zio.json.*

/*
* A node can belong to one (or technically more, but we will limit that for now) `tenant`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,20 +566,20 @@ class GenericConfigService(
def set_rudder_ui_changeMessage_explanation(value: String): IOResult[Unit] = save("rudder_ui_changeMessage_explanation", value)

///// workflows /////
def rudder_workflow_enabled(): IOResult[Boolean] = {
def rudder_workflow_enabled(): IOResult[Boolean] = {
if (workflowLevel.workflowLevelAllowsEnable) {
get("rudder_workflow_enabled")
} else {
false.succeed
}
}
def rudder_workflow_self_validation(): IOResult[Boolean] = get("rudder_workflow_self_validation")
def rudder_workflow_self_deployment(): IOResult[Boolean] = get("rudder_workflow_self_deployment")
def rudder_workflow_self_validation(): IOResult[Boolean] = get("rudder_workflow_self_validation")
def rudder_workflow_self_deployment(): IOResult[Boolean] = get("rudder_workflow_self_deployment")
def rudder_workflow_validate_all(): IOResult[Boolean] = get("rudder_workflow_validate_all")
def set_rudder_workflow_validate_all(value: Boolean): IOResult[Unit] =
save("rudder_workflow_validate_all", value).unit

def set_rudder_workflow_enabled(value: Boolean): IOResult[Unit] = {
def set_rudder_workflow_enabled(value: Boolean): IOResult[Unit] = {
if (workflowLevel.workflowLevelAllowsEnable) {
save("rudder_workflow_enabled", value) <*
IOResult.attempt(workflowUpdate ! WorkflowUpdate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class RestTestSetUp {

implicit val userService: TestUserService = new TestUserService
class TestUserService extends UserService {
val user: AuthenticatedUser = new AuthenticatedUser {
val user: AuthenticatedUser = new AuthenticatedUser {
val account: RudderAccount = RudderAccount.User("test-user", "pass")
def checkRights(auth: AuthorizationType) = true
def getApiAuthz: ApiAuthz = ApiAuthz.allAuthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ class RudderXmlUserDetailsContextMapper(authConfigProvider: UserDetailListProvid
}

sealed trait ProviderRoleExtension {
def name: String
def name: String
def priority: Int = this match {
case ProviderRoleExtension.None => 0
case ProviderRoleExtension.NoOverride => 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ import scala.util.matching.Regex
import scala.xml.Elem
import scala.xml.Node
import scala.xml.NodeSeq
import zio.{System => _, _}
import zio.syntax._
import zio.{System as _, *}
import zio.syntax.*

/*
* Utilities about rights
Expand Down

0 comments on commit 78b7e82

Please sign in to comment.