Skip to content

Commit c3a95fa

Browse files
committed
Fix build warnings
Add pragmas for Obsolete attributes with messages Regenerate documentation in line with source code changes
1 parent c3efdb8 commit c3a95fa

File tree

7 files changed

+75
-61
lines changed

7 files changed

+75
-61
lines changed

docs/asciidoc/aggregations/pipeline/extended-stats-bucket/extended-stats-bucket-aggregation-usage.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ new SearchRequest<Project>()
7272
"extended_stats_commits_per_month": {
7373
"extended_stats_bucket": {
7474
"buckets_path": "projects_started_per_month>commits",
75-
"sigma": 2
75+
"sigma": 2.0
7676
}
7777
}
7878
}

docs/asciidoc/code-standards/naming-conventions.asciidoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ var exceptions = new[]
1919
{
2020
typeof(DateMath)
2121
};
22-
var abstractClasses = typeof(IRequest).Assembly().GetTypes()
22+
var abstractClassesNotEndingInBase = typeof(IRequest).Assembly().GetTypes()
2323
.Where(t => t.IsClass() && t.IsAbstract() && !t.IsSealed() && !exceptions.Contains(t))
2424
.Where(t => !t.Name.Split('`')[0].EndsWith("Base"))
2525
.Select(t => t.Name.Split('`')[0])
2626
.ToList();
27-
abstractClasses.Should().BeEmpty();
27+
abstractClassesNotEndingInBase.Should().BeEmpty();
2828
----
2929

3030
Class names that end with `Base` suffix are abstract
@@ -51,14 +51,14 @@ Request class names should end with `Request`
5151
----
5252
var types = typeof(IRequest).Assembly().GetTypes();
5353
54-
var requests = types
54+
var requestsNotEndingInRequest = types
5555
.Where(t => typeof(IRequest).IsAssignableFrom(t) && !t.IsAbstract())
5656
.Where(t => !typeof(IDescriptor).IsAssignableFrom(t))
5757
.Where(t => !t.Name.Split('`')[0].EndsWith("Request"))
5858
.Select(t => t.Name.Split('`')[0])
5959
.ToList();
6060
61-
requests.Should().BeEmpty();
61+
requestsNotEndingInRequest.Should().BeEmpty();
6262
----
6363

6464
Response class names should end with `Response`
@@ -67,13 +67,13 @@ Response class names should end with `Response`
6767
----
6868
var types = typeof(IRequest).Assembly().GetTypes();
6969
70-
var responses = types
70+
var responsesNotEndingInResponse = types
7171
.Where(t => typeof(IResponse).IsAssignableFrom(t) && !t.IsAbstract())
7272
.Where(t => !t.Name.Split('`')[0].EndsWith("Response"))
7373
.Select(t => t.Name.Split('`')[0])
7474
.ToList();
7575
76-
responses.Should().BeEmpty();
76+
responsesNotEndingInResponse.Should().BeEmpty();
7777
----
7878

7979
Request and Response class names should be one to one in *most* cases.
@@ -100,9 +100,9 @@ var exceptions = new[] <1>
100100
typeof(SourceRequest<>),
101101
typeof(ValidateQueryRequest<>),
102102
typeof(GetAliasRequest),
103-
#pragma warning disable 612
103+
#pragma warning disable 612, 618
104104
typeof(CatNodeattrsRequest),
105-
#pragma warning restore 612
105+
#pragma warning restore 612, 618
106106
typeof(IndicesShardStoresRequest),
107107
typeof(RenderSearchTemplateRequest)
108108
};

