Skip to content

Commit 45bcdac

Browse files
committed
Merge branch 'release/2.4.0'
2 parents 7d03f8d + eda6e96 commit 45bcdac

File tree

68 files changed

+417
-749
lines changed

Some content is hidden

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

68 files changed

+417
-749
lines changed

.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

.github/workflows/deploy.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ on: [push, pull_request]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
dotnet-version: [8.x]
811

912
steps:
1013
- name: Checkout
11-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1215
with:
1316
fetch-depth: 0
14-
17+
1518
- name: Setup Dotnet
16-
uses: actions/setup-dotnet@v1
19+
uses: actions/setup-dotnet@v4
1720
with:
18-
dotnet-version: 8.0.x
21+
dotnet-version: ${{ matrix.dotnet-version }}
1922

2023
- name: Install GitVersion
2124
uses: gittools/actions/gitversion/setup@v1.1.1
@@ -34,4 +37,5 @@ jobs:
3437
- name: Publish
3538
if: github.event_name != 'pull_request' && (github.ref_name == 'master')
3639
run: |
37-
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' --skip-duplicate -k ${{ secrets.NUGETKEY }} --no-symbols 1
40+
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate
41+
dotnet nuget push **/*.snupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate

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));

0 commit comments

Comments
 (0)