Skip to content

Commit

Permalink
Make public static fields get only properties (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 27, 2025
1 parent fc04574 commit fde16d2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591</NoWarn>
<Version>2.4.1</Version>
<Version>3.0.0</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<LangVersion>preview</LangVersion>
<PackageTags>NaughtyStrings, Bogus</PackageTags>
Expand Down
Binary file modified src/NaughtyStrings.Bogus/Naughty.cs
Binary file not shown.
1 change: 1 addition & 0 deletions src/NaughtyStrings.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
appveyor.yml = appveyor.yml
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
global.json = global.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NaughtyStrings", "NaughtyStrings\NaughtyStrings.csproj", "{92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}"
Expand Down
Binary file modified src/NaughtyStrings/TheNaughtyStrings.cs
Binary file not shown.
2 changes: 2 additions & 0 deletions src/Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
global using System.CodeDom;
global using System.CodeDom.Compiler;
global using Bogus;
global using NaughtyStrings;
12 changes: 7 additions & 5 deletions src/Tests/Sync.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.CodeDom;
using System.CodeDom.Compiler;

public class Sync
public class Sync
{
[Fact]
public async Task SyncNaughtyStrings()
Expand Down Expand Up @@ -39,6 +36,8 @@ static void WriteBogus(StreamWriter writer, List<Category> categories)
{
writer.WriteLine(
"""
// <auto-generated />
#pragma warning disable
using Bogus;
namespace NaughtyStrings.Bogus;
Expand Down Expand Up @@ -103,6 +102,9 @@ static void WriteNaughtyStrings(StreamWriter writer, CodeDomProvider provider, L
{
writer.WriteLine(
"""
// <auto-generated />
#pragma warning disable
#if Bogus
namespace NaughtyStrings.Bogus;
#else
Expand Down Expand Up @@ -137,7 +139,7 @@ static void WriteList(StreamWriter writer, CodeDomProvider provider, string name
/// <summary>
/// {{comment}}
/// </summary>
public static IReadOnlyList<string> {{name}} = new List<string>
public static IReadOnlyList<string> {{name}} { get; } = new List<string>
{
""");
foreach (var line in lines)
Expand Down

0 comments on commit fde16d2

Please sign in to comment.