Skip to content

Commit d3283ad

Browse files
author
Adam Hathcock
committed
Some formatting and build fixes
1 parent 735185e commit d3283ad

Some content is hidden

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

78 files changed

+2534
-2015
lines changed

.config/dotnet-tools.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"version": 1,
33
"isRoot": true,
44
"tools": {
5-
"dotnet-format": {
6-
"version": "5.1.225507",
5+
"csharpier": {
6+
"version": "0.25.0",
77
"commands": [
8-
"dotnet-format"
8+
"dotnet-csharpier"
99
]
1010
}
1111
}
12-
}
12+
}

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ dotnet_diagnostic.CA1725.severity = suggestion
279279
dotnet_diagnostic.CA1805.severity = suggestion
280280
dotnet_diagnostic.CA1816.severity = suggestion
281281
dotnet_diagnostic.CA1822.severity = suggestion
282+
dotnet_diagnostic.CA1824.severity = none
282283
dotnet_diagnostic.CA1825.severity = error
283284
dotnet_diagnostic.CA1826.severity = silent
284285
dotnet_diagnostic.CA1827.severity = error

build/Program.cs

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
const string Format = "format";
1212
const string Publish = "publish";
1313

14-
Target(Clean,
14+
Target(
15+
Clean,
1516
ForEach("publish", "**/bin", "**/obj"),
1617
dir =>
1718
{
@@ -33,18 +34,23 @@ void RemoveDirectory(string d)
3334
{
3435
RemoveDirectory(d);
3536
}
36-
});
37+
}
38+
);
3739

38-
39-
Target(Format, () =>
40-
{
41-
Run("dotnet", "tool restore");
42-
Run("dotnet", "format --check");
43-
});
40+
Target(
41+
Format,
42+
() =>
43+
{
44+
Run("dotnet", "tool restore");
45+
Run("dotnet", "format --check");
46+
}
47+
);
4448

4549
Target(Build, DependsOn(Format), () => Run("dotnet", "build . -c Release"));
4650

47-
Target(Test, DependsOn(Build),
51+
Target(
52+
Test,
53+
DependsOn(Build),
4854
() =>
4955
{
5056
IEnumerable<string> GetFiles(string d)
@@ -56,16 +62,21 @@ IEnumerable<string> GetFiles(string d)
5662
{
5763
Run("dotnet", $"test {file} -c Release --no-restore --no-build --verbosity=normal");
5864
}
59-
});
65+
}
66+
);
6067

61-
Target(Publish, DependsOn(Test),
68+
Target(
69+
Publish,
70+
DependsOn(Test),
6271
ForEach("src/Conduit"),
6372
project =>
6473
{
65-
Run("dotnet",
66-
$"publish {project} -c Release -f net5.0 -o ./publish --no-restore --no-build --verbosity=normal");
67-
});
74+
Run(
75+
"dotnet",
76+
$"publish {project} -c Release -f net5.0 -o ./publish --no-restore --no-build --verbosity=normal"
77+
);
78+
}
79+
);
6880

6981
Target("default", DependsOn(Publish), () => Console.WriteLine("Done!"));
7082
await RunTargetsAndExitAsync(args);
71-

src/Conduit/Domain/Article.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,42 @@
44
using System.Linq;
55
using System.Text.Json.Serialization;
66

7-
namespace Conduit.Domain
7+
namespace Conduit.Domain;
8+
9+
public class Article
810
{
9-
public class Article
10-
{
11-
[JsonIgnore]
12-
public int ArticleId { get; set; }
11+
[JsonIgnore]
12+
public int ArticleId { get; set; }
1313

14-
public string? Slug { get; set; }
14+
public string? Slug { get; set; }
1515

16-
public string? Title { get; set; }
16+
public string? Title { get; set; }
1717

18-
public string? Description { get; set; }
18+
public string? Description { get; set; }
1919

20-
public string? Body { get; set; }
20+
public string? Body { get; set; }
2121

22-
public Person? Author { get; set; }
22+
public Person? Author { get; set; }
2323

24-
public List<Comment> Comments { get; set; } = new();
24+
public List<Comment> Comments { get; set; } = new();
2525

26-
[NotMapped]
27-
public bool Favorited => ArticleFavorites?.Any() ?? false;
26+
[NotMapped]
27+
public bool Favorited => ArticleFavorites?.Any() ?? false;
2828

29-
[NotMapped]
30-
public int FavoritesCount => ArticleFavorites?.Count ?? 0;
29+
[NotMapped]
30+
public int FavoritesCount => ArticleFavorites?.Count ?? 0;
3131

32-
[NotMapped]
33-
public List<string> TagList => ArticleTags.Where(x => x.TagId is not null).Select(x => x.TagId!).ToList();
32+
[NotMapped]
33+
public List<string> TagList =>
34+
ArticleTags.Where(x => x.TagId is not null).Select(x => x.TagId!).ToList();
3435

35-
[JsonIgnore]
36-
public List<ArticleTag> ArticleTags { get; set; } = new();
36+
[JsonIgnore]
37+
public List<ArticleTag> ArticleTags { get; set; } = new();
3738

38-
[JsonIgnore]
39-
public List<ArticleFavorite> ArticleFavorites { get; set; } = new();
39+
[JsonIgnore]
40+
public List<ArticleFavorite> ArticleFavorites { get; set; } = new();
4041

41-
public DateTime CreatedAt { get; set; }
42+
public DateTime CreatedAt { get; set; }
4243

43-
public DateTime UpdatedAt { get; set; }
44-
}
45-
}
44+
public DateTime UpdatedAt { get; set; }
45+
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
namespace Conduit.Domain
1+
namespace Conduit.Domain;
2+
3+
public class ArticleFavorite
24
{
3-
public class ArticleFavorite
4-
{
5-
public int ArticleId { get; set; }
6-
public Article? Article { get; set; }
5+
public int ArticleId { get; set; }
6+
public Article? Article { get; set; }
77

8-
public int PersonId { get; set; }
9-
public Person? Person { get; set; }
10-
}
11-
}
8+
public int PersonId { get; set; }
9+
public Person? Person { get; set; }
10+
}

