Skip to content

Commit eda6e96

Browse files
committed
Removed Annotations. Implicit Using. v2.4.0
1 parent ea062f5 commit eda6e96

66 files changed

Lines changed: 394 additions & 753 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,77 @@
22

33
# IDE0042: Deconstruct variable declaration
44
dotnet_diagnostic.IDE0042.severity = none
5+
csharp_using_directive_placement = outside_namespace:silent
6+
csharp_prefer_simple_using_statement = true:suggestion
7+
csharp_prefer_braces = true:silent
8+
csharp_style_namespace_declarations = block_scoped:silent
9+
csharp_style_prefer_method_group_conversion = true:silent
10+
csharp_style_prefer_top_level_statements = true:silent
11+
csharp_style_prefer_primary_constructors = true:suggestion
12+
csharp_style_expression_bodied_methods = false:silent
13+
csharp_style_expression_bodied_constructors = false:silent
14+
csharp_style_expression_bodied_operators = false:silent
15+
csharp_style_expression_bodied_properties = true:silent
16+
csharp_style_expression_bodied_indexers = true:silent
17+
csharp_style_expression_bodied_accessors = true:silent
18+
csharp_style_expression_bodied_lambdas = true:silent
19+
csharp_style_expression_bodied_local_functions = false:silent
20+
csharp_indent_labels = one_less_than_current
21+
22+
[*.{cs,vb}]
23+
#### Naming styles ####
24+
25+
# Naming rules
26+
27+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
28+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
29+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
30+
31+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
32+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
33+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
34+
35+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
36+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
37+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
38+
39+
# Symbol specifications
40+
41+
dotnet_naming_symbols.interface.applicable_kinds = interface
42+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
43+
dotnet_naming_symbols.interface.required_modifiers =
44+
45+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
46+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
47+
dotnet_naming_symbols.types.required_modifiers =
48+
49+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
50+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
51+
dotnet_naming_symbols.non_field_members.required_modifiers =
52+
53+
# Naming styles
54+
55+
dotnet_naming_style.begins_with_i.required_prefix = I
56+
dotnet_naming_style.begins_with_i.required_suffix =
57+
dotnet_naming_style.begins_with_i.word_separator =
58+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
59+
60+
dotnet_naming_style.pascal_case.required_prefix =
61+
dotnet_naming_style.pascal_case.required_suffix =
62+
dotnet_naming_style.pascal_case.word_separator =
63+
dotnet_naming_style.pascal_case.capitalization = pascal_case
64+
65+
dotnet_naming_style.pascal_case.required_prefix =
66+
dotnet_naming_style.pascal_case.required_suffix =
67+
dotnet_naming_style.pascal_case.word_separator =
68+
dotnet_naming_style.pascal_case.capitalization = pascal_case
69+
dotnet_style_coalesce_expression = true:suggestion
70+
dotnet_style_null_propagation = true:suggestion
71+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
72+
dotnet_style_prefer_auto_properties = true:silent
73+
dotnet_style_object_initializer = true:suggestion
74+
dotnet_style_collection_initializer = true:suggestion
75+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
76+
tab_width = 4
77+
indent_size = 4
78+
end_of_line = crlf

GotenbergSharpApiClient.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
limitations under the License.</s:String>
1616
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECodeCleanup_002EFileHeader_002EFileHeaderSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
1717
<s:Boolean x:Key="/Default/UserDictionary/Words/=Backoff/@EntryIndexedValue">True</s:Boolean>
18+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cargman/@EntryIndexedValue">True</s:Boolean>
1819
<s:Boolean x:Key="/Default/UserDictionary/Words/=Consts/@EntryIndexedValue">True</s:Boolean>
1920
<s:Boolean x:Key="/Default/UserDictionary/Words/=deliverables/@EntryIndexedValue">True</s:Boolean>
2021
<s:Boolean x:Key="/Default/UserDictionary/Words/=epub/@EntryIndexedValue">True</s:Boolean>
@@ -24,6 +25,7 @@
2425
<s:Boolean x:Key="/Default/UserDictionary/Words/=fodt/@EntryIndexedValue">True</s:Boolean>
2526
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gotenberg/@EntryIndexedValue">True</s:Boolean>
2627
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gotenberg_0027s/@EntryIndexedValue">True</s:Boolean>
28+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jaben/@EntryIndexedValue">True</s:Boolean>
2729
<s:Boolean x:Key="/Default/UserDictionary/Words/=Libre/@EntryIndexedValue">True</s:Boolean>
2830
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pdfs/@EntryIndexedValue">True</s:Boolean>
2931
<s:Boolean x:Key="/Default/UserDictionary/Words/=potm/@EntryIndexedValue">True</s:Boolean>

