Skip to content

Commit

Permalink
Code Cleanup (#56)
Browse files Browse the repository at this point in the history
* code cleanup

* remove Directory.Build.props
  • Loading branch information
st0o0 authored Jun 14, 2023
1 parent 984eae9 commit 4136faa
Show file tree
Hide file tree
Showing 49 changed files with 267 additions and 81 deletions.
5 changes: 3 additions & 2 deletions docs/SandCastleDocuments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4451,7 +4451,7 @@
</member>
<member name="T:Flickr.Net.Core.Entities.PlaceInfo">
<summary>
Detailed information about a place. Returned by <see cref="!:IFlickrPlaces.GetInfoAsync(string, string, CancellationToken)"/>.
Detailed information about a place. Returned by <see cref="M:Flickr.Net.Core.IFlickrPlaces.GetInfoAsync(Flickr.Net.Core.Entities.PlaceId,System.Threading.CancellationToken)"/> or <see cref="M:Flickr.Net.Core.IFlickrPlaces.GetInfoAsync(Flickr.Net.Core.Entities.WoeId,System.Threading.CancellationToken)"/>.
</summary>
</member>
<member name="P:Flickr.Net.Core.Entities.PlaceInfo.PlaceId">
Expand Down Expand Up @@ -4720,7 +4720,8 @@
</member>
<member name="T:Flickr.Net.Core.Entities.ShapeData">
<summary>
The shape data supplied by <see cref="!:IFlickrPlaces.GetInfoAsync(string, string, CancellationToken)"/>.
The shape data supplied by <see cref="M:Flickr.Net.Core.IFlickrPlaces.GetInfoAsync(Flickr.Net.Core.Entities.PlaceId,System.Threading.CancellationToken)"/>
or <see cref="M:Flickr.Net.Core.IFlickrPlaces.GetInfoAsync(Flickr.Net.Core.Entities.WoeId,System.Threading.CancellationToken)"/>.
</summary>
<remarks>
See <a
Expand Down
157 changes: 157 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# EditorConfig is awesome:http://EditorConfig.org

# top-most EditorConfig file
root = true

# Don't use tabs for indentation.
[*]
indent_style = space
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
# (Please don't specify an indent_size here; that has too many unintended consequences.)

# Code files
[*.{cs,csx}]
indent_size = 4

# Xml project files
[*.{csproj}]
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# proto
[*.proto]
indent_size = 2

# Dotnet code style settings:
[*.{cs}]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# CSharp code style settings:
[*.cs]
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_indent_labels = one_less_than_current
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
[*.{cs,vb}]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public sealed class GalleryCollection : Collection<Gallery>, IFlickrParsable
public int Total { get; set; }

/// <summary>
/// The owner of these galleries if called from <see cref="IFlickrGalleries.GetListAsync(string, int, int, CancellationToken)"/>.
/// The owner of these galleries if called from <see cref="IFlickrGalleries.GetListAsync(string,
/// int, int, CancellationToken)"/>.
/// </summary>
public string UserId { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace Flickr.Net.Core.Entities.Collections;

/// <summary>
/// A list of gallery photos as returned by <see cref="IFlickrGalleries.GetPhotosAsync(string, PhotoSearchExtras, CancellationToken)"/>
/// A list of gallery photos as returned by <see cref="IFlickrGalleries.GetPhotosAsync(string,
/// PhotoSearchExtras, CancellationToken)"/>
/// </summary>
public sealed class GalleryPhotoCollection : System.Collections.ObjectModel.Collection<GalleryPhoto>, IFlickrParsable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ void IFlickrParsable.Load(XmlReader reader)
reader.Skip();
}
}

3 changes: 2 additions & 1 deletion src/Flickr.Net.Core/Entities/Collections/MemberCollection.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace Flickr.Net.Core.Entities.Collections;

/// <summary>
/// A collection of members returned by the <see cref="IFlickrGroupsMembers.GetListAsync(string, MemberTypes, int, int, CancellationToken)"/> method.
/// A collection of members returned by the <see cref="IFlickrGroupsMembers.GetListAsync(string,
/// MemberTypes, int, int, CancellationToken)"/> method.
/// </summary>
public sealed class MemberCollection : System.Collections.ObjectModel.Collection<Member>, IFlickrParsable
{
Expand Down
3 changes: 0 additions & 3 deletions src/Flickr.Net.Core/Entities/Collections/MethodCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ void IFlickrParsable.Load(XmlReader reader)
reader.Skip();
}
}



Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace Flickr.Net.Core.Entities.Collections;

/// <summary>
/// A collection of photos returned by the <see cref="IFlickrPanda.GetPhotosAsync(string, PhotoSearchExtras, int, int, CancellationToken)"/> methods.
/// A collection of photos returned by the <see cref="IFlickrPanda.GetPhotosAsync(string,
/// PhotoSearchExtras, int, int, CancellationToken)"/> methods.
/// </summary>
public sealed class PandaPhotoCollection : System.Collections.ObjectModel.Collection<Photo>, IFlickrParsable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
namespace Flickr.Net.Core.Entities.Collections;