docs/asciidoc/query-dsl/bool-dsl/operators/or-operator-usage.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ ReturnsSingleQuery(ConditionlessQuery || Query, q => q.ConditionlessQuery() || q
6060
c => c.Term.Value.Should().NotBeNull());
6161
ReturnsSingleQuery(Query || NullQuery, q => q.Query() || q.NullQuery(),
6262
c => c.Term.Value.Should().NotBeNull());
63-
ReturnsSingleQuery(NullQuery || Query, q=> q.NullQuery() || q.Query(),
63+
ReturnsSingleQuery(NullQuery || Query, q=> q.NullQuery() || q.Query(),
6464
c => c.Term.Value.Should().NotBeNull());
6565
ReturnsSingleQuery(ConditionlessQuery || ConditionlessQuery || ConditionlessQuery || Query,
6666
q => q.ConditionlessQuery() || q.ConditionlessQuery() || q.ConditionlessQuery() || q.Query(),
6767
c => c.Term.Value.Should().NotBeNull());
6868
ReturnsSingleQuery(
69-
NullQuery || NullQuery || ConditionlessQuery || Query,
69+
NullQuery || NullQuery || ConditionlessQuery || Query,
7070
q=>q.NullQuery() || q.NullQuery() || q.ConditionlessQuery() || q.Query(),
7171
c => c.Term.Value.Should().NotBeNull());
7272
ReturnsNull(NullQuery || ConditionlessQuery, q=> q.NullQuery() || q.ConditionlessQuery());

docs/asciidoc/query-dsl/compound/bool/bool-dsl-complex-query-usage.asciidoc

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -72,36 +72,69 @@ Query && Query
7272
"must": [
7373
{
7474
"bool": {
75-
"should": [
75+
"must": [
7676
{
7777
"bool": {
78-
"filter": [
78+
"should": [
7979
{
80-
"term": {
81-
"x": {
82-
"value": "y"
83-
}
80+
"bool": {
81+
"filter": [
82+
{
83+
"term": {
84+
"x": {
85+
"value": "y"
86+
}
87+
}
88+
}
89+
]
90+
}
91+
},
92+
{
93+
"bool": {
94+
"filter": [
95+
{
96+
"term": {
97+
"x": {
98+
"value": "y"
99+
}
100+
}
101+
}
102+
]
103+
}
104+
},
105+
{
106+
"bool": {
107+
"must_not": [
108+
{
109+
"term": {
110+
"x": {
111+
"value": "y"
112+
}
113+
}
114+
},
115+
{
116+
"term": {
117+
"x": {
118+
"value": "y"
119+
}
120+
}
121+
}
122+
]
84123
}
85124
}
86125
]
87126
}
88127
},
89128
{
90129
"bool": {
91-
"filter": [
130+
"should": [
92131
{
93132
"term": {
94133
"x": {
95134
"value": "y"
96135
}
97136
}
98-
}
99-
]
100-
}
101-
},
102-
{
103-
"bool": {
104-
"must_not": [
137+
},
105138
{
106139
"term": {
107140
"x": {
@@ -118,27 +151,6 @@ Query && Query
118151
}
119152
]
120153
}
121-
},
122-
{
123-
"term": {
124-
"x": {
125-
"value": "y"
126-
}
127-
}
128-
},
129-
{
130-
"term": {
131-
"x": {
132-
"value": "y"
133-
}
134-
}
135-
},
136-
{
137-
"term": {
138-
"x": {
139-
"value": "y"
140-
}
141-
}
142154
}
143155
]
144156
}

src/Nest/Cat/CatNodeAttributes/CatNodeAttributesRequest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
#pragma warning disable 612
2+
#pragma warning disable 612, 618
33

44
namespace Nest
55
{
@@ -17,3 +17,5 @@ public interface ICatNodeAttributesRequest : ICatNodeattrsRequest { }
1717
public class CatNodeAttributesRequest : CatNodeattrsRequest, ICatNodeAttributesRequest { }
1818
public class CatNodeAttributesDescriptor : CatNodeattrsDescriptor, ICatNodeAttributesRequest { }
1919
}
20+
21+
#pragma warning restore 612, 618

src/Tests/CodeStandards/NamingConventions.doc.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ [U] public void AbstractClassNamesEndWithBase()
2424
typeof(DateMath)
2525
};
2626

27-
var abstractClasses = typeof(IRequest).Assembly().GetTypes()
27+
var abstractClassesNotEndingInBase = typeof(IRequest).Assembly().GetTypes()
2828
.Where(t => t.IsClass() && t.IsAbstract() && !t.IsSealed() && !exceptions.Contains(t))
2929
.Where(t => !t.Name.Split('`')[0].EndsWith("Base"))
3030
.Select(t => t.Name.Split('`')[0])
3131
.ToList();
3232

33-
abstractClasses.Should().BeEmpty();
33+
abstractClassesNotEndingInBase.Should().BeEmpty();
3434
}
3535

3636
/**
@@ -58,14 +58,14 @@ [U] public void ClassNameContainsBaseShouldBeAbstract()
5858
public void RequestClassNamesEndWithRequest()
5959
{
6060
var types = typeof(IRequest).Assembly().GetTypes();
61-
var requests = types
61+
var requestsNotEndingInRequest = types
6262
.Where(t => typeof(IRequest).IsAssignableFrom(t) && !t.IsAbstract())
6363
.Where(t => !typeof(IDescriptor).IsAssignableFrom(t))
6464
.Where(t => !t.Name.Split('`')[0].EndsWith("Request"))
6565
.Select(t => t.Name.Split('`')[0])
6666
.ToList();
6767

68-
requests.Should().BeEmpty();
68+
requestsNotEndingInRequest.Should().BeEmpty();
6969
}
7070

7171
/**
@@ -75,13 +75,13 @@ public void RequestClassNamesEndWithRequest()
7575
public void ResponseClassNamesEndWithResponse()
7676
{
7777
var types = typeof(IRequest).Assembly().GetTypes();
78-
var responses = types
78+
var responsesNotEndingInResponse = types
7979
.Where(t => typeof(IResponse).IsAssignableFrom(t) && !t.IsAbstract())
8080
.Where(t => !t.Name.Split('`')[0].EndsWith("Response"))
8181
.Select(t => t.Name.Split('`')[0])
8282
.ToList();
8383

84-
responses.Should().BeEmpty();
84+
responsesNotEndingInResponse.Should().BeEmpty();
8585
}
8686

8787
/**
@@ -110,9 +110,9 @@ public void ParityBetweenRequestsAndResponses()
110110
typeof(SourceRequest<>),
111111
typeof(ValidateQueryRequest<>),
112112
typeof(GetAliasRequest),
113-
#pragma warning disable 612
113+
#pragma warning disable 612, 618
114114
typeof(CatNodeattrsRequest),
115-
#pragma warning restore 612
115+
#pragma warning restore 612, 618
116116
typeof(IndicesShardStoresRequest),
117117
typeof(RenderSearchTemplateRequest)
118118
};

src/Tests/QueryDsl/Compound/Bool/BoolDslComplexQueryUsageTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public BoolDslComplexQueryUsageTests(ReadOnlyCluster cluster, EndpointUsage usag
2323
//first bool
2424
new {
2525
@bool = new {
26-
must = new [] {
26+
must = new object[] {
2727
new { term = new { x = new { value = "y" } } },
2828
new { term = new { x = new { value = "y" } } }
2929
}
3030
}
3131
},
3232
new {
3333
@bool = new {
34-
must = new [] {
34+
must = new object[] {
3535
new {
3636
@bool = new {
3737
must = new object[] {
@@ -41,17 +41,17 @@ public BoolDslComplexQueryUsageTests(ReadOnlyCluster cluster, EndpointUsage usag
4141
should = new object[] {
4242
new {
4343
@bool = new {
44-
filter = new [] { new { term = new { x = new { value = "y" } } } }
44+
filter = new object[] { new { term = new { x = new { value = "y" } } } }
4545
}
4646
},
4747
new {
4848
@bool = new {
49-
filter = new [] { new { term = new { x = new { value = "y" } } } }
49+
filter = new object[] { new { term = new { x = new { value = "y" } } } }
5050
}
5151
},
5252
new {
5353
@bool = new {
54-
must_not = new [] {
54+
must_not = new object[] {
5555
new { term = new { x = new { value = "y" } } },
5656
new { term = new { x = new { value = "y" } } }
5757
}
@@ -63,7 +63,7 @@ public BoolDslComplexQueryUsageTests(ReadOnlyCluster cluster, EndpointUsage usag
6363
//simple nested or
6464
new {
6565
@bool = new {
66-
should = new [] {
66+
should = new object[] {
6767
new { term = new { x = new { value = "y" } } },
6868
new { term = new { x = new { value = "y" } } },
6969
new { term = new { x = new { value = "y" } } }

0 commit comments

Comments
 (0)