Skip to content

Commit 33046a2

Browse files
committed
reformat
1 parent a432109 commit 33046a2

File tree

11 files changed

+49
-57
lines changed

11 files changed

+49
-57
lines changed

Modrinth.Net.Test/Modrinth.Net.Test.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Flurl" Version="3.0.7" />
13-
<PackageReference Include="Flurl.Http" Version="3.2.4" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
15-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
16-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
17-
<PackageReference Include="NUnit" Version="3.13.3" />
18-
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
12+
<PackageReference Include="Flurl" Version="3.0.7"/>
13+
<PackageReference Include="Flurl.Http" Version="3.2.4"/>
14+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0"/>
15+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0"/>
16+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1"/>
17+
<PackageReference Include="NUnit" Version="3.13.3"/>
18+
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1"/>
1919
<PackageReference Include="NUnit.Analyzers" Version="3.5.0">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -27,11 +27,11 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<ProjectReference Include="..\Modrinth.Net\Modrinth.Net.csproj" />
30+
<ProjectReference Include="..\Modrinth.Net\Modrinth.Net.csproj"/>
3131
</ItemGroup>
3232

3333
<ItemGroup>
34-
<None Include="appsettings.json" CopyToOutputDirectory="Always" />
34+
<None Include="appsettings.json" CopyToOutputDirectory="Always"/>
3535
</ItemGroup>
3636

3737
</Project>

Modrinth.Net.Test/ModrinthApiTests/EndpointTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public void SetUp()
3131
{
3232
GitHubUsername = "Zechiax",
3333
ProjectName = "Modrinth.Net.Test",
34-
ProjectVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(),
34+
ProjectVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString()
3535
};
36-
36+
3737
_client = new ModrinthClient(url: ModrinthClient.StagingBaseUrl, userAgent: userAgent.ToString(), token: token);
3838
_noAuthClient = new ModrinthClient(url: ModrinthClient.StagingBaseUrl, userAgent: userAgent.ToString());
3939
}

Modrinth.Net.Test/ModrinthApiTests/ProjectEndpointTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using NuGet.Frameworks;
2-
31
namespace Modrinth.Net.Test.ModrinthApiTests;
42

53
[TestFixture]

Modrinth.Net.Test/ModrinthApiTests/SearchTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public async Task Search_WithOffset_ShouldReturnOffsetList(ulong offset)
8282
[Test]
8383
public async Task Search_WithDownloadsSort_ShouldReturnSortedByDownloadsList()
8484
{
85-
var search = await _client.Project.SearchAsync("", Index.Downloads);
85+
var search = await _client.Project.SearchAsync("");
8686

8787
// Check that the list is sorted by downloads
8888
Assert.That(

Modrinth.Net.Test/UserAgentTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@ public void CreateFullUserAgent()
1515
GitHubUsername = "Username",
1616
Contact = "contact@contact.com"
1717
};
18-
18+
1919
Assert.That(userAgent.ToString(), Is.EqualTo("Username/ProjectName/1.0.0 (contact@contact.com)"));
2020
}
21-
21+
2222
[Test]
2323
public void CreateMinimalUserAgent()
2424
{
2525
var userAgent = new UserAgent
2626
{
2727
ProjectName = "ProjectName",
28-
ProjectVersion = "1.0.0",
28+
ProjectVersion = "1.0.0"
2929
};
30-
30+
3131
Assert.That(userAgent.ToString(), Is.EqualTo("ProjectName/1.0.0"));
3232
}
33-
33+
3434
[Test]
3535
public void CreateUserAgentWithNoVersion()
3636
{
3737
var userAgent = new UserAgent
3838
{
39-
ProjectName = "ProjectName",
39+
ProjectName = "ProjectName"
4040
};
41-
41+
4242
Assert.That(userAgent.ToString(), Is.EqualTo("ProjectName"));
4343
}
4444
}

Modrinth.Net/Client/UserAgent.cs

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,32 @@
33
namespace Modrinth.Client;
44

