Skip to content

Commit b79c249

Browse files
committed
- Linting and static analysis
1 parent 91891cd commit b79c249

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

EasyPost.Tests/ServicesTests/Beta/CarrierMetadataServiceTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public async Task TestRetrieve()
4747
public async Task TestRetrieveWithFilters()
4848
{
4949
UseVCR("retrieve_with_filters");
50-
50+
5151
const string carrierName = "usps";
5252

5353
BetaFeatures.Parameters.Beta.CarrierMetadata.Retrieve parameters = new()
5454
{
55-
Carriers = new List<string> { carrierName },
55+
Carriers = new List<string> { carrierName },
5656
Types = new List<CarrierMetadataType> { CarrierMetadataType.ServiceLevels, CarrierMetadataType.PredefinedPackages },
5757
};
5858

EasyPost/BetaFeatures/Parameters/Beta/CarrierMetadata/Retrieve.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,32 @@ namespace EasyPost.BetaFeatures.Parameters.Beta.CarrierMetadata
1212
public sealed class Retrieve : BaseParameters
1313
{
1414
#region Request Parameters
15-
15+
1616
/// <summary>
1717
/// A list of carrier names to retrieve metadata for.
1818
/// </summary>
1919
public List<string>? Carriers { get; set; }
20-
20+
2121
/// <summary>
2222
/// A list of metadata types to retrieve.
2323
/// </summary>
2424
public List<CarrierMetadataType>? Types { get; set; }
2525

2626
#endregion
27-
27+
2828
/// <summary>
2929
/// Override the default <see cref="BaseParameters.ToDictionary"/> method to handle the unique serialization requirements for this parameter set.
3030
/// </summary>
3131
/// <returns>A <see cref="Dictionary{TKey,TValue}"/>.</returns>
3232
internal override Dictionary<string, object> ToDictionary()
3333
{
3434
Dictionary<string, object> data = new();
35-
35+
3636
if (Carriers != null)
3737
{
3838
data.Add("carriers", string.Join(",", Carriers));
3939
}
40-
40+
4141
if (Types != null)
4242
{
4343
data.Add("types", string.Join(",", Types.Select(x => x.ToString())));

EasyPost/Utilities/Internal/Attributes/BaseCustomAttribute.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
43
using System.Reflection;
54

65
namespace EasyPost.Utilities.Internal.Attributes
@@ -20,7 +19,7 @@ internal static IEnumerable<PropertyInfo> GetPropertiesWithAttribute<T>(Type @ty
2019
{
2120
object[] attributes = property.GetCustomAttributes(typeof(T), true);
2221

23-
if (attributes.Any())
22+
if (attributes.Length > 0)
2423
{
2524
matchingProperties.Add(property);
2625
}
@@ -46,7 +45,7 @@ internal static IEnumerable<MethodInfo> GetMethodsWithAttribute<T>(Type @type)
4645
{
4746
object[] attributes = method.GetCustomAttributes(typeof(T), true);
4847

49-
if (attributes.Any())
48+
if (attributes.Length > 0)
5049
{
5150
matchingMethods.Add(method);
5251
}

EasyPost/Utilities/Internal/JsonSerialization.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Dynamic;
4-
using System.Linq;
54
using EasyPost.Exceptions.General;
65
using Newtonsoft.Json;
76
using Newtonsoft.Json.Linq;
@@ -56,7 +55,7 @@ internal static T ConvertJsonToObject<T>(string? data, JsonSerializerSettings? j
5655
// ReSharper disable once MemberCanBePrivate.Global
5756
internal static object ConvertJsonToObject(string? data, Type type, JsonSerializerSettings? jsonSerializerSettings = null, List<string>? rootElementKeys = null)
5857
{
59-
if (rootElementKeys != null && rootElementKeys.Any())
58+
if (rootElementKeys is { Count: > 0 })
6059
{
6160
data = GoToRootElement(data, rootElementKeys);
6261
}

0 commit comments

Comments
 (0)