From 40aee147b467a0c98d6678e90c5f58674849d219 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 19 Jan 2025 02:28:02 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.8.5 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 7a6097704..9fb818eb1 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.3 +version = 3.8.5 align.preset = most literals.double = Upper From fb60074fc43b054aab8aa17c4d5bc87106c7ae9e Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 19 Jan 2025 02:28:48 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.8.5 Executed command: scalafmt --non-interactive --- .../elastic4s/ScriptBuilderFnTest.scala | 5 ++- .../SourceAsContentBuilderTest.scala | 4 +- .../analysis/NormalizerBuilderTest.scala | 4 +- .../UpdateIndexLevelSettingsBuilderTest.scala | 4 +- .../searches/MultiSearchBuilderFnTest.scala | 4 +- .../FingerprintAnalyzerBuilderTest.scala | 5 ++- .../PatternAnalyzerBuilderTest.scala | 5 ++- .../EdgeNGramTokenizerBuilderTest.scala | 5 ++- .../elastic4s/json/XContentBuilderTest.scala | 39 +++++++++++++++---- .../CompoundWordTokenFilterTest.scala | 38 ++++++++++++++---- .../analyzers/EdgeNGramTokenizerTest.scala | 5 ++- .../KeywordMarkerTokenFilterTest.scala | 17 ++++++-- .../LimitTokenCountTokenFilterTest.scala | 8 +++- .../analyzers/PatternTokenizerTest.scala | 4 +- .../analyzers/ShingleTokenFilterTest.scala | 12 ++++-- .../analyzers/StopTokenFilterTest.scala | 5 ++- .../analyzers/UniqueTokenFilterTest.scala | 4 +- .../requests/indexes/IndexTest.scala | 5 ++- .../requests/update/UpdateByQueryTest.scala | 5 ++- .../elastic4s/search/InnerHitTest.scala | 5 ++- .../samples/HttpClientExampleApp.scala | 2 +- .../samples/HttpClientExampleApp.scala | 2 +- .../samples/HttpClientExampleApp.scala | 2 +- 23 files changed, 146 insertions(+), 43 deletions(-) diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/ScriptBuilderFnTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/ScriptBuilderFnTest.scala index 551850581..bd76edc9b 100755 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/ScriptBuilderFnTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/ScriptBuilderFnTest.scala @@ -9,7 +9,10 @@ import org.scalatest.matchers.should.Matchers class ScriptBuilderFnTest extends AnyFunSuite with Matchers { test("should handle recursive maps") { - ScriptBuilderFn(Script("myscript", params = Map("a" -> 1.2, "b" -> Map("c" -> true, "d" -> List(Map("e" -> 3)))))).string shouldBe + ScriptBuilderFn(Script( + "myscript", + params = Map("a" -> 1.2, "b" -> Map("c" -> true, "d" -> List(Map("e" -> 3)))) + )).string shouldBe """{"source":"myscript","params":{"a":1.2,"b":{"c":true,"d":[{"e":3}]}}}""" } diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala index 6635c2c2c..492e3d960 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/SourceAsContentBuilderTest.scala @@ -8,7 +8,9 @@ class SourceAsContentBuilderTest extends AnyFunSuite with Matchers { test("source as content builder should handle tuples") { val map = Map("name" -> "sammy", "teams" -> Seq(("football", "boro"), ("baseball", "phillies")), "projects" -> null) - SourceAsContentBuilder(map).string shouldBe """{"name":"sammy","teams":[["football","boro"],["baseball","phillies"]],"projects":null}""" + SourceAsContentBuilder( + map + ).string shouldBe """{"name":"sammy","teams":[["football","boro"],["baseball","phillies"]],"projects":null}""" } test("source as content builder should handle bigdecimals") { diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/analysis/NormalizerBuilderTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/analysis/NormalizerBuilderTest.scala index e9b1f0dd0..3767daa90 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/analysis/NormalizerBuilderTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/analysis/NormalizerBuilderTest.scala @@ -7,6 +7,8 @@ class NormalizerBuilderTest extends AnyFunSuite with Matchers { test("should build normalizer to spec") { val n = CustomNormalizer("my_normalizer", List("quote"), List("lowercase", "asciifolding")) - NormalizerBuilder.build(n).string shouldBe """{"type":"custom","filter":["lowercase","asciifolding"],"char_filter":["quote"]}""" + NormalizerBuilder.build( + n + ).string shouldBe """{"type":"custom","filter":["lowercase","asciifolding"],"char_filter":["quote"]}""" } } diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/indexes/UpdateIndexLevelSettingsBuilderTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/indexes/UpdateIndexLevelSettingsBuilderTest.scala index 4e7d881e1..e66ba587d 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/indexes/UpdateIndexLevelSettingsBuilderTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/indexes/UpdateIndexLevelSettingsBuilderTest.scala @@ -43,6 +43,8 @@ class UpdateIndexLevelSettingsBuilderTest extends AnyFunSuite with Matchers { settings = Map("index.blocks.write" -> true.toString) ) - UpdateIndexLevelSettingsBuilder(definition).string shouldBe """{"settings":{"index.blocks.write":"true","index.number_of_replicas":0}}""" + UpdateIndexLevelSettingsBuilder( + definition + ).string shouldBe """{"settings":{"index.blocks.write":"true","index.number_of_replicas":0}}""" } } diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/MultiSearchBuilderFnTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/MultiSearchBuilderFnTest.scala index 3b5416fec..cea9d3563 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/MultiSearchBuilderFnTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/MultiSearchBuilderFnTest.scala @@ -20,7 +20,9 @@ class MultiSearchBuilderFnTest extends AnyWordSpec with Matchers { } "build multisearch request with ignore_unavailable indices option" in { val req = searchRequest indicesOptions IndicesOptionsRequest(ignoreUnavailable = true) - MultiSearchBuilderFn(multi(req)).linesIterator.next shouldBe """{"index":"someIndex","ignore_unavailable":"true"}""" + MultiSearchBuilderFn( + multi(req) + ).linesIterator.next shouldBe """{"index":"someIndex","ignore_unavailable":"true"}""" } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/FingerprintAnalyzerBuilderTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/FingerprintAnalyzerBuilderTest.scala index 87487b3b2..18190ddaf 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/FingerprintAnalyzerBuilderTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/FingerprintAnalyzerBuilderTest.scala @@ -8,7 +8,10 @@ class FingerprintAnalyzerBuilderTest extends AnyWordSpec with Matchers { "FingerprintAnalyzer" should { "build json" in { - FingerprintAnalyzer("testy").separator("-").maxOutputSize(123).stopwords("a", "z").build.string shouldBe """{"type":"fingerprint","separator":"-","stopwords":["a","z"],"max_output_size":123}""" + FingerprintAnalyzer("testy").separator("-").maxOutputSize(123).stopwords( + "a", + "z" + ).build.string shouldBe """{"type":"fingerprint","separator":"-","stopwords":["a","z"],"max_output_size":123}""" } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/PatternAnalyzerBuilderTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/PatternAnalyzerBuilderTest.scala index c0613e95e..56d4413b9 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/PatternAnalyzerBuilderTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/analyzers/PatternAnalyzerBuilderTest.scala @@ -8,7 +8,10 @@ class PatternAnalyzerBuilderTest extends AnyWordSpec with Matchers { "PatternAnalyzer" should { "build json" in { - PatternAnalyzer("testy", regex = "21.*").lowercase(true).build.string shouldBe """{"type":"pattern","lowercase":true,"pattern":"21.*"}""" + PatternAnalyzer( + "testy", + regex = "21.*" + ).lowercase(true).build.string shouldBe """{"type":"pattern","lowercase":true,"pattern":"21.*"}""" } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala index 3fac0d488..d56eabd59 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala @@ -9,7 +9,10 @@ class EdgeNGramTokenizerBuilderTest extends AnyWordSpec with Matchers with Elast "EdgeNGramTokenizer" should { "build json" in { - EdgeNGramTokenizer("testy").minMaxGrams(2, 3).tokenChars("a", "z").build.string shouldBe """{"type":"edge_ngram","min_gram":2,"max_gram":3,"token_chars":["a","z"]}""" + EdgeNGramTokenizer("testy").minMaxGrams(2, 3).tokenChars( + "a", + "z" + ).build.string shouldBe """{"type":"edge_ngram","min_gram":2,"max_gram":3,"token_chars":["a","z"]}""" } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/json/XContentBuilderTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/json/XContentBuilderTest.scala index 1f3af8659..fb844eb97 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/json/XContentBuilderTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/json/XContentBuilderTest.scala @@ -26,15 +26,23 @@ class XContentBuilderTest extends AnyFunSuite with Matchers { } test("should support raw fields in objects") { - XContentFactory.obj().rawField("nested", """{"test":true,"name":"foo"}""").string shouldBe """{"nested":{"test":true,"name":"foo"}}""" + XContentFactory.obj().rawField( + "nested", + """{"test":true,"name":"foo"}""" + ).string shouldBe """{"nested":{"test":true,"name":"foo"}}""" } test("should support raw values in arrays") { - XContentFactory.array().rawValue("""{"test":true,"name":"foo"}""").string shouldBe """[{"test":true,"name":"foo"}]""" + XContentFactory.array().rawValue( + """{"test":true,"name":"foo"}""" + ).string shouldBe """[{"test":true,"name":"foo"}]""" } test("should support boolean arrays") { - XContentFactory.obj().array("booleans", Array(true, false, true)).string shouldBe """{"booleans":[true,false,true]}""" + XContentFactory.obj().array( + "booleans", + Array(true, false, true) + ).string shouldBe """{"booleans":[true,false,true]}""" } test("should support double arrays") { @@ -42,11 +50,17 @@ class XContentBuilderTest extends AnyFunSuite with Matchers { } test("should support biginteger arrays") { - XContentFactory.obj().autoarray("bigintegers", Seq(new BigInteger("123"), new BigInteger("456"))).string shouldBe """{"bigintegers":[123,456]}""" + XContentFactory.obj().autoarray( + "bigintegers", + Seq(new BigInteger("123"), new BigInteger("456")) + ).string shouldBe """{"bigintegers":[123,456]}""" } test("should support long arrays") { - XContentFactory.obj().array("longs", Array(345345435345L, 3257059014L)).string shouldBe """{"longs":[345345435345,3257059014]}""" + XContentFactory.obj().array( + "longs", + Array(345345435345L, 3257059014L) + ).string shouldBe """{"longs":[345345435345,3257059014]}""" } test("should support string arrays") { @@ -58,15 +72,24 @@ class XContentBuilderTest extends AnyFunSuite with Matchers { } test("should support bigdecimal fields") { - XContentFactory.obj().field("dec", BigDecimal("291839123.12321312")).string shouldBe """{"dec":291839123.12321312}""" + XContentFactory.obj().field( + "dec", + BigDecimal("291839123.12321312") + ).string shouldBe """{"dec":291839123.12321312}""" } test("should support bigint fields") { - XContentFactory.obj().field("bigint", BigInt("98123981231982361893619")).string shouldBe """{"bigint":98123981231982361893619}""" + XContentFactory.obj().field( + "bigint", + BigInt("98123981231982361893619") + ).string shouldBe """{"bigint":98123981231982361893619}""" } test("should support biginteger fields") { - XContentFactory.obj().autofield("biginteger", new BigInteger("98123981231982361893619")).string shouldBe """{"biginteger":98123981231982361893619}""" + XContentFactory.obj().autofield( + "biginteger", + new BigInteger("98123981231982361893619") + ).string shouldBe """{"biginteger":98123981231982361893619}""" } test("should support iterable fields") { diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/CompoundWordTokenFilterTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/CompoundWordTokenFilterTest.scala index 14656f0ad..13214bf49 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/CompoundWordTokenFilterTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/CompoundWordTokenFilterTest.scala @@ -8,28 +8,50 @@ class CompoundWordTokenFilterTest extends AnyWordSpec with TokenFilterApi with M "CompoundWordTokenFilter builder" should { "set type" in { - compoundWordTokenFilter("testy", DictionaryDecompounder).json.string shouldBe """{"type":"dictionary_decompounder"}""" + compoundWordTokenFilter( + "testy", + DictionaryDecompounder + ).json.string shouldBe """{"type":"dictionary_decompounder"}""" } "set word list" in { - compoundWordTokenFilter("testy", HyphenationDecompounder).wordList("boo", "foo").json.string shouldBe """{"type":"hyphenation_decompounder","word_list":["boo","foo"]}""" + compoundWordTokenFilter( + "testy", + HyphenationDecompounder + ).wordList("boo", "foo").json.string shouldBe """{"type":"hyphenation_decompounder","word_list":["boo","foo"]}""" } "set word list path" in { - compoundWordTokenFilter("testy", HyphenationDecompounder).wordListPath("config/word.txt").json.string shouldBe """{"type":"hyphenation_decompounder","word_list_path":"config/word.txt"}""" + compoundWordTokenFilter("testy", HyphenationDecompounder).wordListPath( + "config/word.txt" + ).json.string shouldBe """{"type":"hyphenation_decompounder","word_list_path":"config/word.txt"}""" } "set hyphenation patterns path" in { - compoundWordTokenFilter("testy", HyphenationDecompounder).wordListPath("config/hyphens.txt").json.string shouldBe """{"type":"hyphenation_decompounder","word_list_path":"config/hyphens.txt"}""" + compoundWordTokenFilter("testy", HyphenationDecompounder).wordListPath( + "config/hyphens.txt" + ).json.string shouldBe """{"type":"hyphenation_decompounder","word_list_path":"config/hyphens.txt"}""" } "set min word size" in { - compoundWordTokenFilter("testy", HyphenationDecompounder).minWordSize(7).json.string shouldBe """{"type":"hyphenation_decompounder","min_word_size":7}""" + compoundWordTokenFilter( + "testy", + HyphenationDecompounder + ).minWordSize(7).json.string shouldBe """{"type":"hyphenation_decompounder","min_word_size":7}""" } "set min subword size" in { - compoundWordTokenFilter("testy", HyphenationDecompounder).minSubwordSize(3).json.string shouldBe """{"type":"hyphenation_decompounder","min_subword_size":3}""" + compoundWordTokenFilter( + "testy", + HyphenationDecompounder + ).minSubwordSize(3).json.string shouldBe """{"type":"hyphenation_decompounder","min_subword_size":3}""" } "set max subword size" in { - compoundWordTokenFilter("testy", HyphenationDecompounder).maxSubwordSize(18).json.string shouldBe """{"type":"hyphenation_decompounder","max_subword_size":18}""" + compoundWordTokenFilter( + "testy", + HyphenationDecompounder + ).maxSubwordSize(18).json.string shouldBe """{"type":"hyphenation_decompounder","max_subword_size":18}""" } "set only longest match" in { - compoundWordTokenFilter("testy", HyphenationDecompounder).onlyLongestMatch(true).json.string shouldBe """{"type":"hyphenation_decompounder","only_longest_match":true}""" + compoundWordTokenFilter( + "testy", + HyphenationDecompounder + ).onlyLongestMatch(true).json.string shouldBe """{"type":"hyphenation_decompounder","only_longest_match":true}""" } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/EdgeNGramTokenizerTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/EdgeNGramTokenizerTest.scala index 29b1e192f..e2b5d74c1 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/EdgeNGramTokenizerTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/EdgeNGramTokenizerTest.scala @@ -8,7 +8,10 @@ class EdgeNGramTokenizerTest extends AnyWordSpec with TokenizerApi with Matchers "EdgeNGramTokenizer builder" should { "set min and max ngrams" in { - edgeNGramTokenizer("testy").minMaxGrams(3, 4).json.string shouldBe """{"type":"edgeNGram","min_gram":3,"max_gram":4}""" + edgeNGramTokenizer("testy").minMaxGrams( + 3, + 4 + ).json.string shouldBe """{"type":"edgeNGram","min_gram":3,"max_gram":4}""" } "set token chars" in { edgeNGramTokenizer("testy") diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/KeywordMarkerTokenFilterTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/KeywordMarkerTokenFilterTest.scala index ac2be4c53..611bd88b9 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/KeywordMarkerTokenFilterTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/KeywordMarkerTokenFilterTest.scala @@ -11,16 +11,25 @@ class KeywordMarkerTokenFilterTest extends AnyWordSpec with TokenFilterApi with keywordMarkerTokenFilter("testy").json.string shouldBe """{"type":"keyword_marker"}""" } "set keywords" in { - keywordMarkerTokenFilter("testy").keywords("foo", "bar").json.string shouldBe """{"type":"keyword_marker","keywords":["foo","bar"]}""" + keywordMarkerTokenFilter("testy").keywords( + "foo", + "bar" + ).json.string shouldBe """{"type":"keyword_marker","keywords":["foo","bar"]}""" } "set keywords path" in { - keywordMarkerTokenFilter("testy").keywordsPath("config/keywords.txt").json.string shouldBe """{"type":"keyword_marker","keywords_path":"config/keywords.txt"}""" + keywordMarkerTokenFilter("testy").keywordsPath( + "config/keywords.txt" + ).json.string shouldBe """{"type":"keyword_marker","keywords_path":"config/keywords.txt"}""" } "set keywords pattern" in { - keywordMarkerTokenFilter("testy").keywordsPattern("pattern").json.string shouldBe """{"type":"keyword_marker","keywords_pattern":"pattern"}""" + keywordMarkerTokenFilter( + "testy" + ).keywordsPattern("pattern").json.string shouldBe """{"type":"keyword_marker","keywords_pattern":"pattern"}""" } "set ignore case" in { - keywordMarkerTokenFilter("testy").ignoreCase(true).json.string shouldBe """{"type":"keyword_marker","ignore_case":true}""" + keywordMarkerTokenFilter( + "testy" + ).ignoreCase(true).json.string shouldBe """{"type":"keyword_marker","ignore_case":true}""" } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/LimitTokenCountTokenFilterTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/LimitTokenCountTokenFilterTest.scala index 198ee7e97..eab8544b8 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/LimitTokenCountTokenFilterTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/LimitTokenCountTokenFilterTest.scala @@ -11,10 +11,14 @@ class LimitTokenCountTokenFilterTest extends AnyWordSpec with TokenFilterApi wit limitTokenCountTokenFilter("testy").json.string shouldBe """{"type":"limit"}""" } "set max token count" in { - limitTokenCountTokenFilter("testy").maxTokenCount(7).json.string shouldBe """{"type":"limit","max_token_count":7}""" + limitTokenCountTokenFilter( + "testy" + ).maxTokenCount(7).json.string shouldBe """{"type":"limit","max_token_count":7}""" } "set consume all tokens" in { - limitTokenCountTokenFilter("testy").consumeAllTokens(true).json.string shouldBe """{"type":"limit","consume_all_tokens":true}""" + limitTokenCountTokenFilter( + "testy" + ).consumeAllTokens(true).json.string shouldBe """{"type":"limit","consume_all_tokens":true}""" } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/PatternTokenizerTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/PatternTokenizerTest.scala index 811817213..b335d2bd7 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/PatternTokenizerTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/PatternTokenizerTest.scala @@ -8,7 +8,9 @@ class PatternTokenizerTest extends AnyWordSpec with TokenizerApi with Matchers { "PatternTokenizer builder" should { "set flags" in { - patternTokenizer("testy").flags("abc").json.string shouldBe """{"type":"pattern","flags":"abc","pattern":"\\W+"}""" + patternTokenizer( + "testy" + ).flags("abc").json.string shouldBe """{"type":"pattern","flags":"abc","pattern":"\\W+"}""" } "not set flags if not specified" in { patternTokenizer("testy").json.string shouldBe """{"type":"pattern","pattern":"\\W+"}""" diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/ShingleTokenFilterTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/ShingleTokenFilterTest.scala index ee3239462..8ac57b2e2 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/ShingleTokenFilterTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/ShingleTokenFilterTest.scala @@ -17,13 +17,19 @@ class ShingleTokenFilterTest extends AnyWordSpec with TokenFilterApi with Matche shingleTokenFilter("testy").minShingleSize(11).json.string shouldBe """{"type":"shingle","min_shingle_size":11}""" } "set output unigrams" in { - shingleTokenFilter("testy").outputUnigrams(false).json.string shouldBe """{"type":"shingle","output_unigrams":false}""" + shingleTokenFilter( + "testy" + ).outputUnigrams(false).json.string shouldBe """{"type":"shingle","output_unigrams":false}""" } "set output unigrams if no shingles" in { - shingleTokenFilter("testy").outputUnigramsIfNoShingles(true).json.string shouldBe """{"type":"shingle","output_unigrams_if_no_shingles":true}""" + shingleTokenFilter("testy").outputUnigramsIfNoShingles( + true + ).json.string shouldBe """{"type":"shingle","output_unigrams_if_no_shingles":true}""" } "set token separator" in { - shingleTokenFilter("testy").tokenSeparator("/").json.string shouldBe """{"type":"shingle","token_separator":"/"}""" + shingleTokenFilter( + "testy" + ).tokenSeparator("/").json.string shouldBe """{"type":"shingle","token_separator":"/"}""" } "set filler token" in { shingleTokenFilter("testy").fillerToken("-").json.string shouldBe """{"type":"shingle","filler_token":"-"}""" diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/StopTokenFilterTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/StopTokenFilterTest.scala index f7a01af2e..86e1f0776 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/StopTokenFilterTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/StopTokenFilterTest.scala @@ -8,7 +8,10 @@ class StopTokenFilterTest extends AnyWordSpec with TokenFilterApi with Matchers "StopTokenFilter builder" should { "set stop words" in { - stopTokenFilter("testy").stopwords("boo", "foo").json.string shouldBe """{"type":"stop","stopwords":["boo","foo"]}""" + stopTokenFilter("testy").stopwords( + "boo", + "foo" + ).json.string shouldBe """{"type":"stop","stopwords":["boo","foo"]}""" } "set ignore case" in { stopTokenFilter("testy").ignoreCase(true).json.string shouldBe """{"type":"stop","ignore_case":true}""" diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/UniqueTokenFilterTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/UniqueTokenFilterTest.scala index a9326a183..deefaa971 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/UniqueTokenFilterTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/UniqueTokenFilterTest.scala @@ -11,7 +11,9 @@ class UniqueTokenFilterTest extends AnyWordSpec with AnalyzerApi with Matchers w uniqueTokenFilter("testy").json.string shouldBe """{"type":"unique"}""" } "set only same position" in { - uniqueTokenFilter("testy").onlyOnSamePosition(true).json.string shouldBe """{"type":"unique","only_on_same_position":true}""" + uniqueTokenFilter( + "testy" + ).onlyOnSamePosition(true).json.string shouldBe """{"type":"unique","only_on_same_position":true}""" } } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/IndexTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/IndexTest.scala index ec2916f3d..259c4db83 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/IndexTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/IndexTest.scala @@ -31,7 +31,10 @@ class IndexTest extends AnyWordSpec with Matchers with DockerTests { client.execute { bulk( - indexInto("electronics").fields(Map("name" -> "galaxy", "screensize" -> 5)).withId("55A").version(42L).versionType( + indexInto("electronics").fields(Map( + "name" -> "galaxy", + "screensize" -> 5 + )).withId("55A").version(42L).versionType( VersionType.External ), indexInto("electronics").fields(Map("name" -> "razor", "colours" -> Array("white", "blue"))), diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/update/UpdateByQueryTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/update/UpdateByQueryTest.scala index dd0a25a66..9a81f7581 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/update/UpdateByQueryTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/update/UpdateByQueryTest.scala @@ -95,7 +95,10 @@ class UpdateByQueryTest }.await val task = client.execute { - updateByQueryAsync("pop", termsQuery("name", "coca")).script(script("ctx._source.foo = 'h'").lang("painless")).refreshImmediately + updateByQueryAsync( + "pop", + termsQuery("name", "coca") + ).script(script("ctx._source.foo = 'h'").lang("painless")).refreshImmediately }.await.result.task // A bit ugly way to poll the task until it's complete diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/InnerHitTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/InnerHitTest.scala index 7594d9e27..3525075ce 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/InnerHitTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/InnerHitTest.scala @@ -23,7 +23,10 @@ class InnerHitTest extends AnyWordSpec with Matchers with DockerTests { client.execute { bulk( indexInto(indexName).fields(Map("name" -> "boro", "affiliation" -> "club")).id("1").routing("1"), - indexInto(indexName).fields(Map("name" -> "traore", "affiliation" -> Map("name" -> "player", "parent" -> "1"))).id( + indexInto(indexName).fields(Map( + "name" -> "traore", + "affiliation" -> Map("name" -> "player", "parent" -> "1") + )).id( "2" ).routing("1") ).refreshImmediately diff --git a/samples/elastic4s-http-client-gradle/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala b/samples/elastic4s-http-client-gradle/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala index 42ecbf4f6..58c936cff 100644 --- a/samples/elastic4s-http-client-gradle/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala +++ b/samples/elastic4s-http-client-gradle/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala @@ -15,7 +15,7 @@ object HttpClientExampleApp extends App { client.execute { bulk( indexInto("myindex" / "mytype").fields("country" -> "Mongolia", "capital" -> "Ulaanbaatar"), - indexInto("myindex" / "mytype").fields("country" -> "Namibia", "capital" -> "Windhoek") + indexInto("myindex" / "mytype").fields("country" -> "Namibia", "capital" -> "Windhoek") ).refresh(RefreshPolicy.WaitFor) }.await diff --git a/samples/elastic4s-http-client-maven/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala b/samples/elastic4s-http-client-maven/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala index 42ecbf4f6..58c936cff 100644 --- a/samples/elastic4s-http-client-maven/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala +++ b/samples/elastic4s-http-client-maven/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala @@ -15,7 +15,7 @@ object HttpClientExampleApp extends App { client.execute { bulk( indexInto("myindex" / "mytype").fields("country" -> "Mongolia", "capital" -> "Ulaanbaatar"), - indexInto("myindex" / "mytype").fields("country" -> "Namibia", "capital" -> "Windhoek") + indexInto("myindex" / "mytype").fields("country" -> "Namibia", "capital" -> "Windhoek") ).refresh(RefreshPolicy.WaitFor) }.await diff --git a/samples/elastic4s-http-client-sbt/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala b/samples/elastic4s-http-client-sbt/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala index 42ecbf4f6..58c936cff 100644 --- a/samples/elastic4s-http-client-sbt/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala +++ b/samples/elastic4s-http-client-sbt/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala @@ -15,7 +15,7 @@ object HttpClientExampleApp extends App { client.execute { bulk( indexInto("myindex" / "mytype").fields("country" -> "Mongolia", "capital" -> "Ulaanbaatar"), - indexInto("myindex" / "mytype").fields("country" -> "Namibia", "capital" -> "Windhoek") + indexInto("myindex" / "mytype").fields("country" -> "Namibia", "capital" -> "Windhoek") ).refresh(RefreshPolicy.WaitFor) }.await From e30792fcc321e9b81dd07a8d3eba094f0294d7a3 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 19 Jan 2025 02:28:48 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.8.5' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 5cd2f6ac0..e39981521 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,5 @@ # Initial applied scalafmtAll and scalafmtSbt c1a068b59a36f88401ea646577e4ed61df1e1b4a + +# Scala Steward: Reformat with scalafmt 3.8.5 +fb60074fc43b054aab8aa17c4d5bc87106c7ae9e