src/Conduit/Domain/ArticleTag.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
namespace Conduit.Domain
1+
namespace Conduit.Domain;
2+
3+
public class ArticleTag
24
{
3-
public class ArticleTag
4-
{
5-
public int ArticleId { get; set; }
6-
public Article? Article { get; set; }
5+
public int ArticleId { get; set; }
6+
public Article? Article { get; set; }
77

8-
public string? TagId { get; set; }
9-
public Tag? Tag { get; set; }
10-
}
11-
}
8+
public string? TagId { get; set; }
9+
public Tag? Tag { get; set; }
10+
}

src/Conduit/Domain/Comment.cs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
using System;
22
using System.Text.Json.Serialization;
33

4-
namespace Conduit.Domain
4+
namespace Conduit.Domain;
5+
6+
public class Comment
57
{
6-
public class Comment
7-
{
8-
[JsonPropertyName("id")]
9-
public int CommentId { get; set; }
8+
[JsonPropertyName("id")]
9+
public int CommentId { get; set; }
1010

11-
public string? Body { get; set; }
11+
public string? Body { get; set; }
1212

13-
public Person? Author { get; set; }
13+
public Person? Author { get; set; }
1414

15-
[JsonIgnore]
16-
public int AuthorId { get; set; }
15+
[JsonIgnore]
16+
public int AuthorId { get; set; }
1717

18-
[JsonIgnore]
19-
public Article? Article { get; set; }
18+
[JsonIgnore]
19+
public Article? Article { get; set; }
2020

21-
[JsonIgnore]
22-
public int ArticleId { get; set; }
21+
[JsonIgnore]
22+
public int ArticleId { get; set; }
2323

24-
public DateTime CreatedAt { get; set; }
24+
public DateTime CreatedAt { get; set; }
2525

26-
public DateTime UpdatedAt { get; set; }
27-
}
28-
}
26+
public DateTime UpdatedAt { get; set; }
27+
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
namespace Conduit.Domain
1+
namespace Conduit.Domain;
2+
3+
public class FollowedPeople
24
{
3-
public class FollowedPeople
4-
{
5-
public int ObserverId { get; set; }
6-
public Person? Observer { get; set; }
5+
public int ObserverId { get; set; }
6+
public Person? Observer { get; set; }
77

8-
public int TargetId { get; set; }
9-
public Person? Target { get; set; }
10-
}
11-
}
8+
public int TargetId { get; set; }
9+
public Person? Target { get; set; }
10+
}

src/Conduit/Domain/Person.cs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,33 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44

5-
namespace Conduit.Domain
5+
namespace Conduit.Domain;
6+
7+
public class Person
68
{
7-
public class Person
8-
{
9-
[JsonIgnore]
10-
public int PersonId { get; set; }
9+
[JsonIgnore]
10+
public int PersonId { get; set; }
1111

12-
public string? Username { get; set; }
12+
public string? Username { get; set; }
1313

14-
public string? Email { get; set; }
14+
public string? Email { get; set; }
1515

16-
public string? Bio { get; set; }
16+
public string? Bio { get; set; }
1717

18-
public string? Image { get; set; }
18+
public string? Image { get; set; }
1919

20-
[JsonIgnore]
21-
public List<ArticleFavorite> ArticleFavorites { get; set; } = new();
20+
[JsonIgnore]
21+
public List<ArticleFavorite> ArticleFavorites { get; set; } = new();
2222

23-
[JsonIgnore]
24-
public List<FollowedPeople> Following { get; set; } = new();
23+
[JsonIgnore]
24+
public List<FollowedPeople> Following { get; set; } = new();
2525

26-
[JsonIgnore]
27-
public List<FollowedPeople> Followers { get; set; } = new();
26+
[JsonIgnore]
27+
public List<FollowedPeople> Followers { get; set; } = new();
2828

29-
[JsonIgnore]
30-
public byte[] Hash { get; set; } = Array.Empty<byte>();
29+
[JsonIgnore]
30+
public byte[] Hash { get; set; } = Array.Empty<byte>();
3131

32-
[JsonIgnore]
33-
public byte[] Salt { get; set; } = Array.Empty<byte>();
34-
}
35-
}
32+
[JsonIgnore]
33+
public byte[] Salt { get; set; } = Array.Empty<byte>();
34+
}

src/Conduit/Domain/Tag.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System.Collections.Generic;
22

3-
namespace Conduit.Domain
3+
namespace Conduit.Domain;
4+
5+
public class Tag
46
{
5-
public class Tag
6-
{
7-
public string? TagId { get; set; }
7+
public string? TagId { get; set; }
88

9-
public List<ArticleTag> ArticleTags { get; set; } = new();
10-
}
11-
}
9+
public List<ArticleTag> ArticleTags { get; set; } = new();
10+
}

0 commit comments

Comments
 (0)