lib/Domain/Builders/BaseBuilder.cs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,19 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
using System;
17-
using System.Collections.Generic;
18-
using System.Linq;
19-
using System.Threading.Tasks;
20-
21-
using Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;
22-
using Gotenberg.Sharp.API.Client.Domain.Requests;
23-
using Gotenberg.Sharp.API.Client.Domain.Requests.Facets;
24-
25-
using JetBrains.Annotations;
26-
2716
namespace Gotenberg.Sharp.API.Client.Domain.Builders;
2817

29-
public abstract class BaseBuilder<TRequest, TBuilder>
18+
public abstract class BaseBuilder<TRequest, TBuilder>(TRequest request)
3019
where TRequest : BuildRequestBase
3120
where TBuilder : BaseBuilder<TRequest, TBuilder>
3221
{
33-
protected BaseBuilder(TRequest request)
34-
{
35-
this.Request = request;
36-
}
37-
3822
protected const string CallBuildAsyncErrorMessage =
3923
"Request has asynchronous items. Call BuildAsync instead.";
4024

4125
protected readonly List<Task> BuildTasks = new();
4226

43-
protected virtual TRequest Request { get; }
27+
protected virtual TRequest Request { get; } = request;
4428

45-
[PublicAPI]
4629
public TBuilder ConfigureRequest(Action<ConfigBuilder> action)
4730
{
4831
if (action == null) throw new ArgumentNullException(nameof(action));
@@ -54,23 +37,20 @@ public TBuilder ConfigureRequest(Action<ConfigBuilder> action)
5437
return (TBuilder)this;
5538
}
5639

57-
[PublicAPI]
5840
public TBuilder ConfigureRequest(RequestConfig config)
5941
{
6042
this.Request.Config = config ?? throw new ArgumentNullException(nameof(config));
6143

6244
return (TBuilder)this;
6345
}
6446

65-
[PublicAPI]
6647
public virtual TRequest Build()
6748
{
6849
if (this.BuildTasks.Any()) throw new InvalidOperationException(CallBuildAsyncErrorMessage);
6950

7051
return this.Request;
7152
}
7253

73-
[PublicAPI]
7454
public virtual async Task<TRequest> BuildAsync()
7555
{
7656
if (this.BuildTasks.Any()) await Task.WhenAll(this.BuildTasks).ConfigureAwait(false);

lib/Domain/Builders/BaseChromiumBuilder.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,13 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
using System;
17-
using System.Threading.Tasks;
18-
19-
using Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;
20-
using Gotenberg.Sharp.API.Client.Domain.Requests;
21-
using Gotenberg.Sharp.API.Client.Domain.Requests.Facets;
22-
23-
using JetBrains.Annotations;
24-
2516
namespace Gotenberg.Sharp.API.Client.Domain.Builders;
2617

27-
public abstract class BaseChromiumBuilder<TRequest, TBuilder> : BaseBuilder<TRequest, TBuilder>
18+
public abstract class BaseChromiumBuilder<TRequest, TBuilder>(TRequest request)
19+
: BaseBuilder<TRequest, TBuilder>(request)
2820
where TRequest : ChromeRequest
2921
where TBuilder : BaseChromiumBuilder<TRequest, TBuilder>
3022
{
31-
protected BaseChromiumBuilder([NotNull] TRequest request)
32-
: base(request)
33-
{
34-
}
35-
36-
[PublicAPI]
3723
public TBuilder WithDimensions(Action<DimensionBuilder> action)
3824
{
3925
if (action == null) throw new ArgumentNullException(nameof(action));
@@ -47,38 +33,34 @@ public TBuilder WithDimensions(Action<DimensionBuilder> action)
4733
return (TBuilder)this;
4834
}
4935

50-
[PublicAPI]
5136
public TBuilder WithDimensions(Dimensions dimensions)
5237
{
5338
this.Request.Dimensions = dimensions ?? throw new ArgumentNullException(nameof(dimensions));
5439
return (TBuilder)this;
5540
}
5641

57-
[PublicAPI]
5842
public TBuilder WithAssets(Action<AssetBuilder> action)
5943
{
6044
if (action == null) throw new ArgumentNullException(nameof(action));
6145
action(new AssetBuilder(this.Request.Assets ??= new AssetDictionary()));
6246
return (TBuilder)this;
6347
}
6448

65-
[PublicAPI]
6649
public TBuilder WithAsyncAssets(Func<AssetBuilder, Task> asyncAction)
6750
{
6851
if (asyncAction == null) throw new ArgumentNullException(nameof(asyncAction));
69-
this.BuildTasks.Add(asyncAction(new AssetBuilder(this.Request.Assets ??= new AssetDictionary())));
52+
this.BuildTasks.Add(
53+
asyncAction(new AssetBuilder(this.Request.Assets ??= new AssetDictionary())));
7054
return (TBuilder)this;
7155
}
7256

73-
[PublicAPI]
7457
public TBuilder SetConversionBehaviors(Action<HtmlConversionBehaviorBuilder> action)
7558
{
7659
if (action == null) throw new ArgumentNullException(nameof(action));
7760
action(new HtmlConversionBehaviorBuilder(this.Request.ConversionBehaviors));
7861
return (TBuilder)this;
7962
}
8063

81-
[PublicAPI]
8264
public TBuilder SetConversionBehaviors(HtmlConversionBehaviors behaviors)
8365
{
8466
this.Request.ConversionBehaviors =

lib/Domain/Builders/BaseMergeBuilder.cs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,28 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
using System;
17-
using System.Threading.Tasks;
1816

19-
using Gotenberg.Sharp.API.Client.Domain.Builders.Faceted;
20-
using Gotenberg.Sharp.API.Client.Domain.Requests;
21-
using Gotenberg.Sharp.API.Client.Domain.Requests.Facets;
22-
23-
using JetBrains.Annotations;
2417

2518
namespace Gotenberg.Sharp.API.Client.Domain.Builders;
2619

27-
public abstract class BaseMergeBuilder<TRequest, TBuilder> : BaseBuilder<TRequest, TBuilder>
20+
public abstract class BaseMergeBuilder<TRequest, TBuilder>(TRequest request)
21+
: BaseBuilder<TRequest, TBuilder>(request)
2822
where TRequest : BuildRequestBase
2923
where TBuilder : BaseMergeBuilder<TRequest, TBuilder>
3024
{
31-
protected BaseMergeBuilder(TRequest request)
32-
: base(request)
33-
{
34-
}
35-
3625
/// <summary>
3726
/// This tells gotenberg to have OfficeLibre perform the conversion.
3827
/// If you set <see cref="MergeOfficeRequest.UseNativePdfFormat" /> to true
3928
/// then gotenberg will hand the work off to unoconv to do the work
4029
/// </summary>
41-
[PublicAPI]
30+
4231
public TBuilder SetPdfFormat(PdfFormats format)
4332
{
4433
this.Request.Format = format;
4534
return (TBuilder)this;
4635
}
4736

48-
[PublicAPI]
37+
4938
public TBuilder WithAssets(Action<AssetBuilder> action)
5039
{
5140
if (action == null) throw new ArgumentNullException(nameof(action));
@@ -55,7 +44,7 @@ public TBuilder WithAssets(Action<AssetBuilder> action)
5544
return (TBuilder)this;
5645
}
5746

58-
[PublicAPI]
47+
5948
public TBuilder WithAsyncAssets(Func<AssetBuilder, Task> asyncAction)
6049
{
6150
if (asyncAction == null) throw new ArgumentNullException(nameof(asyncAction));

lib/Domain/Builders/Faceted/AssetBuilder.cs

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
using System;
17-
using System.Collections.Generic;
18-
using System.IO;
19-
using System.Linq;
2016

21-
using Gotenberg.Sharp.API.Client.Domain.Requests;
22-
using Gotenberg.Sharp.API.Client.Domain.Requests.Facets;
23-
using Gotenberg.Sharp.API.Client.Extensions;
24-
25-
using JetBrains.Annotations;
2617

2718
namespace Gotenberg.Sharp.API.Client.Domain.Builders.Faceted
2819
{
@@ -35,7 +26,7 @@ internal AssetBuilder(AssetDictionary assets)
3526
this._assets = assets;
3627
}
3728

38-
[PublicAPI]
29+
3930
public AssetBuilder AddItem(string name, ContentItem value)
4031
{
4132
// ReSharper disable once ComplexConditionExpression
@@ -52,23 +43,23 @@ public AssetBuilder AddItem(string name, ContentItem value)
5243
return this;
5344
}
5445

55-
[PublicAPI]
46+
5647
public AssetBuilder AddItem(string name, string value) =>
5748
AddItem(name, new ContentItem(value));
5849

59-
[PublicAPI]
50+
6051
public AssetBuilder AddItem(string name, byte[] value) =>
6152
AddItem(name, new ContentItem(value));
6253

63-
[PublicAPI]
54+
6455
public AssetBuilder AddItem(string name, Stream value) =>
6556
AddItem(name, new ContentItem(value));
6657

6758
#region 'n' assets
6859

6960
#region from dictionaries
7061

71-
[PublicAPI]
62+
7263
public AssetBuilder AddItems(Dictionary<string, ContentItem>? items)
7364
{
7465
foreach (var item in items.IfNullEmpty())
@@ -79,43 +70,43 @@ public AssetBuilder AddItems(Dictionary<string, ContentItem>? items)
7970
return this;
8071
}
8172

82-
[PublicAPI]
73+
8374
public AssetBuilder AddItems(Dictionary<string, string>? assets) =>
8475
AddItems(assets?.ToDictionary(a => a.Key, a => new ContentItem(a.Value)));
8576

86-
[PublicAPI]
77+
8778
public AssetBuilder AddItems(Dictionary<string, byte[]>? assets) =>
8879
AddItems(assets?.ToDictionary(a => a.Key, a => new ContentItem(a.Value)));
8980

90-
[PublicAPI]
81+
9182
public AssetBuilder AddItems(Dictionary<string, Stream>? assets) =>
9283
AddItems(assets?.ToDictionary(a => a.Key, a => new ContentItem(a.Value)));
9384

9485
#endregion
9586

9687
#region from KVP enumerables
9788

98-
[PublicAPI]
89+
9990
public AssetBuilder AddItems(IEnumerable<KeyValuePair<string, ContentItem>> assets) =>
10091
AddItems(
10192
new Dictionary<string, ContentItem>(
10293
assets?.ToDictionary(a => a.Key, a => a.Value) ??
10394
throw new ArgumentNullException(nameof(assets))));
10495

105-
[PublicAPI]
96+
10697
public AssetBuilder AddItems(IEnumerable<KeyValuePair<string, string>> assets) =>
10798
AddItems(
10899
new Dictionary<string, ContentItem>(
109100
assets?.ToDictionary(a => a.Key, a => new ContentItem(a.Value)) ??
110101
throw new ArgumentNullException(nameof(assets))));
111102

112-
[PublicAPI]
103+
113104
public AssetBuilder AddItems(IEnumerable<KeyValuePair<string, byte[]>> assets) =>
114105
AddItems(
115106
assets?.ToDictionary(a => a.Key, a => new ContentItem(a.Value)) ??
116107
throw new ArgumentNullException(nameof(assets)));
117108

118-
[PublicAPI]
109+
119110
public AssetBuilder AddItems(IEnumerable<KeyValuePair<string, Stream>> assets) =>
120111
AddItems(
121112
assets?.ToDictionary(s => s.Key, a => new ContentItem(a.Value)) ??

0 commit comments

Comments
 (0)