Skip to content

Commit

Permalink
Update of dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlebansais committed Dec 1, 2024
1 parent 75cf58c commit 46c8402
Show file tree
Hide file tree
Showing 19 changed files with 1,032 additions and 854 deletions.
156 changes: 156 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
[*.cs]

#### CA

# CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = silent

# CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1032.severity = silent

# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = silent

# CA1711: Identifiers should not have incorrect suffix
dotnet_diagnostic.CA1711.severity = silent

# CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = silent

# CA1820: Test for empty strings using string length
dotnet_diagnostic.CA1820.severity = silent

# CA1846: Prefer AsSpan over Substring
dotnet_diagnostic.CA1846.severity = silent

# CA1852: Seal internal types
dotnet_diagnostic.CA1852.severity = silent

#### SA

# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none

Expand Down Expand Up @@ -59,3 +87,131 @@ dotnet_diagnostic.SA1615.severity = silent

# SA1633: File should have header
dotnet_diagnostic.SA1633.severity = silent

#### IDE

# IDE0001: Simplify name
dotnet_diagnostic.IDE0001.severity = warning

# IDE0002: Simplify member access
dotnet_diagnostic.IDE0002.severity = warning

# IDE0004: Remove unnecessary cast
dotnet_diagnostic.IDE0004.severity = warning

# IDE0011: Add braces
dotnet_diagnostic.IDE0011.severity = warning
csharp_prefer_braces = when_multiline

# IDE0016: Use throw expression
dotnet_diagnostic.IDE0016.severity = warning

# IDE0019: Use pattern matching to avoid as followed by a null check
dotnet_diagnostic.IDE0019.severity = warning

# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable)
dotnet_diagnostic.IDE0020.severity = warning

# IDE0030: Null check can be simplified (if null check)
dotnet_diagnostic.IDE0030.severity = warning

# IDE0031: Use null propagation
dotnet_diagnostic.IDE0031.severity = warning

# IDE0033: Use explicitly provided tuple name
dotnet_diagnostic.IDE0033.severity = warning

# IDE0034: Simplify default expression
dotnet_diagnostic.IDE0034.severity = warning

# IDE0037: Use inferred member name
dotnet_diagnostic.IDE0037.severity = warning

# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
dotnet_diagnostic.IDE0038.severity = warning

# IDE0040: Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = warning

# IDE0041: Use 'is null' check
dotnet_diagnostic.IDE0041.severity = warning

# IDE0044: Add readonly modifier
dotnet_diagnostic.IDE0044.severity = warning

# IDE0048: Add parentheses for clarity
dotnet_diagnostic.IDE0048.severity = warning
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = always_for_clarity

# IDE0051: Remove unused private member
dotnet_diagnostic.IDE0051.severity = warning

# IDE0052: Remove unread private member
dotnet_diagnostic.IDE0052.severity = warning

# IDE0058: Remove unnecessary expression value
dotnet_diagnostic.IDE0058.severity = warning

# IDE0059: Remove unnecessary value assignment
dotnet_diagnostic.IDE0059.severity = warning

# IDE0065: using directive placement
csharp_using_directive_placement = inside_namespace

# IDE0066: Use switch expression
dotnet_diagnostic.IDE0066.severity = warning

# IDE0070: Use System.HashCode.Combine
dotnet_diagnostic.IDE0070.severity = warning

# IDE0071: Simplify interpolation
dotnet_diagnostic.IDE0071.severity = warning

# IDE0072: Add missing cases to switch expression
dotnet_diagnostic.IDE0072.severity = warning

# IDE0078: Use pattern matching
dotnet_diagnostic.IDE0078.severity = warning

# IDE0080: Remove unnecessary suppression operator
dotnet_diagnostic.IDE0080.severity = warning

# IDE0082: Convert typeof to nameof
dotnet_diagnostic.IDE0082.severity = warning

# IDE0083: Use pattern matching (not operator)
dotnet_diagnostic.IDE0083.severity = warning

# IDE0090: Use 'new(...)'
dotnet_diagnostic.IDE0090.severity = warning

# IDE0110: Remove unnecessary discard
dotnet_diagnostic.IDE0110.severity = warning

# IDE0120: Simplify LINQ expression
dotnet_diagnostic.IDE0120.severity = warning

# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = silent

# IDE0161: Use file-scoped namespace
dotnet_diagnostic.IDE0161.severity = warning
csharp_style_namespace_declarations = file_scoped