/// <summary>
/// A collection of photos returned by the <see cref="IFlickrPanda.GetPhotosAsync(string, PhotoSearchExtras, int, int, CancellationToken)"/> methods.
/// A collection of photos returned by the <see cref="IFlickrPanda.GetPhotosAsync(string,
/// PhotoSearchExtras, int, int, CancellationToken)"/> methods.
/// </summary>
public sealed class PeoplePhotoCollection : System.Collections.ObjectModel.Collection<Photo>, IFlickrParsable
{
/// <summary>
/// Only populate for authenticated calls to <see cref="IFlickrPeople.GetPhotosOfAsync(string, PhotoSearchExtras, int, int, CancellationToken)"/>
/// Only populate for authenticated calls to <see cref="IFlickrPeople.GetPhotosOfAsync(string,
/// PhotoSearchExtras, int, int, CancellationToken)"/>
/// </summary>
public int Pages { get; set; }

/// <summary>
/// Only populate for authenticated calls to <see cref="IFlickrPeople.GetPhotosOfAsync(string, PhotoSearchExtras, int, int, CancellationToken)"/>
/// Only populate for authenticated calls to <see cref="IFlickrPeople.GetPhotosOfAsync(string,
/// PhotoSearchExtras, int, int, CancellationToken)"/>
/// </summary>
public int Total { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ void IFlickrParsable.Load(System.Xml.XmlReader reader)
reader.Skip();
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace Flickr.Net.Core.Entities.Collections;

/// <summary>
/// A list of popular photos as returned by <see cref="IFlickrStats.GetPopularPhotosAsync(DateTime, PopularitySort, int, int, CancellationToken)"/>
/// A list of popular photos as returned by <see cref="IFlickrStats.GetPopularPhotosAsync(DateTime,
/// PopularitySort, int, int, CancellationToken)"/>
/// </summary>
public sealed class PopularPhotoCollection : System.Collections.ObjectModel.Collection<PopularPhoto>, IFlickrParsable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace Flickr.Net.Core.Entities.Collections;

/// <summary>
/// The collection of location suggestions returned by <see cref="IFlickrPhotosSuggestions.GetListAsync(string, SuggestionStatus, CancellationToken)"/>.
/// The collection of location suggestions returned by <see
/// cref="IFlickrPhotosSuggestions.GetListAsync(string, SuggestionStatus, CancellationToken)"/>.
/// </summary>
public sealed class SuggestionCollection : Collection<Suggestion>, IFlickrParsable
{
Expand Down
6 changes: 4 additions & 2 deletions src/Flickr.Net.Core/Entities/Context.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Flickr.Net.Core.Entities;

/// <summary>
/// The context of the current photo, as returned by <see cref="IFlickrPhotos.GetContextAsync(string, CancellationToken)"/>, <see
/// cref="IFlickrPhotosets.GetContextAsync(string, string, CancellationToken)"/> and <see cref="IFlickrGroupsPools.GetContextAsync(string, string, CancellationToken)"/> methods.
/// The context of the current photo, as returned by <see
/// cref="IFlickrPhotos.GetContextAsync(string, CancellationToken)"/>, <see
/// cref="IFlickrPhotosets.GetContextAsync(string, string, CancellationToken)"/> and <see
/// cref="IFlickrGroupsPools.GetContextAsync(string, string, CancellationToken)"/> methods.
/// </summary>
public sealed class Context : IFlickrParsable
{
Expand Down
3 changes: 2 additions & 1 deletion src/Flickr.Net.Core/Entities/GalleryPhoto.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace Flickr.Net.Core.Entities;

/// <summary>
/// An instance of a photo returned by <see cref="IFlickrGalleries.GetPhotosAsync(string, PhotoSearchExtras, CancellationToken)"/>.
/// An instance of a photo returned by <see cref="IFlickrGalleries.GetPhotosAsync(string,
/// PhotoSearchExtras, CancellationToken)"/>.
/// </summary>
public class GalleryPhoto : Photo, IFlickrParsable
{
Expand Down
3 changes: 0 additions & 3 deletions src/Flickr.Net.Core/Entities/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ public class Group
[XmlAttribute("members", Form = XmlSchemaForm.Unqualified)]
public int Members { get; set; }
}



1 change: 0 additions & 1 deletion src/Flickr.Net.Core/Entities/GroupCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,3 @@ void IFlickrParsable.Load(System.Xml.XmlReader reader)
reader.Skip();
}
}

9 changes: 4 additions & 5 deletions src/Flickr.Net.Core/Entities/GroupFullInfo.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System.Xml;

namespace Flickr.Net.Core.Entities;
namespace Flickr.Net.Core.Entities;

/// <summary>
/// Provides details of a particular group.
/// </summary>
/// <remarks>
/// Used by the Url methods and <see cref="IFlickrGroups.GetInfoAsync(string, CancellationToken)"/> method. The reason for a <see
/// cref="Group"/> and <see cref="GroupFullInfo"/> are due to xml serialization incompatabilities.
/// Used by the Url methods and <see cref="IFlickrGroups.GetInfoAsync(string, CancellationToken)"/>
/// method. The reason for a <see cref="Group"/> and <see cref="GroupFullInfo"/> are due to xml
/// serialization incompatabilities.
/// </remarks>
public sealed class GroupFullInfo : IFlickrParsable
{
Expand Down
4 changes: 1 addition & 3 deletions src/Flickr.Net.Core/Entities/GroupInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Xml;

namespace Flickr.Net.Core.Entities;
namespace Flickr.Net.Core.Entities;

/// <summary>
/// Information about public groups for a user.
Expand Down
4 changes: 1 addition & 3 deletions src/Flickr.Net.Core/Entities/Interfaces/IFlickrParsable.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Xml;

namespace Flickr.Net.Core.Entities.Interfaces;
namespace Flickr.Net.Core.Entities.Interfaces;

/// <summary>
/// An interface that the classes that are returned by the Flickr API use to enable them to self-deserialize.
Expand Down
4 changes: 2 additions & 2 deletions src/Flickr.Net.Core/Entities/Licenses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace Flickr.Net.Core.Entities;
public sealed class License : IFlickrParsable
{
/// <summary>
/// The ID of the license. Used by <see cref="IFlickrPhotos.GetInfoAsync(string, string, CancellationToken)"/> and <see
/// cref="IFlickrPhotos.GetInfoAsync(string, string, CancellationToken)"/>.
/// The ID of the license. Used by <see cref="IFlickrPhotos.GetInfoAsync(string, string,
/// CancellationToken)"/> and <see cref="IFlickrPhotos.GetInfoAsync(string, string, CancellationToken)"/>.
/// </summary>
public LicenseType LicenseId { get; set; }

Expand Down
5 changes: 4 additions & 1 deletion src/Flickr.Net.Core/Entities/Place.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public sealed class Place : IFlickrParsable
/// <summary>
/// The number of photos the calling user has for this place.
/// </summary>
/// <remarks>Only returned for <see cref="IFlickrPlaces.PlacesForUserAsync(PlaceType, string, string, int, DateTime?, DateTime?, DateTime?, DateTime?, CancellationToken)"/>.</remarks>
/// <remarks>
/// Only returned for <see cref="IFlickrPlaces.PlacesForUserAsync(PlaceType, string, string,
/// int, DateTime?, DateTime?, DateTime?, DateTime?, CancellationToken)"/>.
/// </remarks>
public int? PhotoCount { get; set; }

/// <summary>
Expand Down
8 changes: 6 additions & 2 deletions src/Flickr.Net.Core/Entities/StatReferrer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
namespace Flickr.Net.Core.Entities;

/// <summary>
/// The referrer details returned by <see cref="IFlickrStats.GetCollectionReferrersAsync(DateTime, string, string, int, int, CancellationToken)"/>, <see cref="IFlickrStats.GetPhotoReferrersAsync(DateTime, string, string, int, int, CancellationToken)"/>, <see cref="IFlickrStats.GetPhotosetReferrersAsync(DateTime, string, string, int, int, CancellationToken)"/> and
/// <see cref="IFlickrStats.GetPhotostreamReferrersAsync(DateTime, string, int, int, CancellationToken)"/>.
/// The referrer details returned by <see cref="IFlickrStats.GetCollectionReferrersAsync(DateTime,
/// string, string, int, int, CancellationToken)"/>, <see
/// cref="IFlickrStats.GetPhotoReferrersAsync(DateTime, string, string, int, int,
/// CancellationToken)"/>, <see cref="IFlickrStats.GetPhotosetReferrersAsync(DateTime, string,
/// string, int, int, CancellationToken)"/> and <see
/// cref="IFlickrStats.GetPhotostreamReferrersAsync(DateTime, string, int, int, CancellationToken)"/>.
/// </summary>
public sealed class StatReferrer : IFlickrParsable
{
Expand Down
6 changes: 4 additions & 2 deletions src/Flickr.Net.Core/Entities/Stats.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Flickr.Net.Core.Entities;

/// <summary>
/// The stats returned by <see cref="IFlickrStats.GetPhotoStatsAsync(DateTime, string, CancellationToken)"/>, <see
/// cref="IFlickrStats.GetPhotostreamStatsAsync(DateTime, CancellationToken)"/>, <see cref="IFlickrStats.GetPhotosetStatsAsync(DateTime, string, CancellationToken)"/> and <see cref="IFlickrStats.GetCollectionStatsAsync(DateTime, string, CancellationToken)"/>
/// The stats returned by <see cref="IFlickrStats.GetPhotoStatsAsync(DateTime, string,
/// CancellationToken)"/>, <see cref="IFlickrStats.GetPhotostreamStatsAsync(DateTime,
/// CancellationToken)"/>, <see cref="IFlickrStats.GetPhotosetStatsAsync(DateTime, string,
/// CancellationToken)"/> and <see cref="IFlickrStats.GetCollectionStatsAsync(DateTime, string, CancellationToken)"/>
/// </summary>
public sealed class Stats : IFlickrParsable
{
Expand Down
Loading

0 comments on commit 4136faa

Please sign in to comment.