Skip to content

Commit 18eae7c

Browse files
committed
Merge branch 'dev'
2 parents 67e36d4 + 104603b commit 18eae7c

29 files changed

+471
-149
lines changed

.editorconfig

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
root = true
2+
3+
[*]
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4
8+
charset = utf-8
9+
end_of_line = lf
10+
11+
[*.{csproj,json,config,yml,props}]
12+
indent_size = 2
13+
14+
[*.sh]
15+
end_of_line = lf
16+
17+
[*.{cmd, bat}]
18+
end_of_line = crlf
19+
20+
# C# formatting settings - Namespace options
21+
csharp_style_namespace_declarations = file_scoped:suggestion
22+
23+
csharp_style_prefer_switch_expression = true:suggestion
24+
25+
# C# formatting settings - Spacing options
26+
csharp_space_after_cast = false
27+
csharp_space_after_keywords_in_control_flow_statements = true
28+
csharp_space_between_parentheses = false
29+
csharp_space_before_colon_in_inheritance_clause = true
30+
csharp_space_after_colon_in_inheritance_clause = true
31+
csharp_space_around_binary_operators = before_and_after
32+
csharp_space_between_method_declaration_parameter_list_parentheses = false
33+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
34+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
35+
csharp_space_between_method_call_parameter_list_parentheses = false
36+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
37+
csharp_space_between_method_call_name_and_opening_parenthesis = false
38+
csharp_space_after_comma = true
39+
csharp_space_before_comma = false
40+
csharp_space_after_dot = false
41+
csharp_space_before_dot = false
42+
csharp_space_after_semicolon_in_for_statement = true
43+
csharp_space_before_semicolon_in_for_statement = false
44+
csharp_space_around_declaration_statements = false
45+
csharp_space_before_open_square_brackets = false
46+
csharp_space_between_empty_square_brackets = false
47+
csharp_space_between_square_brackets = false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,5 @@ FakesAssemblies/
194194

195195
# Visual Studio 6 workspace options file
196196
*.opt
197+
198+
.idea/

Build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $commitHash = $(git rev-parse --short HEAD)
1616
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1717

1818
echo "build: Package version suffix is $suffix"
19-
echo "build: Build version suffix is $buildSuffix"
19+
echo "build: Build version suffix is $buildSuffix"
2020

