Skip to content

Commit 0eafff9

Browse files
authored
Remove redundant private modifiers (#667)
+semver:patch
1 parent 2c365ad commit 0eafff9

File tree

421 files changed

+1049
-1038
lines changed

Some content is hidden

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

421 files changed

+1049
-1038
lines changed

.editorconfig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ max_line_length = off
1515
csharp_style_namespace_declarations = file_scoped
1616

1717
dotnet_diagnostic.ide0161.severity = warning
18-
dotnet_diagnostic.NUnit1032.severity = suggestion
19-
dotnet_diagnostic.NUnit1028.severity = none
20-
dotnet_diagnostic.NUnit2045.severity = none
18+
dotnet_diagnostic.nunit1032.severity = suggestion
19+
dotnet_diagnostic.nunit1028.severity = none
20+
dotnet_diagnostic.nunit2045.severity = none
2121

2222
# ReSharper properties
2323
resharper_default_private_modifier = implicit
2424

25+
# Microsoft .NET properties
26+
dotnet_style_require_accessibility_modifiers = never:suggestion
27+
2528
[*.cake]
2629
indent_style = space
2730
indent_size = 4

src/Examples.FirstAutomappedProject/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Examples.FirstAutomappedProject;
2222
/// </summary>
2323
class Program
2424
{
25-
private const string DbFile = "firstProgram.db";
25+
const string DbFile = "firstProgram.db";
2626

2727
static void Main()
2828
{
@@ -110,7 +110,7 @@ static AutoPersistenceModel CreateAutomappings()
110110
/// 7: Finally, build the session factory.
111111
/// </summary>
112112
/// <returns></returns>
113-
private static ISessionFactory CreateSessionFactory()
113+
static ISessionFactory CreateSessionFactory()
114114
{
115115
return Fluently.Configure()
116116
.Database(SQLiteConfiguration.Standard
@@ -121,7 +121,7 @@ private static ISessionFactory CreateSessionFactory()
121121
.BuildSessionFactory();
122122
}
123123

124-
private static void BuildSchema(Configuration config)
124+
static void BuildSchema(Configuration config)
125125
{
126126
// delete the existing db on each run
127127
if (File.Exists(DbFile))
@@ -133,7 +133,7 @@ private static void BuildSchema(Configuration config)
133133
.Create(false, true);
134134
}
135135

136-
private static void WriteStorePretty(Store store)
136+
static void WriteStorePretty(Store store)
137137
{
138138
Console.WriteLine(store.Name);
139139
Console.WriteLine(" Products:");

src/Examples.FirstProject/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Examples.FirstProject;
1111

1212
class Program
1313
{
14-
private const string DbFile = "firstProgram.db";
14+
const string DbFile = "firstProgram.db";
1515

1616
static void Main()
1717
{
@@ -76,7 +76,7 @@ static void Main()
7676
Console.ReadKey();
7777
}
7878

79-
private static ISessionFactory CreateSessionFactory()
79+
static ISessionFactory CreateSessionFactory()
8080
{
8181
return Fluently.Configure()
8282
.Database(SQLiteConfiguration.Standard
@@ -87,7 +87,7 @@ private static ISessionFactory CreateSessionFactory()
8787
.BuildSessionFactory();
8888
}
8989

90-
private static void BuildSchema(Configuration config)
90+
static void BuildSchema(Configuration config)
9191
{
9292
// delete the existing db on each run
9393
if (File.Exists(DbFile))
@@ -99,7 +99,7 @@ private static void BuildSchema(Configuration config)
9999
.Create(false, true);
100100
}
101101

102-
private static void WriteStorePretty(Store store)
102+
static void WriteStorePretty(Store store)
103103
{
104104
Console.WriteLine(store.Name);
105105
Console.WriteLine(" Products:");

src/FluentNHibernate.Specs/Automapping/AutoPersistenceModelSpecs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class when_the_automapper_is_ran_to_completion
6262
static FluentConfiguration setup;
6363
static Exception ex;
6464

65-
private static IPersistenceConfigurer CreateStandardInMemoryConfiguration()
65+
static IPersistenceConfigurer CreateStandardInMemoryConfiguration()
6666
{
6767
#if NETFRAMEWORK
6868
var configuration = SQLiteConfiguration.Standard.InMemory();

src/FluentNHibernate.Specs/Automapping/AutomappingSpecs.NestedClasses.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public class PublicAddress
8383
{
8484
public int Id { get; set; }
8585
}
86-
private class PrivateAddress
86+
87+
class PrivateAddress
8788
{
8889
public int Id { get; set; }
8990
}

src/FluentNHibernate.Specs/Automapping/Fixtures/StubTypeSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace FluentNHibernate.Specs.Automapping.Fixtures;
66

7-
internal class StubTypeSource(params Type[] types) : ITypeSource
7+
class StubTypeSource(params Type[] types) : ITypeSource
88
{
99
public IEnumerable<Type> GetTypes()
1010
{

src/FluentNHibernate.Specs/Automapping/OverrideSpecs.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public class when_using_an_automapping_override_to_create_a_join
3636

3737
public class when_using_an_automapping_override_to_specify_a_discriminators_and_join_on_subclass
3838
{
39-
private Establish context = () =>
39+
Establish context = () =>
4040
model = AutoMap.Source(new StubTypeSource(typeof (Parent), typeof (Child)))
4141
.Override<Parent>(map =>
4242
map.DiscriminateSubClassesOnColumn("type"))
4343
.Override<Child>(map => map.Join("table", part => { }));
4444

45-
private Because of = () =>
45+
Because of = () =>
4646
mapping = model.BuildMappingFor<Parent>();
4747

4848
It should_not_create_the_join_mapping = () =>

src/FluentNHibernate.Specs/Conventions/ComponentConventionSpecs.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class when_specifying_component_convention
3131
property.Columns.FirstOrDefault().Name.Should().Be("different");
3232
};
3333

34-
private static FluentNHibernate.PersistenceModel model;
35-
private static ClassMapping mapping;
34+
static FluentNHibernate.PersistenceModel model;
35+
static ClassMapping mapping;
3636
}
3737

3838
public class EntityWithComponent
@@ -49,7 +49,7 @@ public class Address
4949
public string Line2 { get; set; }
5050
}
5151

52-
internal class AddressMap : ComponentMap<Address>
52+
class AddressMap : ComponentMap<Address>
5353
{
5454
public AddressMap()
5555
{

src/FluentNHibernate.Specs/FluentInterface/ClassMapSpecs/ClassMapSpecs.Component.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public class when_class_map_is_told_to_map_a_component_using_a_provider : Provid
3333

3434
Behaves_like<ClasslikeComponentBehaviour> a_component_in_a_classlike;
3535

36-
protected static ClassMapping mapping;
36+
protected static ClassMapping mapping;
3737

38-
private class ComponentMappingProviderStub : IComponentMappingProvider
38+
class ComponentMappingProviderStub : IComponentMappingProvider
3939
{
4040
public IComponentMapping GetComponentMapping()
4141
{

src/FluentNHibernate.Specs/FluentInterface/ComponentMapSpecs.cs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public class when_creating_the_mapping_for_a_component_using_component_map
4747
It should_add_references_to_the_references_collection = () =>
4848
mapping.References.ShouldContain(x => x.Name == "a_reference");
4949

50-
private static ComponentMap<Target> component;
51-
private static ComponentMapping mapping;
50+
static ComponentMap<Target> component;
51+
static ComponentMapping mapping;
5252

53-
private class Target
53+
class Target
5454
{
5555
public string a_property { get; set; }
5656
public Target an_any { get; set; }
@@ -83,16 +83,16 @@ public class when_mapping_a_component_in_an_entity_without_defining_any_mappings
8383
It should_store_the_property_in_the_reference_component_mapping = () =>
8484
(mapping as ReferenceComponentMapping).Member.Name.Should().Be("Component");
8585

86-
private static ClassMap<Target> classmap;
87-
private static IComponentMapping mapping;
86+
static ClassMap<Target> classmap;
87+
static IComponentMapping mapping;
8888

89-
private class Target
89+
class Target
9090
{
9191
public int Id { get; set; }
9292
public Component Component { get; set;}
9393
}
9494

95-
private class Component {}
95+
class Component {}
9696
}
9797

9898
public class when_compiling_the_mappings_with_a_reference_component_in_a_subclass
@@ -131,21 +131,21 @@ public class when_compiling_the_mappings_with_a_reference_component_in_a_subclas
131131
component_mapping.Properties.ShouldContain(x => x.Name == "Property");
132132
};
133133

134-
private static FluentNHibernate.PersistenceModel persistence_model;
135-
private static IEnumerable<HibernateMapping> mappings;
136-
private static ClassMapping class_mapping;
134+
static FluentNHibernate.PersistenceModel persistence_model;
135+
static IEnumerable<HibernateMapping> mappings;
136+
static ClassMapping class_mapping;
137137

138-
private class Target
138+
class Target
139139
{
140140
public int Id { get; set; }
141141
}
142142

143-
private class TargetChild : Target
143+
class TargetChild : Target
144144
{
145145
public Component Component { get; set; }
146146
}
147147

148-
private class Component
148+
class Component
149149
{
150150
public string Property { get; set; }
151151
}
@@ -167,7 +167,7 @@ public class when_compiling_the_mappings_with_a_nested_reference_component_in_a_
167167
static ComponentMap<Component> component_map;
168168
static Exception ex;
169169

170-
private class Component
170+
class Component
171171
{
172172
public Component Compo { get; set; }
173173
}
@@ -203,17 +203,17 @@ public class when_compiling_the_mappings_with_a_reference_component_and_a_relate
203203
component_mapping.Properties.ShouldContain(x => x.Name == "Property");
204204
};
205205

206-
private static FluentNHibernate.PersistenceModel persistence_model;
207-
private static IEnumerable<HibernateMapping> mappings;
208-
private static ClassMapping class_mapping;
206+
static FluentNHibernate.PersistenceModel persistence_model;
207+
static IEnumerable<HibernateMapping> mappings;
208+
static ClassMapping class_mapping;
209209

210-
private class Target
210+
class Target
211211
{
212212
public int Id { get; set; }
213213
public Component Component { get; set; }
214214
}
215215

216-
private class Component
216+
class Component
217217
{
218218
public string Property { get; set; }
219219
}
@@ -259,18 +259,18 @@ public class when_compiling_the_mappings_with_two_of_the_same_reference_componen
259259
.Should().Contain("B_PROP");
260260
};
261261

262-
private static FluentNHibernate.PersistenceModel persistence_model;
263-
private static IEnumerable<HibernateMapping> mappings;
264-
private static ClassMapping class_mapping;
262+
static FluentNHibernate.PersistenceModel persistence_model;
263+
static IEnumerable<HibernateMapping> mappings;
264+
static ClassMapping class_mapping;
265265

266-
private class Target
266+
class Target
267267
{
268268
public int Id { get; set; }
269269
public Component ComponentA { get; set; }
270270
public Component ComponentB { get; set; }
271271
}
272272

273-
private class Component
273+
class Component
274274
{
275275
public string Property { get; set; }
276276
}
@@ -316,23 +316,23 @@ public class when_compiling_the_mappings_with_multiple_nested_component_mappings
316316
.Should().Contain("A_PROP2");
317317
};
318318

319-
private static FluentNHibernate.PersistenceModel persistence_model;
320-
private static IEnumerable<HibernateMapping> mappings;
321-
private static ClassMapping class_mapping;
319+
static FluentNHibernate.PersistenceModel persistence_model;
320+
static IEnumerable<HibernateMapping> mappings;
321+
static ClassMapping class_mapping;
322322

323-
private class Target
323+
class Target
324324
{
325325
public int Id { get; set; }
326326
public Component Component { get; set; }
327327
}
328328

329-
private class Component
329+
class Component
330330
{
331331
public NestedComponent NestedComponent1 { get; set; }
332332
public NestedComponent NestedComponent2 { get; set; }
333333
}
334334

335-
private class NestedComponent
335+
class NestedComponent
336336
{
337337
public string Property { get; set; }
338338
}

0 commit comments

Comments
 (0)