Skip to content

Commit ef7f82f

Browse files
authored
NET7 and small cleanup (#266)
* NET7 and small cleanup * editorconfig
1 parent 0b445bd commit ef7f82f

17 files changed

+277
-293
lines changed

.editorconfig

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# Create portable, custom editor settings with EditorConfig
4+
# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options
5+
6+
# .NET coding convention settings for EditorConfig
7+
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
8+
9+
# Language conventions
10+
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions
11+
12+
# Formatting conventions
13+
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-formatting-conventions
14+
15+
# .NET naming conventions for EditorConfig
16+
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions
17+
18+
# Top-most EditorConfig file
19+
root = true
20+
21+
# Editor default newlines with a newline ending every file
22+
[*]
23+
insert_final_newline = true
24+
charset = utf-8
25+
indent_style = space
26+
indent_size = 2
27+
trim_trailing_whitespace = true
28+
29+
[*.cs]
30+
indent_size = 4
31+
32+
# Code files
33+
[*.{cs,vb}]
34+
35+
csharp_prefer_simple_using_statement = true:warning
36+
csharp_style_prefer_switch_expression = true:warning

.github/workflows/ci-cd.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,15 @@ jobs:
1515
- name: Install .NET SDK
1616
uses: actions/setup-dotnet@v3
1717
with:
18-
dotnet-version: 5.0.403
18+
dotnet-version: 7.0.102
1919

2020
# Build and test validation
2121

2222
- name: Restore solution
23-
shell: pwsh
24-
run: |
25-
dotnet restore Microsoft.IO.RecyclableMemoryStream.sln
23+
run: dotnet restore
2624

2725
- name: Build solution
28-
shell: pwsh
29-
run: |
30-
dotnet build Microsoft.IO.RecyclableMemoryStream.sln `
31-
--configuration Debug `
32-
--no-restore
26+
run: dotnet build --configuration Debug --no-restore
3327

3428
- name: Run unit tests
3529
shell: pwsh

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup .NET SDK
1515
uses: actions/setup-dotnet@v3
1616
with:
17-
dotnet-version: 5.0.203
17+
dotnet-version: 7.0.102
1818

1919
- name: Checkout repository
2020
uses: actions/checkout@v3

CHANGES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Bug Fix:
1010
# Version 2.2.0
1111

1212
API changes:
13-
* Add an override for `GetStream` that takes a `ReadOnlySpan<byte>`. This supercedes the versions of `GetStream` that take `Memory<byte>`, which were marked as `[Obsolete]`.
13+
* Add an override for `GetStream` that takes a `ReadOnlySpan<byte>`. This supersedes the versions of `GetStream` that take `Memory<byte>`, which were marked as `[Obsolete]`.
1414

1515
Bug Fixes:
1616
* Fixed: `GetReadOnlySequence()` throws `ArgumentOutOfRangeException`
@@ -22,7 +22,7 @@ Performance Improvements:
2222
* Use `GC.AllocateUninitializedArray` in an additional spot, for better performance in .NET 5+.
2323

2424
Documentation:
25-
* Improved documentation, standardized puncutation, fixed code formatting.
25+
* Improved documentation, standardized punctuation, fixed code formatting.
2626

2727
# Version 2.1.3
2828

@@ -37,7 +37,7 @@ Bug Fixes:
3737

3838
# Version 2.1.0
3939

40-
* Added `RecyclableMemoryStreamManager` constructor overloads that take parameters for specifying the maximum free pool sizes. Updated IntelliSense documentation to make clear that these values need to be explciitly set to avoid unbounded pool growth.
40+
* Added `RecyclableMemoryStreamManager` constructor overloads that take parameters for specifying the maximum free pool sizes. Updated IntelliSense documentation to make clear that these values need to be explicitly set to avoid unbounded pool growth.
4141
* Buffers are now allocated using `GC.AllocateUninitializedArray` in .NET 5.
4242
* net462 and netstandard2.0 targets can now support the `Span`-related APIs via a dependency on System.Memory.
4343
* Updated documentation to fix typos and clarify language in some parts.

Microsoft.IO.RecyclableMemoryStream.sln

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.28803.156
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.33213.308
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.IO.RecyclableMemoryStream", "src\Microsoft.IO.RecyclableMemoryStream.csproj", "{4B52F0CE-5F4C-43E7-A054-50CA0A502CF3}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests", "UnitTests\UnitTests.csproj", "{419C9F3D-71CC-4F95-8324-E15CD0D1E754}"
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DF4A161A-7C52-46A2-A0ED-427C1C6F29AA}"
1111
ProjectSection(SolutionItems) = preProject
12+
.editorconfig = .editorconfig
1213
CHANGES.md = CHANGES.md
1314
global.json = global.json
1415
LICENSE = LICENSE
1516
README.md = README.md
1617
EndProjectSection
1718
EndProject
19+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{937E12C6-9E9E-438A-86C2-102E1D0C6826}"
20+
ProjectSection(SolutionItems) = preProject
21+
.github\dependabot.yml = .github\dependabot.yml
22+
EndProjectSection
23+
EndProject
24+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{0ED3EBE5-1575-4649-A1F9-3D24BFFC4A9B}"
25+
ProjectSection(SolutionItems) = preProject
26+
.github\workflows\ci-cd.yml = .github\workflows\ci-cd.yml
27+
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
28+
EndProjectSection
29+
EndProject
1830
Global
1931
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2032
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +45,10 @@ Global
3345
GlobalSection(SolutionProperties) = preSolution
3446
HideSolutionNode = FALSE
3547
EndGlobalSection
48+
GlobalSection(NestedProjects) = preSolution
49+
{937E12C6-9E9E-438A-86C2-102E1D0C6826} = {DF4A161A-7C52-46A2-A0ED-427C1C6F29AA}
50+
{0ED3EBE5-1575-4649-A1F9-3D24BFFC4A9B} = {937E12C6-9E9E-438A-86C2-102E1D0C6826}
51+
EndGlobalSection
3652
GlobalSection(ExtensibilityGlobals) = postSolution
3753
SolutionGuid = {D5E147AF-721B-469D-AD77-A00A290340AC}
3854
EndGlobalSection

NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<clear />
1515
<add
1616
key="OSS_All"
17-
value="https://api.nuget.org/v3/index.json"
17+
value="https://api.nuget.org/v3/index.json"
1818
/>
1919
</packageSources>
2020
</configuration>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Supported build targets in v2.0 are: net462, netstandard2.0, netstandard2.1, and
4545
## Testing
4646

4747
A minimum of .NET 5.0 is required for executing the unit tests. Requirements:
48-
- NUnit test adaptor (VS Extension)
48+
- NUnit test adapter (VS Extension)
4949
- Be sure to set the default processor architecture for tests to x64 (or the giant allocation test will fail)
5050

5151
## Change Log

UnitTests/RecyclableMemoryStreamEventListener.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// The MIT License (MIT)
2-
//
2+
//
33
// Copyright (c) 2015-2016 Microsoft
4-
//
4+
//
55
// Permission is hereby granted, free of charge, to any person obtaining a copy
66
// of this software and associated documentation files (the "Software"), to deal
77
// in the Software without restriction, including without limitation the rights
88
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
// copies of the Software, and to permit persons to whom the Software is
1010
// furnished to do so, subject to the following conditions:
11-
//
11+
//
1212
// The above copyright notice and this permission notice shall be included in all
1313
// copies or substantial portions of the Software.
14-
//
14+
//
1515
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -29,7 +29,7 @@ public class RecyclableMemoryStreamEventListener : EventListener
2929
{
3030
private const int MemoryStreamDisposed = 2;
3131
private const int MemoryStreamDoubleDispose = 3;
32-
32+
3333
private const int NumEvents = 12;
3434

3535
public int[] EventCounts { get; } = new int[NumEvents];

0 commit comments

Comments
 (0)