2121
foreach ($src in ls src/*) {
2222
Push-Location $src
@@ -28,14 +28,14 @@ foreach ($src in ls src/*) {
2828
} else {
2929
& dotnet build -c Release
3030
}
31-
if($LASTEXITCODE -ne 0) { exit 1 }
31+
if($LASTEXITCODE -ne 0) { exit 1 }
3232

3333
if ($suffix) {
3434
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --version-suffix=$suffix --no-build
3535
} else {
3636
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --no-build
3737
}
38-
if($LASTEXITCODE -ne 0) { exit 1 }
38+
if($LASTEXITCODE -ne 0) { exit 1 }
3939

4040
Pop-Location
4141
}

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
<DebugSymbols>true</DebugSymbols>
88
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)key.snk</AssemblyOriginatorKeyFile>
99
<SignAssembly>true</SignAssembly>
10+
<Nullable>enable</Nullable>
1011
</PropertyGroup>
1112
</Project>

README.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Apply the `LogWithName` attribute:
3333
public class PersonalData
3434
{
3535
[LogWithName("FullName")]
36-
public string Name { get; set; }
36+
public string? Name { get; set; }
3737
}
3838
```
3939
<sup><a href='/test/Destructurama.Attributed.Tests/LogWithNameAttributedTests.cs#L37-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-logwithname' title='Start of snippet'>anchor</a></sup>
@@ -49,10 +49,10 @@ Apply the `NotLogged` attribute:
4949
```cs
5050
public class LoginCommand
5151
{
52-
public string Username { get; set; }
52+
public string? Username { get; set; }
5353

5454
[NotLogged]
55-
public string Password { get; set; }
55+
public string? Password { get; set; }
5656
}
5757
```
5858
<sup><a href='/test/Destructurama.Attributed.Tests/Snippets.cs#L29-L37' title='Snippet source file'>snippet source</a> | <a href='#snippet-logincommand' title='Start of snippet'>anchor</a></sup>
@@ -98,106 +98,112 @@ public class CustomizedMaskedLogs
9898
/// 123456789 results in "***"
9999
/// </summary>
100100
[LogMasked]
101-
public string DefaultMasked { get; set; }
101+
public string? DefaultMasked { get; set; }
102102

103103
/// <summary>
104104
/// [123456789,123456789,123456789] results in [***,***,***]
105105
/// </summary>
106106
[LogMasked]
107-
public string[] DefaultMaskedArray { get; set; }
107+
public string[]? DefaultMaskedArray { get; set; }
108108

109109
/// <summary>
110110
/// 123456789 results in "*********"
111111
/// </summary>
112112
[LogMasked(PreserveLength = true)]
113-
public string DefaultMaskedPreserved { get; set; }
113+
public string? DefaultMaskedPreserved { get; set; }
114114

115115
/// <summary>
116116
/// 123456789 results in "#"
117117
/// </summary>
118118
[LogMasked(Text = "_REMOVED_")]
119-
public string CustomMasked { get; set; }
119+
public string? CustomMasked { get; set; }
120+
121+
/// <summary>
122+
/// 123456789 results in "#"
123+
/// </summary>
124+
[LogMasked(Text = "")]
125+
public string? CustomMaskedWithEmptyString { get; set; }
120126

121127
/// <summary>
122128
/// 123456789 results in "#########"
123129
/// </summary>
124130
[LogMasked(Text = "#", PreserveLength = true)]
125-
public string CustomMaskedPreservedLength { get; set; }
131+
public string? CustomMaskedPreservedLength { get; set; }
126132

127133
/// <summary>
128134
/// 123456789 results in "123******"
129135
/// </summary>
130136
[LogMasked(ShowFirst = 3)]
131-
public string ShowFirstThreeThenDefaultMasked { get; set; }
137+
public string? ShowFirstThreeThenDefaultMasked { get; set; }
132138

133139
/// <summary>
134140
/// 123456789 results in "123******"
135141
/// </summary>
136142
[LogMasked(ShowFirst = 3, PreserveLength = true)]
137-
public string ShowFirstThreeThenDefaultMaskedPreservedLength { get; set; }
143+
public string? ShowFirstThreeThenDefaultMaskedPreservedLength { get; set; }
138144

139145
/// <summary>
140146
/// 123456789 results in "***789"
141147
/// </summary>
142148
[LogMasked(ShowLast = 3)]
143-
public string ShowLastThreeThenDefaultMasked { get; set; }
149+
public string? ShowLastThreeThenDefaultMasked { get; set; }
144150

145151
/// <summary>
146152
/// 123456789 results in "******789"
147153
/// </summary>
148154
[LogMasked(ShowLast = 3, PreserveLength = true)]
149-
public string ShowLastThreeThenDefaultMaskedPreservedLength { get; set; }
155+
public string? ShowLastThreeThenDefaultMaskedPreservedLength { get; set; }
150156

151157
/// <summary>
152158
/// 123456789 results in "123REMOVED"
153159
/// </summary>
154160
[LogMasked(Text = "_REMOVED_", ShowFirst = 3)]
155-
public string ShowFirstThreeThenCustomMask { get; set; }
161+
public string? ShowFirstThreeThenCustomMask { get; set; }
156162

157163
/// <summary>
158164
/// 123456789 results in "123_REMOVED_"
159165
/// </summary>
160166
[LogMasked(Text = "_REMOVED_", ShowFirst = 3, PreserveLength = true)]
161-
public string ShowFirstThreeThenCustomMaskPreservedLengthIgnored { get; set; }
167+
public string? ShowFirstThreeThenCustomMaskPreservedLengthIgnored { get; set; }
162168

163169
/// <summary>
164170
/// 123456789 results in "_REMOVED_789"
165171
/// </summary>
166172
[LogMasked(Text = "_REMOVED_", ShowLast = 3)]
167-
public string ShowLastThreeThenCustomMask { get; set; }
173+
public string? ShowLastThreeThenCustomMask { get; set; }
168174

169175
/// <summary>
170176
/// 123456789 results in "_REMOVED_789"
171177
/// </summary>
172178
[LogMasked(Text = "_REMOVED_", ShowLast = 3, PreserveLength = true)]
173-
public string ShowLastThreeThenCustomMaskPreservedLengthIgnored { get; set; }
179+
public string? ShowLastThreeThenCustomMaskPreservedLengthIgnored { get; set; }
174180

175181
/// <summary>
176182
/// 123456789 results in "123***789"
177183
/// </summary>
178184
[LogMasked(ShowFirst = 3, ShowLast = 3)]
179-
public string ShowFirstAndLastThreeAndDefaultMaskInTheMiddle { get; set; }
185+
public string? ShowFirstAndLastThreeAndDefaultMaskInTheMiddle { get; set; }
180186

181187
/// <summary>
182188
/// 123456789 results in "123***789"
183189
/// </summary>
184190
[LogMasked(ShowFirst = 3, ShowLast = 3, PreserveLength = true)]
185-
public string ShowFirstAndLastThreeAndDefaultMaskInTheMiddlePreservedLength { get; set; }
191+
public string? ShowFirstAndLastThreeAndDefaultMaskInTheMiddlePreservedLength { get; set; }
186192

187193
/// <summary>
188194
/// 123456789 results in "123_REMOVED_789"
189195
/// </summary>
190196
[LogMasked(Text = "_REMOVED_", ShowFirst = 3, ShowLast = 3)]
191-
public string ShowFirstAndLastThreeAndCustomMaskInTheMiddle { get; set; }
197+
public string? ShowFirstAndLastThreeAndCustomMaskInTheMiddle { get; set; }
192198

193199
/// <summary>
194200
/// 123456789 results in "123_REMOVED_789". PreserveLength is ignored"
195201
/// </summary>
196202
[LogMasked(Text = "_REMOVED_", ShowFirst = 3, ShowLast = 3, PreserveLength = true)]
197-
public string ShowFirstAndLastThreeAndCustomMaskInTheMiddlePreservedLengthIgnored { get; set; }
203+
public string? ShowFirstAndLastThreeAndCustomMaskInTheMiddlePreservedLengthIgnored { get; set; }
198204
}
199205
```
200-
<sup><a href='/test/Destructurama.Attributed.Tests/MaskedAttributeTests.cs#L9-L116' title='Snippet source file'>snippet source</a> | <a href='#snippet-customizedmaskedlogs' title='Start of snippet'>anchor</a></sup>
206+
<sup><a href='/test/Destructurama.Attributed.Tests/MaskedAttributeTests.cs#L9-L122' title='Snippet source file'>snippet source</a> | <a href='#snippet-customizedmaskedlogs' title='Start of snippet'>anchor</a></sup>
201207
<!-- endSnippet -->
202208

203209

@@ -226,6 +232,7 @@ __Constructor arguments__:
226232

227233
__Available properties__:
228234
- **Options:** The [RegexOptions](https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regexoptions?view=netcore-3.1) that will be applied. Defaults to __RegexOptions.None__
235+
- **Timeout:** A time-out interval to evaluate regular expression. Defaults to __Regex.InfiniteMatchTimeout__
229236

230237

231238
### Examples
@@ -241,13 +248,13 @@ public class WithRegex
241248
/// 123|456|789 results in "***|456|789"
242249
/// </summary>
243250
[LogReplaced(RegexWithVerticalBars, "***|$2|$3")]
244-
public string RegexReplaceFirst { get; set; }
251+
public string? RegexReplaceFirst { get; set; }
245252

246253
/// <summary>
247254
/// 123|456|789 results in "123|***|789"
248255
/// </summary>
249256
[LogReplaced(RegexWithVerticalBars, "$1|***|$3")]
250-
public string RegexReplaceSecond { get; set; }
257+
public string? RegexReplaceSecond { get; set; }
251258
}
252259
```
253260
<sup><a href='/test/Destructurama.Attributed.Tests/Snippets.cs#L6-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-withregex' title='Start of snippet'>anchor</a></sup>

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2019
3+
image: Visual Studio 2022
44
configuration: Release
55
test: off
66
build_script:

destructurama-attributed.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{A195B0
1717
Directory.Build.props = Directory.Build.props
1818
LICENSE = LICENSE
1919
README.md = README.md
20+
global.json = global.json
2021
EndProjectSection
2122
EndProject
2223
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{677924A1-EB38-4E04-9D13-3DD4C3C9C514}"

0 commit comments

Comments
 (0)