diff --git a/docs/installation.html b/docs/installation.html index 29710913d2..2223f853b5 100644 --- a/docs/installation.html +++ b/docs/installation.html @@ -330,10 +330,10 @@
build commit: 1e2d9b89563dd72bd8e07f3f61ffad0c93c98e1a
-build time: Mon Aug 28 17:47:06 UTC 2023
+build commit: 23f549c4d2cabfea5e83218426155ce8d7efeb21
+build time: Mon Aug 28 17:59:41 UTC 2023
-scalafmt 3.7.12+16-1e2d9b89-SNAPSHOT
+scalafmt 3.7.12+17-23f549c4-SNAPSHOT
Usage: scalafmt [options] [<file>...]
-h, --help prints this usage text
@@ -539,6 +539,30 @@ val scalafmtThatIgnoresProjectSettings = scalafmt.withRespectProjectFilters(false)
+Alternate repositories and credentials
+scalafmt
uses some default repositories to download the version specified in
+.scalafmt.conf
; these repositories could be hardcoded or potentially specified
+via the environment variables.
+In order to specify explicit repositories as well, one could use
+val scalafmtWithRepos = scalafmt.withMavenRepositories(
+ "https://repo-1/snapshots",
+ "https://repo-2/public"
+)
+
+In addition, if some of the default or custom repositories require access credentials,
+they could be specified via
+import org.scalafmt.interfaces._
+
+val scalafmtWithCreds = scalafmtWithRepos match {
+ case x: RepositoryCredential.ScalafmtExtension =>
+ x.withRepositoryCredentials(
+ new RepositoryCredential("repo-1", "username", "password")
+ )
+ case x => x
+}
+
+This capability was added to the public interface as an extension method, accessible
+via a separate sub-interface.
Clearing resources
Use the clear()
method to clear up resources of the scalafmt
instance.
scalafmt.clear()
@@ -572,7 +596,7 @@ Scalafmt scalafmt = Scalafmt.create(scalafmtDynamic)
String formatted = scalafmt.format(config, file, "object A { }")
-