Skip to content

Commit

Permalink
Auto-format source code
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions Autoformatter committed Feb 11, 2025
1 parent cfbb8ef commit 9060727
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Microsoft.Macios.Generator.DataModel;

readonly partial struct Constructor {

/// <summary>
/// The data of the export attribute used to mark the value as a property binding.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Microsoft.Macios.Generator.DataModel;
/// <summary>
/// Modifiers list.
/// </summary>
public ImmutableArray<SyntaxToken> Modifiers { get; init; } = [];
public ImmutableArray<SyntaxToken> Modifiers { get; init; } = [];

/// <summary>
/// Parameters list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ internal static bool Skip (PropertyDeclarationSyntax propertyDeclarationSyntax,
// we will skip properties if they do not have the [Export] attribute or the [Field] attribute
return !attributes.HasExportAttribute () && !attributes.HasFieldAttribute ();
}

/// <summary>
/// Decide if a method should be ignored as a change.
/// </summary>
Expand Down Expand Up @@ -254,7 +254,7 @@ internal Binding (InterfaceDeclarationSyntax interfaceDeclarationSyntax, INamedT
// all exported methods and then filter accordingly
GetMembers<MethodDeclarationSyntax, Method> (interfaceDeclarationSyntax, context, Skip, Method.TryCreate,
out ImmutableArray<Method> allMethods);
methods = [..allMethods.Where (m => !m.IsConstructor)];
methods = [.. allMethods.Where (m => !m.IsConstructor)];
constructors = allMethods.Where (m => m.IsConstructor)
.Select (m => m.ToConstructor ())
.Where (c => c is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Microsoft.Macios.Generator.DataModel;

readonly partial struct Constructor {

readonly ExportData? overrideExportData;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace Microsoft.Macios.Transformer.Tests.DataModel;

public class BindingMethodTests : BaseTransformerTestClass {

readonly TransformerBindingEqualityComparer comparer = new ();

class TestDataTryCreate : IEnumerable<object []> {
Expand Down Expand Up @@ -69,7 +69,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
Token (SyntaxKind.PartialKeyword)]
}
];

const string noExportedMethods = @"
using System;
using Foundation;
Expand Down Expand Up @@ -112,7 +112,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
Token (SyntaxKind.PartialKeyword)]
}
];

const string simpleExportMethod = @"
using System;
using Foundation;
Expand Down Expand Up @@ -161,8 +161,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
returnType: ReturnTypeForVoid (),
symbolAvailability: availabilityBuilder.ToImmutable (),
attributes: new (),
parameters: [])
{
parameters: []) {
ExportMethodData = new ("testMethod"),
Modifiers = [
Token (SyntaxKind.PublicKeyword),
Expand All @@ -173,7 +172,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
]
}
];

const string methodWithParameters = @"
using System;
using Foundation;
Expand Down Expand Up @@ -238,7 +237,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
]
}
];

const string constructorNoParams = @"
using System;
using Foundation;
Expand Down Expand Up @@ -280,13 +279,12 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
Modifiers = [
Token (SyntaxKind.PublicKeyword),
Token (SyntaxKind.PartialKeyword)],
Constructors= [
Constructors = [
new Constructor (
type: "Test.MyNSArray",
symbolAvailability: availabilityBuilder.ToImmutable (),
attributes: new (),
parameters: [])
{
parameters: []) {
ExportMethodData = new ("initExample"),
Modifiers = [
Token (SyntaxKind.PublicKeyword),
Expand All @@ -296,7 +294,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
]
}
];

const string constructorWithParams = @"
using System;
using Foundation;
Expand Down Expand Up @@ -338,7 +336,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
Modifiers = [
Token (SyntaxKind.PublicKeyword),
Token (SyntaxKind.PartialKeyword)],
Constructors= [
Constructors = [
new Constructor (
type: "Test.MyNSArray",
symbolAvailability: availabilityBuilder.ToImmutable (),
Expand All @@ -349,8 +347,7 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
new ("NullAllowedAttribute"),
]
},
])
{
]) {
ExportMethodData = new ("initExample"),
Modifiers = [
Token (SyntaxKind.PublicKeyword),
Expand All @@ -360,12 +357,12 @@ interface MyNSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRe
]
}
];

}

IEnumerator IEnumerable.GetEnumerator () => GetEnumerator ();
}

[Theory]
[AllSupportedPlatformsClassData<TestDataTryCreate>]
void TryCreateTests (ApplePlatform platform, (string Source, string Path) source, Binding expectedData)
Expand Down

0 comments on commit 9060727

Please sign in to comment.