55
/// <summary>
6-
/// Helper class for creating a user agent string for the Modrinth API client
6+
/// Helper class for creating a user agent string for the Modrinth API client
77
/// </summary>
88
public class UserAgent
99
{
1010
/// <summary>
11-
/// Name of the project
11+
/// Name of the project
1212
/// </summary>
1313
public string? ProjectName { get; set; }
14+
1415
/// <summary>
15-
/// Version of the project
16+
/// Version of the project
1617
/// </summary>
1718
public string? ProjectVersion { get; set; }
18-
19+
1920
/// <summary>
20-
/// Email or website of the project
21+
/// Email or website of the project
2122
/// </summary>
2223
public string? Contact { get; set; }
24+
2325
/// <summary>
24-
/// GitHub username of the project
26+
/// GitHub username of the project
2527
/// </summary>
2628
public string? GitHubUsername { get; set; }
2729

2830
/// <summary>
29-
/// Creates a user agent string based on provided information
31+
/// Creates a user agent string based on provided information
3032
/// </summary>
3133
/// <returns></returns>
3234
public override string ToString()
@@ -40,38 +42,29 @@ public override string ToString()
4042
sb.Append(GitHubUsername);
4143
before = true;
4244
}
43-
45+
4446
if (ProjectName != null)
4547
{
46-
if (before)
47-
{
48-
sb.Append('/');
49-
}
48+
if (before) sb.Append('/');
5049
sb.Append(ProjectName);
5150
before = true;
5251
}
53-
52+
5453
if (ProjectVersion != null)
5554
{
56-
if (before)
57-
{
58-
sb.Append('/');
59-
}
55+
if (before) sb.Append('/');
6056
sb.Append(ProjectVersion);
6157
before = true;
6258
}
63-
59+
6460
if (Contact != null)
6561
{
66-
if (before)
67-
{
68-
sb.Append(' ');
69-
}
62+
if (before) sb.Append(' ');
7063
sb.Append('(');
7164
sb.Append(Contact);
7265
sb.Append(')');
7366
}
74-
67+
7568
return sb.ToString();
7669
}
7770
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
namespace Modrinth.Endpoints.Project;
22

33
/// <summary>
4-
/// The dependencies of a project
4+
/// The dependencies of a project
55
/// </summary>
66
public class Dependencies
77
{
88
/// <summary>
9-
/// An array of the projects that the project depends on
9+
/// An array of the projects that the project depends on
1010
/// </summary>
1111
public Models.Project[] Projects { get; set; } = null!;
1212

1313
/// <summary>
14-
/// The versions of the projects that the project depends on
14+
/// The versions of the projects that the project depends on
1515
/// </summary>
1616
public System.Version[] Versions { get; set; } = null!;
1717
}

Modrinth.Net/Endpoints/Project/IProjectApi.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Task<SearchResponse> SearchAsync(
2727
Task<Models.Project> GetAsync(string slugOrId);
2828

2929
/// <summary>
30-
/// Deletes project by slug or ID
30+
/// Deletes project by slug or ID
3131
/// </summary>
3232
/// <param name="slugOrId">The slug or id of the project to be deleted</param>
3333
/// <returns></returns>
@@ -47,12 +47,12 @@ Task<SearchResponse> SearchAsync(
4747
Task<SlugIdValidity> CheckIdSlugValidityAsync(string slugOrId);
4848

4949
/// <summary>
50-
/// Gets the dependencies of a project by slug or ID
50+
/// Gets the dependencies of a project by slug or ID
5151
/// </summary>
5252
/// <param name="slugOrId"> The ID or slug of the project</param>
5353
/// <returns></returns>
5454
Task<Dependencies> GetDependenciesAsync(string slugOrId);
55-
55+
5656
Task FollowAsync(string slugOrId);
5757

5858
Task UnfollowAsync(string slugOrId);

Modrinth.Net/Endpoints/User/IUserApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public interface IUserApi
3030
/// </summary>
3131
/// <returns></returns>
3232
Task<Models.User> GetCurrentAsync();
33-
33+
3434
Task<Notification[]> GetNotificationsAsync(string usernameOrId);
35-
35+
3636
Task<Models.Project[]> GetFollowedProjectsAsync(string usernameOrId);
3737
}

Modrinth.Net/Modrinth.Net.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Flurl" Version="3.0.7" />
29-
<PackageReference Include="Flurl.Http" Version="3.2.4" />
30-
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
28+
<PackageReference Include="Flurl" Version="3.0.7"/>
29+
<PackageReference Include="Flurl.Http" Version="3.2.4"/>
30+
<PackageReference Include="Newtonsoft.Json" Version="13.0.2"/>
3131
</ItemGroup>
3232

3333
</Project>

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ Console.WriteLine(project.Description);
3030

3131
## Info
3232

33-
- This package was previously called 'Modrinth.RestClient', while completely rewriting it, I've decided to rename it to 'Modrinth.Net', continuing the versioning from the previous package
34-
- The old package can be found [here](https://www.nuget.org/packages/Modrinth.RestClient/)
33+
- This package was previously called 'Modrinth.RestClient', while completely rewriting it, I've decided to rename it
34+
to 'Modrinth.Net', continuing the versioning from the previous package
35+
- The old package can be found [here](https://www.nuget.org/packages/Modrinth.RestClient/)

0 commit comments

Comments
 (0)