This is an automated email from the ASF dual-hosted git repository.

mdedetrich pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-cassandra.git


The following commit(s) were added to refs/heads/main by this push:
     new 468c63d  Add applyCodeStyle and checkCodeStyle command alias
468c63d is described below

commit 468c63daa42b469a604b5b0e882ed7d749c5be66
Author: Matthew de Detrich <[email protected]>
AuthorDate: Wed Sep 6 23:47:29 2023 +0200

    Add applyCodeStyle and checkCodeStyle command alias
---
 CONTRIBUTING.md |  6 ++++--
 build.sbt       | 15 ++++-----------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8297146..4afeac5 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -153,9 +153,11 @@ Example:
     * Details 2
     * Details 3
 
-## Source style
+## Applying code style to the project
 
-pekko-persistence-cassandra uses [Scalafmt](https://scalameta.org/scalafmt/) 
to enforce some of the code style rules.
+The project uses [scalafmt](https://scalameta.org/scalafmt/) to ensure code 
quality which is automatically checked on
+every PR. If you would like to check for any potential code style problems 
locally you can run `sbt checkCodeStyle`
+and if you want to apply the code style then you can run `sbt applyCodeStyle`.
 
 ## Ignoring formatting commits in git blame
 
diff --git a/build.sbt b/build.sbt
index ad6834f..a5c36ab 100644
--- a/build.sbt
+++ b/build.sbt
@@ -20,6 +20,10 @@ commands := commands.value.filterNot { command =>
   }
 }
 
+addCommandAlias("applyCodeStyle", ";scalafmtAll; scalafmtSbt; javafmtAll; 
docs/javafmtAll; +headerCreateAll")
+addCommandAlias("checkCodeStyle",
+  ";+headerCheckAll; scalafmtCheckAll; scalafmtSbtCheck; javafmtCheckAll; 
docs/javafmtCheckAll")
+
 lazy val root = project
   .in(file("."))
   .enablePlugins(Common, ScalaUnidocPlugin)
@@ -144,14 +148,3 @@ lazy val docs = project
     paradoxGroups := Map("Language" -> Seq("Java", "Scala")),
     ApidocPlugin.autoImport.apidocRootPackage := "org.apache.pekko",
     apidocRootPackage := "org.apache.pekko")
-
-TaskKey[Unit]("verifyCodeFmt") := {
-  
scalafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach
 { _ =>
-    throw new MessageOnlyException(
-      "Unformatted Scala code found. Please run 'scalafmtAll' and commit the 
reformatted code")
-  }
-  (Compile / scalafmtSbtCheck).result.value.toEither.left.foreach { _ =>
-    throw new MessageOnlyException(
-      "Unformatted sbt code found. Please run 'scalafmtSbt' and commit the 
reformatted code")
-  }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to