Skip to content

Commit e1dbe19

Browse files
authored
Merge pull request #141 from Yubico/dennisdyallo/implicit-var
Adopt inferred variable types (var) to enhance code readability and maintainability
2 parents 299b6ae + 6b971e6 commit e1dbe19

File tree

202 files changed

+1545
-1585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+1545
-1585
lines changed

.editorconfig

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ dotnet_style_readonly_field = true:warning
8686
#### C# Coding Conventions ####
8787

8888
# var preferences
89-
csharp_style_var_elsewhere = false:warning
90-
csharp_style_var_for_built_in_types = false:warning
89+
csharp_style_var_elsewhere = true:suggestion
90+
csharp_style_var_for_built_in_types = false:suggestion
9191
csharp_style_var_when_type_is_apparent = true:suggestion
9292

9393
# Pattern matching preferences
@@ -351,3 +351,10 @@ dotnet_diagnostic.ca1707.severity = none
351351

352352
# CA1014: Mark assemblies with CLSCompliant
353353
dotnet_diagnostic.ca1014.severity = none
354+
355+
356+
[Yubico.Core/src/**/*.cs]
357+
# var preferences
358+
csharp_style_var_elsewhere = false:warning
359+
csharp_style_var_for_built_in_types = false:warning
360+
csharp_style_var_when_type_is_apparent = true:warning

Yubico.Core/src/Yubico/Core/Devices/Hid/MacOSHidDevice.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
using System.Globalization;
1818
using System.Linq;
1919
using Microsoft.Extensions.Logging;
20-
using Yubico.PlatformInterop;
2120
using Yubico.Core.Logging;
22-
21+
using Yubico.PlatformInterop;
2322
using static Yubico.PlatformInterop.NativeMethods;
2423

2524
namespace Yubico.Core.Devices.Hid

Yubico.DotNetPolyfills/src/Contrib.Bcl.Ranges/Range.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ value is Range r &&
7777
public (int Offset, int Length) GetOffsetAndLength(int length)
7878
{
7979
int start;
80-
Index startIndex = Start;
80+
var startIndex = Start;
8181
if (startIndex.IsFromEnd)
8282
{
8383
start = length - startIndex.Value;
@@ -88,7 +88,7 @@ value is Range r &&
8888
}
8989

9090
int end;
91-
Index endIndex = End;
91+
var endIndex = End;
9292
if (endIndex.IsFromEnd)
9393
{
9494
end = length - endIndex.Value;

Yubico.YubiKey/examples/Fido2SampleCode/Run/Fido2SampleGui.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public bool LaunchPinPopup(KeyEntryData keyEntryData)
231231
return false;
232232
}
233233

234-
DialogResult dResult = DialogResult.OK;
234+
var dResult = DialogResult.OK;
235235
do
236236
{
237237
_pinPopupForm.UpdateMessage(dResult, keyEntryData);

0 commit comments

Comments
 (0)