diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index 23a01ad0..fd80bec9 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -83,7 +83,7 @@ jobs: - name: Run sbt compile env: CI: true - run: sbt -Dsbt.log.format=false compile + run: sbt -Dsbt.log.format=false scalafmtCheckAll compile - name: Create the dev.conf run: | touch ./conf/dev.conf diff --git a/app/org/maproulette/data/SnapshotManager.scala b/app/org/maproulette/data/SnapshotManager.scala index a7b39cee..26949760 100644 --- a/app/org/maproulette/data/SnapshotManager.scala +++ b/app/org/maproulette/data/SnapshotManager.scala @@ -4,7 +4,6 @@ */ package org.maproulette.data - import anorm.SqlParser._ import anorm._ import javax.inject.{Inject, Singleton} diff --git a/app/org/maproulette/filters/Filters.scala b/app/org/maproulette/filters/Filters.scala index 3e02fa41..5ec12e71 100644 --- a/app/org/maproulette/filters/Filters.scala +++ b/app/org/maproulette/filters/Filters.scala @@ -13,4 +13,4 @@ import play.filters.gzip.GzipFilter * @author cuthbertm */ class Filters @Inject() (corsFilter: CORSFilter, gzipFilter: GzipFilter) - extends DefaultHttpFilters(corsFilter, gzipFilter) + extends DefaultHttpFilters(corsFilter, gzipFilter) diff --git a/app/org/maproulette/filters/HttpLoggingFilter.scala b/app/org/maproulette/filters/HttpLoggingFilter.scala index 5ebc040c..37a32f4d 100644 --- a/app/org/maproulette/filters/HttpLoggingFilter.scala +++ b/app/org/maproulette/filters/HttpLoggingFilter.scala @@ -14,9 +14,9 @@ import scala.concurrent.Future import scala.concurrent.ExecutionContext /** - * Filter to provide an http request log at the service side. The HttpLoggingFilter is enabled by default within - * application.conf but will create no output until logback is set to the debug or trace levels. - */ + * Filter to provide an http request log at the service side. The HttpLoggingFilter is enabled by default within + * application.conf but will create no output until logback is set to the debug or trace levels. + */ class HttpLoggingFilter @Inject() (implicit val mat: Materializer, ec: ExecutionContext) extends Filter { def apply( diff --git a/app/org/maproulette/framework/controller/FollowController.scala b/app/org/maproulette/framework/controller/FollowController.scala index 97bc93e5..dfd63014 100644 --- a/app/org/maproulette/framework/controller/FollowController.scala +++ b/app/org/maproulette/framework/controller/FollowController.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.controller - import javax.inject.Inject import org.maproulette.data.ActionManager import org.maproulette.exception.NotFoundException diff --git a/app/org/maproulette/framework/controller/NotificationController.scala b/app/org/maproulette/framework/controller/NotificationController.scala index 27df32dd..8bf966e5 100644 --- a/app/org/maproulette/framework/controller/NotificationController.scala +++ b/app/org/maproulette/framework/controller/NotificationController.scala @@ -15,7 +15,6 @@ import org.maproulette.utils.{Crypto, Utils} import play.api.libs.json._ import play.api.mvc._ - /** * @author nrotstan */ @@ -28,7 +27,6 @@ class NotificationController @Inject() ( ) extends AbstractController(components) with DefaultWrites { - implicit val notificationSubscriptionReads = NotificationSubscriptions.notificationSubscriptionReads implicit val notificationSubscriptionWrites = diff --git a/app/org/maproulette/framework/controller/TaskBundleController.scala b/app/org/maproulette/framework/controller/TaskBundleController.scala index caf22f3f..9ace5d41 100644 --- a/app/org/maproulette/framework/controller/TaskBundleController.scala +++ b/app/org/maproulette/framework/controller/TaskBundleController.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.controller - import javax.inject.Inject import org.maproulette.exception.InvalidException import org.maproulette.data._ diff --git a/app/org/maproulette/framework/controller/TaskReviewController.scala b/app/org/maproulette/framework/controller/TaskReviewController.scala index 38802aa5..35907d9a 100644 --- a/app/org/maproulette/framework/controller/TaskReviewController.scala +++ b/app/org/maproulette/framework/controller/TaskReviewController.scala @@ -12,11 +12,7 @@ import org.maproulette.framework.psql.Paging import org.maproulette.framework.model.{Challenge, ChallengeListing, Project, User, Tag, Task} import org.maproulette.framework.mixins.{ParentMixin, TagsControllerMixin} import org.maproulette.framework.repository.TaskRepository -import org.maproulette.session.{ - SessionManager, - SearchParameters, - SearchLocation -} +import org.maproulette.session.{SessionManager, SearchParameters, SearchLocation} import org.maproulette.utils.Utils import play.api.mvc._ import play.api.libs.json._ diff --git a/app/org/maproulette/framework/controller/TaskReviewMetricsController.scala b/app/org/maproulette/framework/controller/TaskReviewMetricsController.scala index 2a5da41a..4965cd28 100644 --- a/app/org/maproulette/framework/controller/TaskReviewMetricsController.scala +++ b/app/org/maproulette/framework/controller/TaskReviewMetricsController.scala @@ -14,12 +14,7 @@ import org.maproulette.framework.service.{ UserService } import org.maproulette.framework.psql.Paging -import org.maproulette.framework.model.{ - Challenge, - User, - ReviewMetrics, - Task -} +import org.maproulette.framework.model.{Challenge, User, ReviewMetrics, Task} import org.maproulette.session.{SessionManager, SearchParameters, SearchTaskParameters} import org.maproulette.utils.Utils import play.api.mvc._ diff --git a/app/org/maproulette/framework/controller/TeamController.scala b/app/org/maproulette/framework/controller/TeamController.scala index 887e10e9..c2cf2e99 100644 --- a/app/org/maproulette/framework/controller/TeamController.scala +++ b/app/org/maproulette/framework/controller/TeamController.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.controller - import javax.inject.Inject import org.maproulette.data.ActionManager import org.maproulette.exception.{MPExceptionUtil, StatusMessage} diff --git a/app/org/maproulette/framework/controller/UserController.scala b/app/org/maproulette/framework/controller/UserController.scala index 129e2f3d..386832d0 100644 --- a/app/org/maproulette/framework/controller/UserController.scala +++ b/app/org/maproulette/framework/controller/UserController.scala @@ -6,13 +6,7 @@ package org.maproulette.framework.controller import javax.inject.Inject import org.maproulette.exception.{InvalidException, NotFoundException, StatusMessage} -import org.maproulette.framework.model.{ - Challenge, - User, - UserSettings, - GrantTarget, - Task -} +import org.maproulette.framework.model.{Challenge, User, UserSettings, GrantTarget, Task} import org.maproulette.framework.psql.Paging import org.maproulette.framework.service.ServiceManager import org.maproulette.framework.mixins.ParentMixin diff --git a/app/org/maproulette/framework/mixins/SearchParametersMixin.scala b/app/org/maproulette/framework/mixins/SearchParametersMixin.scala index b9cf931d..9dad049c 100644 --- a/app/org/maproulette/framework/mixins/SearchParametersMixin.scala +++ b/app/org/maproulette/framework/mixins/SearchParametersMixin.scala @@ -12,7 +12,6 @@ import org.maproulette.framework.psql.{AND, OR} import org.maproulette.framework.model.{TaskReview, Project, Challenge, Task} import play.api.libs.json.JsDefined - trait SearchParametersMixin { /** diff --git a/app/org/maproulette/framework/mixins/TaskFilterMixin.scala b/app/org/maproulette/framework/mixins/TaskFilterMixin.scala index a78e227f..5fa78ba7 100644 --- a/app/org/maproulette/framework/mixins/TaskFilterMixin.scala +++ b/app/org/maproulette/framework/mixins/TaskFilterMixin.scala @@ -4,13 +4,11 @@ */ package org.maproulette.framework.mixins - import org.maproulette.framework.model.{User, Challenge, Project} import org.maproulette.framework.psql.{Query, _} import org.maproulette.framework.psql.filter._ import org.maproulette.data.Actions - /** * TaskFilterMixin provides task related methods */ diff --git a/app/org/maproulette/framework/mixins/TaskParserMixin.scala b/app/org/maproulette/framework/mixins/TaskParserMixin.scala index dafbc3e2..5665cc28 100644 --- a/app/org/maproulette/framework/mixins/TaskParserMixin.scala +++ b/app/org/maproulette/framework/mixins/TaskParserMixin.scala @@ -10,7 +10,6 @@ import org.joda.time.DateTime import org.maproulette.framework.model.{TaskReview, TaskReviewFields, TaskWithReview, Task} - /** * TaskParserMixin provides task parsers */ diff --git a/app/org/maproulette/framework/model/TaskLogEntry.scala b/app/org/maproulette/framework/model/TaskLogEntry.scala index 07ab62cd..17a18017 100644 --- a/app/org/maproulette/framework/model/TaskLogEntry.scala +++ b/app/org/maproulette/framework/model/TaskLogEntry.scala @@ -26,7 +26,7 @@ case class TaskLogEntry( reviewRequestedBy: Option[Int], reviewedBy: Option[Int], comment: Option[String], - errorTags: Option[String], + errorTags: Option[String] ) {} object TaskLogEntry { diff --git a/app/org/maproulette/framework/repository/ChallengeSnapshotRespository.scala b/app/org/maproulette/framework/repository/ChallengeSnapshotRespository.scala index b1854c6c..0d9dccda 100644 --- a/app/org/maproulette/framework/repository/ChallengeSnapshotRespository.scala +++ b/app/org/maproulette/framework/repository/ChallengeSnapshotRespository.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.repository - import javax.inject.{Inject, Singleton} import org.maproulette.framework.psql.Query import org.maproulette.framework.psql.filter.BaseParameter diff --git a/app/org/maproulette/framework/repository/TaskRepository.scala b/app/org/maproulette/framework/repository/TaskRepository.scala index be9fdca4..ce4d194d 100644 --- a/app/org/maproulette/framework/repository/TaskRepository.scala +++ b/app/org/maproulette/framework/repository/TaskRepository.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.repository - import anorm.SqlParser.{get, scalar, str} import anorm.ToParameterValue import anorm._, postgresql._ diff --git a/app/org/maproulette/framework/repository/TaskReviewRepository.scala b/app/org/maproulette/framework/repository/TaskReviewRepository.scala index b902f8ff..43a49902 100644 --- a/app/org/maproulette/framework/repository/TaskReviewRepository.scala +++ b/app/org/maproulette/framework/repository/TaskReviewRepository.scala @@ -80,12 +80,14 @@ class TaskReviewRepository @Inject() ( .executeUpdate() for (task <- taskList) { - var querystring = """UPDATE task_review SET review_claimed_by = {userId}, review_claimed_at = NOW(), review_started_at = NOW() + var querystring = + """UPDATE task_review SET review_claimed_by = {userId}, review_claimed_at = NOW(), review_started_at = NOW() WHERE task_id = {taskId} AND review_claimed_at IS NULL""" //don't reset review_started_at if task has already been reviewed if (!task.review.reviewedAt.isEmpty) { - querystring = """UPDATE task_review SET review_claimed_by = {userId}, review_claimed_at = NOW() + querystring = + """UPDATE task_review SET review_claimed_by = {userId}, review_claimed_at = NOW() WHERE task_id = {taskId} AND review_claimed_at IS NULL""" } diff --git a/app/org/maproulette/framework/service/GrantService.scala b/app/org/maproulette/framework/service/GrantService.scala index 7e4a4fd4..6d9866c1 100644 --- a/app/org/maproulette/framework/service/GrantService.scala +++ b/app/org/maproulette/framework/service/GrantService.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.service - import javax.inject.{Inject, Singleton} import org.maproulette.Config import org.maproulette.exception.InvalidException diff --git a/app/org/maproulette/framework/service/GroupService.scala b/app/org/maproulette/framework/service/GroupService.scala index 67b86fda..33d8867f 100644 --- a/app/org/maproulette/framework/service/GroupService.scala +++ b/app/org/maproulette/framework/service/GroupService.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.service - import javax.inject.{Inject, Singleton} import org.maproulette.framework.model.{Group, GroupMember, MemberObject} import org.maproulette.data.{ItemType} diff --git a/app/org/maproulette/framework/service/NotificationService.scala b/app/org/maproulette/framework/service/NotificationService.scala index 9f5a38de..3a325f13 100644 --- a/app/org/maproulette/framework/service/NotificationService.scala +++ b/app/org/maproulette/framework/service/NotificationService.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.service - import javax.inject.{Inject, Singleton} import org.maproulette.exception.{InvalidException, NotFoundException} import org.maproulette.data.{UserType} diff --git a/app/org/maproulette/framework/service/TaskClusterService.scala b/app/org/maproulette/framework/service/TaskClusterService.scala index 50bc6cb1..abc2cf70 100644 --- a/app/org/maproulette/framework/service/TaskClusterService.scala +++ b/app/org/maproulette/framework/service/TaskClusterService.scala @@ -38,7 +38,7 @@ class TaskClusterService @Inject() (repository: TaskClusterRepository) numberOfPoints: Int = this.repository.DEFAULT_NUMBER_OF_POINTS ): List[TaskCluster] = { val filtered = this.filterOnSearchParameters(params)(false) - val query = this.filterOutDeletedParents(filtered) + val query = this.filterOutDeletedParents(filtered) this.repository.queryTaskClusters(query, numberOfPoints, params) } diff --git a/app/org/maproulette/framework/service/TeamService.scala b/app/org/maproulette/framework/service/TeamService.scala index e468feec..991b31a9 100644 --- a/app/org/maproulette/framework/service/TeamService.scala +++ b/app/org/maproulette/framework/service/TeamService.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.service - import javax.inject.{Inject, Singleton} import org.maproulette.exception.{InvalidException, NotFoundException} import org.maproulette.framework.model._ diff --git a/app/org/maproulette/models/dal/ChallengeDAL.scala b/app/org/maproulette/models/dal/ChallengeDAL.scala index 014e4cff..5e8eb8a3 100644 --- a/app/org/maproulette/models/dal/ChallengeDAL.scala +++ b/app/org/maproulette/models/dal/ChallengeDAL.scala @@ -1428,7 +1428,7 @@ class ChallengeDAL @Inject() ( * @param c an implicit connection */ def moveChallenges(newParent: Long, challengeIds: List[Long], user: User)( - implicit c: Option[Connection] = None + implicit c: Option[Connection] = None ): List[Long] = { this.permission.hasAdminAccess(ProjectType(), user)(newParent) this.serviceManager.project.retrieve(newParent) match { @@ -1469,7 +1469,6 @@ class ChallengeDAL @Inject() ( movedChallengeIds.toList } - /** * Update the popularity score of the given challenge following completion of a task. * Challenge popularity p is calculated with the simple formula p = (p + t) / 2 where diff --git a/app/org/maproulette/models/dal/TaskDAL.scala b/app/org/maproulette/models/dal/TaskDAL.scala index 34f12640..738a38d1 100644 --- a/app/org/maproulette/models/dal/TaskDAL.scala +++ b/app/org/maproulette/models/dal/TaskDAL.scala @@ -17,14 +17,7 @@ import org.locationtech.jts.geom.Envelope import org.maproulette.Config import org.maproulette.data._ import org.maproulette.exception.{InvalidException, NotFoundException} -import org.maproulette.framework.model.{ - Challenge, - Project, - StatusActions, - User, - GrantTarget, - Task -} +import org.maproulette.framework.model.{Challenge, Project, StatusActions, User, GrantTarget, Task} import org.maproulette.framework.psql.filter.{BaseParameter, SubQueryFilter} import org.maproulette.framework.psql.{Order, Paging, Query} import org.maproulette.framework.repository.{ProjectRepository, TaskRepository} diff --git a/app/org/maproulette/provider/EmailProvider.scala b/app/org/maproulette/provider/EmailProvider.scala index 8104f0d1..946762a2 100644 --- a/app/org/maproulette/provider/EmailProvider.scala +++ b/app/org/maproulette/provider/EmailProvider.scala @@ -17,7 +17,6 @@ import org.maproulette.framework.model.{UserNotification, UserNotificationEmail} @Singleton class EmailProvider @Inject() (mailerClient: MailerClient, config: Config) { - def emailNotification(toAddress: String, notification: UserNotificationEmail) = { val notificationName = UserNotification.notificationTypeMap.get(notification.notificationType).get diff --git a/app/org/maproulette/session/TaskPropertySearch.scala b/app/org/maproulette/session/TaskPropertySearch.scala index 5eeb307e..9dc4c0b7 100644 --- a/app/org/maproulette/session/TaskPropertySearch.scala +++ b/app/org/maproulette/session/TaskPropertySearch.scala @@ -4,7 +4,6 @@ */ package org.maproulette.session - import org.maproulette.exception.InvalidException /** diff --git a/test/org/maproulette/framework/repository/TaskClusterRepositorySpec.scala b/test/org/maproulette/framework/repository/TaskClusterRepositorySpec.scala index 946f20e2..4d697e6e 100644 --- a/test/org/maproulette/framework/repository/TaskClusterRepositorySpec.scala +++ b/test/org/maproulette/framework/repository/TaskClusterRepositorySpec.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.repository - import org.maproulette.framework.model.{User, Task} import org.maproulette.framework.util.{TaskTag, FrameworkHelper} import org.maproulette.framework.psql.Query diff --git a/test/org/maproulette/framework/repository/TaskHistoryRepositorySpec.scala b/test/org/maproulette/framework/repository/TaskHistoryRepositorySpec.scala index 8613861a..5f43af9a 100644 --- a/test/org/maproulette/framework/repository/TaskHistoryRepositorySpec.scala +++ b/test/org/maproulette/framework/repository/TaskHistoryRepositorySpec.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.repository - import org.maproulette.data.{Actions, TaskItem, ActionManager, TaskStatusSet} import org.maproulette.framework.model.{User, TaskLogEntry, Task} import org.maproulette.framework.util.{TaskTag, FrameworkHelper} diff --git a/test/org/maproulette/framework/repository/TaskReviewRepositorySpec.scala b/test/org/maproulette/framework/repository/TaskReviewRepositorySpec.scala index 4af9e748..36231d45 100644 --- a/test/org/maproulette/framework/repository/TaskReviewRepositorySpec.scala +++ b/test/org/maproulette/framework/repository/TaskReviewRepositorySpec.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.repository - import org.maproulette.framework.model.User import org.maproulette.framework.util.{TaskReviewTag, FrameworkHelper} import play.api.Application diff --git a/test/org/maproulette/framework/repository/UserSavedObjectsRepositorySpec.scala b/test/org/maproulette/framework/repository/UserSavedObjectsRepositorySpec.scala index 1d892595..08bdb4b9 100644 --- a/test/org/maproulette/framework/repository/UserSavedObjectsRepositorySpec.scala +++ b/test/org/maproulette/framework/repository/UserSavedObjectsRepositorySpec.scala @@ -6,10 +6,7 @@ package org.maproulette.framework.repository import org.maproulette.framework.model.User -import org.maproulette.framework.util.{ - FrameworkHelper, - UserSavedObjectsRepoTag -} +import org.maproulette.framework.util.{FrameworkHelper, UserSavedObjectsRepoTag} import play.api.Application /** diff --git a/test/org/maproulette/framework/service/ChallengeSnapshotServiceSpec.scala b/test/org/maproulette/framework/service/ChallengeSnapshotServiceSpec.scala index 4c1ae506..6c5d5483 100644 --- a/test/org/maproulette/framework/service/ChallengeSnapshotServiceSpec.scala +++ b/test/org/maproulette/framework/service/ChallengeSnapshotServiceSpec.scala @@ -5,7 +5,6 @@ package org.maproulette.framework.service - import org.maproulette.framework.util.{ChallengeSnapshotTag, FrameworkHelper} import org.maproulette.data.SnapshotManager import play.api.Application diff --git a/test/org/maproulette/framework/service/TaskReviewServiceSpec.scala b/test/org/maproulette/framework/service/TaskReviewServiceSpec.scala index 382e6137..c5e927d8 100644 --- a/test/org/maproulette/framework/service/TaskReviewServiceSpec.scala +++ b/test/org/maproulette/framework/service/TaskReviewServiceSpec.scala @@ -10,10 +10,7 @@ import java.util.concurrent.TimeUnit import scala.concurrent.duration.FiniteDuration import play.api.libs.json.Json -import org.maproulette.session.{ - SearchParameters, - SearchTaskParameters -} +import org.maproulette.session.{SearchParameters, SearchTaskParameters} import org.maproulette.framework.model._ import org.maproulette.framework.util.{TaskReviewTag, FrameworkHelper} import org.maproulette.models.dal.{ChallengeDAL, TaskDAL}