Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit ac32326

Browse files
committed
Add missing proxy method attributes
1 parent 59d34ca commit ac32326

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>2.3.0</Version>
3+
<Version>2.3.1</Version>
44
</PropertyGroup>
55

66
<PropertyGroup>

JustArchiNET.Madness/ConvertMadness/Convert.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ namespace JustArchiNET.Madness.ConvertMadness;
2929
[PublicAPI]
3030
public static class Convert {
3131
[MadnessType(EMadnessType.Proxy)]
32+
[Pure]
3233
public static object ChangeType(object? value, Type conversionType, IFormatProvider? provider) => System.Convert.ChangeType(value, conversionType, provider);
3334

3435
[MadnessType(EMadnessType.Proxy)]
36+
[Pure]
3537
public static byte[] FromBase64String(string s) => System.Convert.FromBase64String(s);
3638

3739
[MadnessType(EMadnessType.Proxy)]
40+
[Pure]
3841
public static string ToBase64String(byte[] inArray) => System.Convert.ToBase64String(inArray);
3942

4043
[MadnessType(EMadnessType.Implementation)]
44+
[Pure]
4145
public static string ToHexString(byte[] inArray) {
4246
if (inArray == null) {
4347
throw new ArgumentNullException(nameof(inArray));

JustArchiNET.Madness/EnvironmentMadness/Environment.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ public static string? ProcessPath {
4040
}
4141
}
4242

43+
[ContractAnnotation("=>halt")]
4344
[MadnessType(EMadnessType.Proxy)]
4445
public static void Exit(int exitCode) => System.Environment.Exit(exitCode);
4546

4647
[MadnessType(EMadnessType.Proxy)]
48+
[Pure]
4749
public static string[] GetCommandLineArgs() => System.Environment.GetCommandLineArgs();
4850

4951
[MadnessType(EMadnessType.Proxy)]

JustArchiNET.Madness/PathMadness/Path.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,28 @@ public static class Path {
3939
[MadnessType(EMadnessType.Proxy)]
4040
public static string Combine(params string[] paths) => System.IO.Path.Combine(paths);
4141

42+
[ContractAnnotation("null=>null")]
4243
[MadnessType(EMadnessType.Proxy)]
44+
[Pure]
4345
public static string? GetDirectoryName(string? path) => System.IO.Path.GetDirectoryName(path);
4446

47+
[ContractAnnotation("null=>null;notnull=>notnull")]
4548
[MadnessType(EMadnessType.Proxy)]
49+
[Pure]
4650
public static string? GetExtension(string? path) => System.IO.Path.GetExtension(path);
4751

52+
[ContractAnnotation("null=>null;notnull=>notnull")]
4853
[MadnessType(EMadnessType.Proxy)]
54+
[Pure]
4955
public static string? GetFileName(string? path) => System.IO.Path.GetFileName(path);
5056

57+
[ContractAnnotation("null=>null;notnull=>notnull")]
5158
[MadnessType(EMadnessType.Proxy)]
59+
[Pure]
5260
public static string? GetFileNameWithoutExtension(string? path) => System.IO.Path.GetFileNameWithoutExtension(path);
5361

5462
[MadnessType(EMadnessType.Proxy)]
63+
[Pure]
5564
public static string GetFullPath(string path) => System.IO.Path.GetFullPath(path);
5665

5766
[MadnessType(EMadnessType.Implementation)]

JustArchiNET.Madness/StringMadness/String.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ public static string Create<TState>(int length, TState state, SpanAction<char, T
5252
return new string(buffer);
5353
}
5454

55+
[ContractAnnotation("null=>true", true)]
5556
[MadnessType(EMadnessType.Proxy)]
57+
[Pure]
5658
public static bool IsNullOrEmpty(string value) => string.IsNullOrEmpty(value);
5759

60+
[ContractAnnotation("null=>true", true)]
5861
[MadnessType(EMadnessType.Proxy)]
62+
[Pure]
5963
public static bool IsNullOrWhiteSpace(string value) => string.IsNullOrWhiteSpace(value);
6064
}
6165
#pragma warning restore CA1716, CA1720 // That's exactly our intention

0 commit comments

Comments
 (0)