Skip to content

Commit

Permalink
Remove redundant private modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzik committed Mar 26, 2024
1 parent 2c365ad commit 22037d7
Show file tree
Hide file tree
Showing 419 changed files with 1,036 additions and 1,025 deletions.
9 changes: 6 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ max_line_length = off
csharp_style_namespace_declarations = file_scoped

dotnet_diagnostic.ide0161.severity = warning
dotnet_diagnostic.NUnit1032.severity = suggestion
dotnet_diagnostic.NUnit1028.severity = none
dotnet_diagnostic.NUnit2045.severity = none
dotnet_diagnostic.nunit1032.severity = suggestion
dotnet_diagnostic.nunit1028.severity = none
dotnet_diagnostic.nunit2045.severity = none

# ReSharper properties
resharper_default_private_modifier = implicit

# Microsoft .NET properties
dotnet_style_require_accessibility_modifiers = never:suggestion

[*.cake]
indent_style = space
indent_size = 4
Expand Down
8 changes: 4 additions & 4 deletions src/Examples.FirstAutomappedProject/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Examples.FirstAutomappedProject;
/// </summary>
class Program
{
private const string DbFile = "firstProgram.db";
const string DbFile = "firstProgram.db";

static void Main()
{
Expand Down Expand Up @@ -110,7 +110,7 @@ static AutoPersistenceModel CreateAutomappings()
/// 7: Finally, build the session factory.
/// </summary>
/// <returns></returns>
private static ISessionFactory CreateSessionFactory()
static ISessionFactory CreateSessionFactory()
{
return Fluently.Configure()
.Database(SQLiteConfiguration.Standard
Expand All @@ -121,7 +121,7 @@ private static ISessionFactory CreateSessionFactory()
.BuildSessionFactory();
}

private static void BuildSchema(Configuration config)
static void BuildSchema(Configuration config)
{
// delete the existing db on each run
if (File.Exists(DbFile))
Expand All @@ -133,7 +133,7 @@ private static void BuildSchema(Configuration config)
.Create(false, true);
}

private static void WriteStorePretty(Store store)
static void WriteStorePretty(Store store)
{
Console.WriteLine(store.Name);
Console.WriteLine(" Products:");
Expand Down
8 changes: 4 additions & 4 deletions src/Examples.FirstProject/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Examples.FirstProject;

class Program
{
private const string DbFile = "firstProgram.db";
const string DbFile = "firstProgram.db";

static void Main()
{
Expand Down Expand Up @@ -76,7 +76,7 @@ static void Main()
Console.ReadKey();
}

private static ISessionFactory CreateSessionFactory()
static ISessionFactory CreateSessionFactory()
{
return Fluently.Configure()
.Database(SQLiteConfiguration.Standard
Expand All @@ -87,7 +87,7 @@ private static ISessionFactory CreateSessionFactory()
.BuildSessionFactory();
}

private static void BuildSchema(Configuration config)
static void BuildSchema(Configuration config)
{
// delete the existing db on each run
if (File.Exists(DbFile))
Expand All @@ -99,7 +99,7 @@ private static void BuildSchema(Configuration config)
.Create(false, true);
}

private static void WriteStorePretty(Store store)
static void WriteStorePretty(Store store)
{
Console.WriteLine(store.Name);
Console.WriteLine(" Products:");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class when_the_automapper_is_ran_to_completion
static FluentConfiguration setup;
static Exception ex;

private static IPersistenceConfigurer CreateStandardInMemoryConfiguration()
static IPersistenceConfigurer CreateStandardInMemoryConfiguration()
{
#if NETFRAMEWORK
var configuration = SQLiteConfiguration.Standard.InMemory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public class PublicAddress
{
public int Id { get; set; }
}
private class PrivateAddress

class PrivateAddress
{
public int Id { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace FluentNHibernate.Specs.Automapping.Fixtures;

internal class StubTypeSource(params Type[] types) : ITypeSource
class StubTypeSource(params Type[] types) : ITypeSource
{
public IEnumerable<Type> GetTypes()
{
Expand Down
4 changes: 2 additions & 2 deletions src/FluentNHibernate.Specs/Automapping/OverrideSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public class when_using_an_automapping_override_to_create_a_join

public class when_using_an_automapping_override_to_specify_a_discriminators_and_join_on_subclass
{
private Establish context = () =>
Establish context = () =>
model = AutoMap.Source(new StubTypeSource(typeof (Parent), typeof (Child)))
.Override<Parent>(map =>
map.DiscriminateSubClassesOnColumn("type"))
.Override<Child>(map => map.Join("table", part => { }));

private Because of = () =>
Because of = () =>
mapping = model.BuildMappingFor<Parent>();

It should_not_create_the_join_mapping = () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public class when_specifying_component_convention
property.Columns.FirstOrDefault().Name.Should().Be("different");
};

private static FluentNHibernate.PersistenceModel model;
private static ClassMapping mapping;
static FluentNHibernate.PersistenceModel model;
static ClassMapping mapping;
}

public class EntityWithComponent
Expand All @@ -49,7 +49,7 @@ public class Address
public string Line2 { get; set; }
}

internal class AddressMap : ComponentMap<Address>
class AddressMap : ComponentMap<Address>
{
public AddressMap()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class when_class_map_is_told_to_map_a_component_using_a_provider : Provid

Behaves_like<ClasslikeComponentBehaviour> a_component_in_a_classlike;

protected static ClassMapping mapping;
protected static ClassMapping mapping;

private class ComponentMappingProviderStub : IComponentMappingProvider
class ComponentMappingProviderStub : IComponentMappingProvider
{
public IComponentMapping GetComponentMapping()
{
Expand Down
60 changes: 30 additions & 30 deletions src/FluentNHibernate.Specs/FluentInterface/ComponentMapSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public class when_creating_the_mapping_for_a_component_using_component_map
It should_add_references_to_the_references_collection = () =>
mapping.References.ShouldContain(x => x.Name == "a_reference");

private static ComponentMap<Target> component;
private static ComponentMapping mapping;
static ComponentMap<Target> component;
static ComponentMapping mapping;

private class Target
class Target
{
public string a_property { get; set; }
public Target an_any { get; set; }
Expand Down Expand Up @@ -83,16 +83,16 @@ public class when_mapping_a_component_in_an_entity_without_defining_any_mappings
It should_store_the_property_in_the_reference_component_mapping = () =>
(mapping as ReferenceComponentMapping).Member.Name.Should().Be("Component");

private static ClassMap<Target> classmap;
private static IComponentMapping mapping;
static ClassMap<Target> classmap;
static IComponentMapping mapping;

private class Target
class Target
{
public int Id { get; set; }
public Component Component { get; set;}
}

private class Component {}
class Component {}
}

public class when_compiling_the_mappings_with_a_reference_component_in_a_subclass
Expand Down Expand Up @@ -131,21 +131,21 @@ public class when_compiling_the_mappings_with_a_reference_component_in_a_subclas
component_mapping.Properties.ShouldContain(x => x.Name == "Property");
};

private static FluentNHibernate.PersistenceModel persistence_model;
private static IEnumerable<HibernateMapping> mappings;
private static ClassMapping class_mapping;
static FluentNHibernate.PersistenceModel persistence_model;
static IEnumerable<HibernateMapping> mappings;
static ClassMapping class_mapping;

private class Target
class Target
{
public int Id { get; set; }
}

private class TargetChild : Target
class TargetChild : Target
{
public Component Component { get; set; }
}

private class Component
class Component
{
public string Property { get; set; }
}
Expand All @@ -167,7 +167,7 @@ public class when_compiling_the_mappings_with_a_nested_reference_component_in_a_
static ComponentMap<Component> component_map;
static Exception ex;

private class Component
class Component
{
public Component Compo { get; set; }
}
Expand Down Expand Up @@ -203,17 +203,17 @@ public class when_compiling_the_mappings_with_a_reference_component_and_a_relate
component_mapping.Properties.ShouldContain(x => x.Name == "Property");
};

private static FluentNHibernate.PersistenceModel persistence_model;
private static IEnumerable<HibernateMapping> mappings;
private static ClassMapping class_mapping;
static FluentNHibernate.PersistenceModel persistence_model;
static IEnumerable<HibernateMapping> mappings;
static ClassMapping class_mapping;

private class Target
class Target
{
public int Id { get; set; }
public Component Component { get; set; }
}

private class Component
class Component
{
public string Property { get; set; }
}
Expand Down Expand Up @@ -259,18 +259,18 @@ public class when_compiling_the_mappings_with_two_of_the_same_reference_componen
.Should().Contain("B_PROP");
};

private static FluentNHibernate.PersistenceModel persistence_model;
private static IEnumerable<HibernateMapping> mappings;
private static ClassMapping class_mapping;
static FluentNHibernate.PersistenceModel persistence_model;
static IEnumerable<HibernateMapping> mappings;
static ClassMapping class_mapping;

private class Target
class Target
{
public int Id { get; set; }
public Component ComponentA { get; set; }
public Component ComponentB { get; set; }
}

private class Component
class Component
{
public string Property { get; set; }
}
Expand Down Expand Up @@ -316,23 +316,23 @@ public class when_compiling_the_mappings_with_multiple_nested_component_mappings
.Should().Contain("A_PROP2");
};

private static FluentNHibernate.PersistenceModel persistence_model;
private static IEnumerable<HibernateMapping> mappings;
private static ClassMapping class_mapping;
static FluentNHibernate.PersistenceModel persistence_model;
static IEnumerable<HibernateMapping> mappings;
static ClassMapping class_mapping;

private class Target
class Target
{
public int Id { get; set; }
public Component Component { get; set; }
}

private class Component
class Component
{
public NestedComponent NestedComponent1 { get; set; }
public NestedComponent NestedComponent2 { get; set; }
}

private class NestedComponent
class NestedComponent
{
public string Property { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class when_generating_the_output_for_a_resolved_component_reference
referenced_xml.Should().Be(inline_xml);


private static string render_xml(Action<FluentNHibernate.PersistenceModel> addMappings)
static string render_xml(Action<FluentNHibernate.PersistenceModel> addMappings)
{
var model = new FluentNHibernate.PersistenceModel();

Expand All @@ -51,20 +51,20 @@ private static string render_xml(Action<FluentNHibernate.PersistenceModel> addMa
return doc.OuterXml;
}

private static ClassMap<Target> inline_component;
private static ClassMap<Target> reference_component;
private static ComponentMap<Component> external_component;
private static string inline_xml;
private static string referenced_xml;
static ClassMap<Target> inline_component;
static ClassMap<Target> reference_component;
static ComponentMap<Component> external_component;
static string inline_xml;
static string referenced_xml;

private class Target
class Target
{
public int Id { get; set;}
public Component ComponentProperty1 { get; set; }
public Component ComponentProperty2 { get; set; }
}

private class Component
class Component
{
public string Property { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ class EntityWithProperties

class EntityWithPrivateProperties
{
private string Name { get; set; }
string Name { get; set; }
string name;
}
6 changes: 3 additions & 3 deletions src/FluentNHibernate.Specs/Utilities/Fixtures/Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ namespace FluentNHibernate.Specs.Utilities.Fixtures;

public class Target : TargetParent
{
private int IntProperty { get; set; }
private string PrivateProperty { get; set; }
private string privateField;
int IntProperty { get; set; }
string PrivateProperty { get; set; }
string privateField;
protected string ProtectedProperty { get; set; }
protected string protectedField;
public string PublicProperty { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ namespace FluentNHibernate.Specs.Utilities.Fixtures;

public abstract class TargetParent
{
private string SuperProperty { get; set; }
string SuperProperty { get; set; }
}
Loading

0 comments on commit 22037d7

Please sign in to comment.