# IDE0250: Struct can be made 'readonly'
dotnet_diagnostic.IDE0250.severity = warning

# IDE0251: Member can be made 'readonly'
dotnet_diagnostic.IDE0251.severity = warning

# IDE0260: Use pattern matching
dotnet_diagnostic.IDE0260.severity = warning

# IDE0270: Null check can be simplified (if null check)
dotnet_diagnostic.IDE0270.severity = warning

# IDE0280: Use 'nameof'
dotnet_diagnostic.IDE0280.severity = warning
40 changes: 14 additions & 26 deletions PgMoon-Plugin/CalendarEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
/// <summary>
/// Represents a moment in time defined by its moon phase.
/// </summary>
public class CalendarEntry : INotifyPropertyChanged
/// <param name="moonMonth">The Moon month.</param>
/// <param name="moonPhase">The Moon phase.</param>
/// <param name="startTime">The start time.</param>
/// <param name="endTime">The end time.</param>
/// <param name="mushroomInfoList">The list of mushroom info.</param>
public class CalendarEntry(int moonMonth, MoonPhase moonPhase, DateTime startTime, DateTime endTime, ICollection<MushroomInfo> mushroomInfoList) : INotifyPropertyChanged
{
#region Constants
/// <summary>
Expand All @@ -33,55 +38,36 @@ public class CalendarEntry : INotifyPropertyChanged
public static string PortToCircleShortText => "Circle";
#endregion

#region Init
/// <summary>
/// Initializes a new instance of the <see cref="CalendarEntry"/> class.
/// </summary>
/// <param name="moonMonth">The Moon month.</param>
/// <param name="moonPhase">The Moon phase.</param>
/// <param name="startTime">The start time.</param>
/// <param name="endTime">The end time.</param>
/// <param name="mushroomInfoList">The list of mushroom info.</param>
public CalendarEntry(int moonMonth, MoonPhase moonPhase, DateTime startTime, DateTime endTime, ICollection<MushroomInfo> mushroomInfoList)
{
MoonMonth = moonMonth;
MoonPhase = moonPhase;
StartTime = startTime;
EndTime = endTime;
MushroomInfoList = mushroomInfoList;
}
#endregion

#region Properties
/// <summary>
/// Gets the Moon month.
/// </summary>
public int MoonMonth { get; }
public int MoonMonth { get; } = moonMonth;

/// <summary>
/// Gets the Moon phase.
/// </summary>
public MoonPhase MoonPhase { get; }
public MoonPhase MoonPhase { get; } = moonPhase;

/// <summary>
/// Gets the start time.
/// </summary>
public DateTime StartTime { get; }
public DateTime StartTime { get; } = startTime;

/// <summary>
/// Gets the end time.
/// </summary>
public DateTime EndTime { get; }
public DateTime EndTime { get; } = endTime;

/// <summary>
/// Gets the list of mushroom info.
/// </summary>
public ICollection<MushroomInfo> MushroomInfoList { get; }
public ICollection<MushroomInfo> MushroomInfoList { get; } = mushroomInfoList;

/// <summary>
/// Gets a value indicating whether this entry is the current one.
/// </summary>
public bool IsCurrent { get { return PhaseCalculator.IsCurrent(MoonMonth, MoonPhase); } }
public bool IsCurrent => PhaseCalculator.IsCurrent(MoonMonth, MoonPhase);

/// <summary>
/// Gets the entry summary.
Expand All @@ -94,13 +80,15 @@ public string Summary
string GrowingRobustly = string.Empty;

foreach (MushroomInfo Item in MushroomInfoList)
{
if (Item.RobustGrowthPhase1 == MoonPhase || Item.RobustGrowthPhase2 == MoonPhase)
{
if (GrowingRobustly.Length > 0)
GrowingRobustly += ", ";

GrowingRobustly += Item.Name;
}
}

if (GrowingRobustly.Length > 0)
Result += $"Growing Robustly: {GrowingRobustly}\r\n";
Expand Down
2 changes: 1 addition & 1 deletion PgMoon-Plugin/Converter/DateTimeToStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null !;
throw new NotImplementedException();
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
Expand Down
4 changes: 3 additions & 1 deletion PgMoon-Plugin/Converter/DoubleToThicknessConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
Length = 0;
}
else
{
Length = (double)parameter;
}

return new Thickness(0, 0, (1.0 - DoubleValue) * Length, 0);
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null !;
throw new NotImplementedException();
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
Expand Down
Loading

0 comments on commit 46c8402

Please sign in to comment.