Skip to content

Commit

Permalink
Reformat Core again! (specklesystems#2432)
Browse files Browse the repository at this point in the history
* fix(tasks):Ignore triangles

* Reformat core final final

---------

Co-authored-by: Alan Rynne <[email protected]>
  • Loading branch information
JR-Morgan and AlanRynne authored Apr 14, 2023
1 parent 681cdbe commit 17e115c
Show file tree
Hide file tree
Showing 84 changed files with 380 additions and 1,221 deletions.
31 changes: 22 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
"label": "speckle.format.style",
"command": "dotnet",
"type": "shell",
"args": ["format", "style", "${input:projectPath}"],
"args": [
"format",
"style",
"${input:projectPath}",
"--exclude=Objects/Converters/StructuralUtilities/Triangle"
],
"group": "build",
"problemMatcher": "$msCompile",
"hide": true,
Expand All @@ -46,7 +51,12 @@
"label": "speckle.format.whitespace",
"command": "dotnet",
"type": "shell",
"args": ["format", "whitespace", "${input:projectPath}"],
"args": [
"format",
"whitespace",
"${input:projectPath}",
"--exclude=Objects/Converters/StructuralUtilities/Triangle"
],
"group": "build",
"problemMatcher": "$msCompile",
"hide": true,
Expand All @@ -59,7 +69,12 @@
"label": "speckle.format.analyzers",
"command": "dotnet",
"type": "shell",
"args": ["format", "analyzers", "${input:projectPath}"],
"args": [
"format",
"analyzers",
"${input:projectPath}",
"--exclude=Objects/Converters/StructuralUtilities/Triangle"
],
"group": "build",
"problemMatcher": "$msCompile",
"hide": false,
Expand All @@ -79,7 +94,9 @@
"cleanupcode",
"${input:projectPath}",
"--profile=\"Speckle:Cleanup\"",
"--settings=\"All.sln.DotSettings\""
"--settings=\"All.sln.DotSettings\"",
"--exclude=Objects/Converters/StructuralUtilities/Triangle",
"--properties:WarningLevel=0"
],
"group": "build",
"problemMatcher": [],
Expand All @@ -91,11 +108,7 @@
},
{
"label": "Speckle: Format Code",
"dependsOn": [
"speckle.format.whitespace",
"speckle.format.style",
"speckle.format.csharpier"
],
"dependsOn": ["speckle.format.style", "speckle.format.csharpier"],
"dependsOrder": "sequence",
"problemMatcher": []
},
Expand Down
6 changes: 0 additions & 6 deletions Core/.csharpierrc

This file was deleted.

19 changes: 3 additions & 16 deletions Core/Core/Api/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,14 @@ public class SpeckleGraphQLException<T> : SpeckleException
private GraphQLRequest _request;
public GraphQLResponse<T>? Response;

public SpeckleGraphQLException(
string message,
GraphQLRequest request,
GraphQLResponse<T>? response
)
public SpeckleGraphQLException(string message, GraphQLRequest request, GraphQLResponse<T>? response)
: base(message)
{
_request = request;
Response = response;
}

public SpeckleGraphQLException(
string message,
Exception inner,
GraphQLRequest request,
GraphQLResponse<T>? response
)
public SpeckleGraphQLException(string message, Exception inner, GraphQLRequest request, GraphQLResponse<T>? response)
: base(message, inner) { }

public SpeckleGraphQLException() { }
Expand All @@ -51,11 +42,7 @@ public SpeckleGraphQLException(string message, Exception innerException)

public class SpeckleGraphQLException : SpeckleGraphQLException<object>
{
public SpeckleGraphQLException(
string message,
GraphQLRequest request,
GraphQLResponse<object>? response
)
public SpeckleGraphQLException(string message, GraphQLRequest request, GraphQLResponse<object>? response)
: base(message, request, response) { }

public SpeckleGraphQLException() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,7 @@ public Task<List<ActivityItem>> StreamGetActivity(
int limit = 10
)
{
return StreamGetActivity(
CancellationToken.None,
streamId,
after,
before,
cursor,
actionType,
limit
);
return StreamGetActivity(CancellationToken.None, streamId, after, before, cursor, actionType, limit);
}

/// <summary>
Expand Down Expand Up @@ -94,8 +86,7 @@ public async Task<List<ActivityItem>> StreamGetActivity(
}
};

var res = await ExecuteGraphQLRequest<StreamData>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<StreamData>(request, cancellationToken).ConfigureAwait(false);
return res.stream.activity.items;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ public partial class Client
/// <param name="branchesLimit">Max number of branches to retrieve</param>
/// <param name="commitsLimit">Max number of commits to retrieve</param>
/// <returns></returns>
public Task<List<Branch>> StreamGetBranches(
string streamId,
int branchesLimit = 10,
int commitsLimit = 10
)
public Task<List<Branch>> StreamGetBranches(string streamId, int branchesLimit = 10, int commitsLimit = 10)
{
return StreamGetBranches(CancellationToken.None, streamId, branchesLimit, commitsLimit);
}
Expand Down Expand Up @@ -73,8 +69,7 @@ public async Task<List<Branch>> StreamGetBranches(
}}",
Variables = new { streamId }
};
var res = await ExecuteGraphQLRequest<StreamData>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<StreamData>(request, cancellationToken).ConfigureAwait(false);
return res.stream.branches.items;
}

