Skip to content

Commit

Permalink
disallow to use #region directives
Browse files Browse the repository at this point in the history
  • Loading branch information
smdn committed Dec 10, 2021
1 parent 3da58df commit c326059
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 24 deletions.
7 changes: 0 additions & 7 deletions src/Smdn.Fundamental.FourCC/Smdn/FourCC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace Smdn {
#pragma warning restore IDE0055
public static readonly FourCC Empty = new(0);

#region "construction"
public static FourCC CreateBigEndian(int bigEndianInt)
=> new(bigEndianInt);

Expand Down Expand Up @@ -90,9 +89,7 @@ private FourCC(int fourcc)
{
this.fourcc = fourcc;
}
#endregion

#region "conversion"
public static implicit operator FourCC(string fourccString)
=> new(fourccString);

Expand Down Expand Up @@ -172,9 +169,6 @@ public override string ToString()
}
}

#endregion

#region "comparison"
public static bool operator ==(FourCC x, FourCC y)
=> x.fourcc == y.fourcc;

Expand All @@ -201,7 +195,6 @@ public bool Equals(string other)

public bool Equals(byte[] other)
=> (other != null) && other.SequenceEqual(this.ToByteArray());
#endregion

public override int GetHashCode()
=> fourcc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public static string Expand(ShellString str)
return str.Expanded;
}

#region "equality"
public bool Equals(ShellString other)
{
if (object.ReferenceEquals(this, other))
Expand Down Expand Up @@ -109,9 +108,7 @@ public override int GetHashCode()
else
return Raw.GetHashCode();
}
#endregion

#region "conversion"
public static explicit operator string(ShellString str)
{
if (str == null)
Expand All @@ -132,6 +129,5 @@ public override string ToString()
{
return Raw;
}
#endregion
}
}
2 changes: 0 additions & 2 deletions src/Smdn.Fundamental.Stream/Smdn.IO.Streams/PartialStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class PartialStream :
#endif
#pragma warning restore SA1001
{
#region "class members"
public static PartialStream CreateNonNested(Stream innerOrPartialStream, long length)
{
return CreateNonNested(innerOrPartialStream, innerOrPartialStream.Position, length, true);
Expand All @@ -42,7 +41,6 @@ public static PartialStream CreateNonNested(Stream innerOrPartialStream, long of
? new(partialStream.InnerStream, partialStream.offset + offset, length, !partialStream.writable, partialStream.LeaveInnerStreamOpen, seekToBegin)
: new(innerOrPartialStream, offset, length, true, true, seekToBegin);
}
#endregion

public Stream InnerStream {
get { CheckDisposed(); return stream; }
Expand Down
2 changes: 0 additions & 2 deletions src/Smdn.Fundamental.UInt24n/Smdn/UInt24.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public UInt32 ToUInt32()
(UInt32)(Byte1 << 8) |
(UInt32)Byte2;

#region "IConvertible implementation"
TypeCode IConvertible.GetTypeCode() => TypeCode.Object;

string IConvertible.ToString(IFormatProvider provider) => ToString(null, provider);
Expand All @@ -161,7 +160,6 @@ public UInt32 ToUInt32()

object IConvertible.ToType(Type conversionType, IFormatProvider provider)
=> Convert.ChangeType(ToUInt32(), conversionType, provider);
#endregion

public int CompareTo(object obj)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Smdn.Fundamental.UInt24n/Smdn/UInt48.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public UInt64 ToUInt64()
(UInt64)((UInt64)Byte4 << 8) |
(UInt64)Byte5;

#region "IConvertible implementation"
TypeCode IConvertible.GetTypeCode()
{
return TypeCode.Object;
Expand Down Expand Up @@ -245,7 +244,6 @@ object IConvertible.ToType(Type conversionType, IFormatProvider provider)
{
return Convert.ChangeType(ToUInt64(), conversionType, provider);
}
#endregion

public int CompareTo(object obj)
{
Expand Down
6 changes: 0 additions & 6 deletions src/Smdn.Fundamental.Uuid/Smdn/Uuid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ public Uuid(string uuid)
#endif
}

#region "comparison"
public static bool operator <(Uuid x, Uuid y) => x.CompareTo(y) < 0;
public static bool operator <=(Uuid x, Uuid y) => x.CompareTo(y) <= 0;
public static bool operator >(Uuid x, Uuid y) => y < x;
Expand Down Expand Up @@ -786,9 +785,7 @@ public int CompareTo(Uuid other)

return 0;
}
#endregion

#region "equality"
public static bool operator ==(Uuid x, Uuid y) => x.fields_high == y.fields_high && x.fields_low == y.fields_low;
public static bool operator !=(Uuid x, Uuid y) => x.fields_high != y.fields_high || x.fields_low != y.fields_low;

Expand All @@ -804,9 +801,7 @@ public override bool Equals(object obj)

public bool Equals(Guid other) => this == (Uuid)other;
public bool Equals(Uuid other) => this == other;
#endregion

#region "conversion"
public static explicit operator Guid(Uuid @value) => @value.ToGuid();

public static explicit operator Uuid(Guid @value) => new(@value);
Expand Down Expand Up @@ -858,7 +853,6 @@ public byte[] ToByteArray(bool asBigEndian)

return bytes;
}
#endregion

public override int GetHashCode()
=> fields_high.GetHashCode() ^ fields_low.GetHashCode();
Expand Down
2 changes: 1 addition & 1 deletion src/StyleCop.Analyzers.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<Rule Id="SA1121" Action="Warning" /> <!-- Use built-in type alias -->
<Rule Id="SA1122" Action="Warning" /> <!-- Use string.Empty for empty strings -->
<Rule Id="SA1123" Action="Warning" /> <!-- Do not place regions within elements -->
<Rule Id="SA1124" Action="None" /> <!-- Do not use regions -->
<Rule Id="SA1124" Action="Warning" /> <!-- Do not use regions -->
<Rule Id="SA1125" Action="Warning" /> <!-- Use shorthand for nullable types -->
<Rule Id="SA1126" Action="None" /> <!-- Prefix calls correctly -->
<Rule Id="SA1127" Action="None" /> <!-- Generic type constraints should be on their own line -->
Expand Down

0 comments on commit c326059

Please sign in to comment.