Skip to content

Commit

Permalink
Statement must not use unnecessary parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Feb 7, 2023
1 parent 466baaf commit 87c4fb6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ dotnet_diagnostic.IDE0073.severity = warning # Enforce file header
file_header_template = Copyright (c) by Terradue Srl. All Rights Reserved.\nLicense under the AGPL, Version 3.0.\nFile Name: {fileName}

dotnet_diagnostic.SA1101.severity = warning # Prefix local calls with this
dotnet_diagnostic.SA1119.severity = warning # Statement must not use unnecessary parenthesis
dotnet_diagnostic.SA1124.severity = warning # Do not use regions
dotnet_diagnostic.SA1127.severity = warning # Generic type constraints must be on their own line or share line with previous
dotnet_diagnostic.SA1501.severity = warning # Braces must not be omitted
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetStac/Common/TolerantEnumConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s

private bool IsNullableType(Type t)
{
return (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>));
return t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>);
}
}
}
2 changes: 1 addition & 1 deletion src/DotNetStac/Converters/CollectionConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CollectionConverter<T> : JsonConverter
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(Collection<T>));
return objectType == typeof(Collection<T>);
}

/// <inheritdoc/>
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetStac/Converters/ContentTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class ContentTypeConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(ContentType));
return objectType == typeof(ContentType);
}

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetStac/Converters/SemVersionConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class SemVersionConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(SemVersion));
return objectType == typeof(SemVersion);
}

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Expand Down
6 changes: 3 additions & 3 deletions src/DotNetStac/Converters/StacSummariesConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class StacSummariesConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(Dictionary<string, IStacSummaryItem>));
return objectType == typeof(Dictionary<string, IStacSummaryItem>);
}

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Expand All @@ -27,7 +27,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
{
if (objDic[key] is JArray)
{
JArray enumerable = (objDic[key] as JArray);
JArray enumerable = objDic[key] as JArray;
switch (enumerable.First().Type)
{
case JTokenType.Boolean:
Expand All @@ -53,7 +53,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist

if (objDic[key] is JObject)
{
JObject obj = (objDic[key] as JObject);
JObject obj = objDic[key] as JObject;
if (obj.ContainsKey("minimum") && obj.ContainsKey("maximum"))
{
switch (obj["minimum"].Type)
Expand Down

0 comments on commit 87c4fb6

Please sign in to comment.