Expand All @@ -93,20 +88,15 @@ public Task<string> BranchCreate(BranchCreateInput branchInput)
/// </summary>
/// <param name="branchInput"></param>
/// <returns>The branch id.</returns>
public async Task<string> BranchCreate(
CancellationToken cancellationToken,
BranchCreateInput branchInput
)
public async Task<string> BranchCreate(CancellationToken cancellationToken, BranchCreateInput branchInput)
{
var request = new GraphQLRequest
{
Query =
@"mutation branchCreate($myBranch: BranchCreateInput!){ branchCreate(branch: $myBranch)}",
Query = @"mutation branchCreate($myBranch: BranchCreateInput!){ branchCreate(branch: $myBranch)}",
Variables = new { myBranch = branchInput }
};

var res = await ExecuteGraphQLRequest<Dictionary<string, object>>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<Dictionary<string, object>>(request, cancellationToken).ConfigureAwait(false);
return (string)res["branchCreate"];
}

Expand Down Expand Up @@ -166,8 +156,7 @@ public async Task<Branch> BranchGet(
Variables = new { streamId, branchName }
};

var res = await ExecuteGraphQLRequest<StreamData>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<StreamData>(request, cancellationToken).ConfigureAwait(false);
return res.stream.branch;
}

Expand All @@ -186,20 +175,15 @@ public Task<bool> BranchUpdate(BranchUpdateInput branchInput)
/// </summary>
/// <param name="branchInput"></param>
/// <returns>The stream's id.</returns>
public async Task<bool> BranchUpdate(
CancellationToken cancellationToken,
BranchUpdateInput branchInput
)
public async Task<bool> BranchUpdate(CancellationToken cancellationToken, BranchUpdateInput branchInput)
{
var request = new GraphQLRequest
{
Query =
@"mutation branchUpdate($myBranch: BranchUpdateInput!){ branchUpdate(branch: $myBranch)}",
Query = @"mutation branchUpdate($myBranch: BranchUpdateInput!){ branchUpdate(branch: $myBranch)}",
Variables = new { myBranch = branchInput }
};

var res = await ExecuteGraphQLRequest<Dictionary<string, object>>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<Dictionary<string, object>>(request, cancellationToken).ConfigureAwait(false);
return (bool)res["branchUpdate"];
}

Expand All @@ -218,20 +202,15 @@ public Task<bool> BranchDelete(BranchDeleteInput branchInput)
/// </summary>
/// <param name="branchInput"></param>
/// <returns></returns>
public async Task<bool> BranchDelete(
CancellationToken cancellationToken,
BranchDeleteInput branchInput
)
public async Task<bool> BranchDelete(CancellationToken cancellationToken, BranchDeleteInput branchInput)
{
var request = new GraphQLRequest
{
Query =
@"mutation branchDelete($myBranch: BranchDeleteInput!){ branchDelete(branch: $myBranch)}",
Query = @"mutation branchDelete($myBranch: BranchDeleteInput!){ branchDelete(branch: $myBranch)}",
Variables = new { myBranch = branchInput }
};

var res = await ExecuteGraphQLRequest<Dictionary<string, object>>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<Dictionary<string, object>>(request, cancellationToken).ConfigureAwait(false);
return (bool)res["branchDelete"];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ public async Task<Comments> StreamGetComments(
}
};

var res = await ExecuteGraphQLRequest<CommentsData>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<CommentsData>(request, cancellationToken).ConfigureAwait(false);
return res.comments;
}

Expand All @@ -107,11 +106,7 @@ public Task<string> StreamGetCommentScreenshot(string id, string streamId)
/// <param name="streamId">Id of the stream to get the comment from</param>
/// <returns></returns>
/// <exception cref="SpeckleException"></exception>
public async Task<string> StreamGetCommentScreenshot(
CancellationToken cancellationToken,
string id,
string streamId
)
public async Task<string> StreamGetCommentScreenshot(CancellationToken cancellationToken, string id, string streamId)
{
var request = new GraphQLRequest
{
Expand All @@ -126,8 +121,7 @@ string streamId
Variables = new { id, streamId }
};

var res = await ExecuteGraphQLRequest<CommentItemData>(request, cancellationToken)
.ConfigureAwait(false);
var res = await ExecuteGraphQLRequest<CommentItemData>(request, cancellationToken).ConfigureAwait(false);
return res.comment.screenshot;
}
}
Loading

0 comments on commit 17e115c

Please sign in to comment.