Skip to content

Commit 49c342e

Browse files
authored
Release 2.1.0 (#83)
1 parent d8b46c4 commit 49c342e

File tree

12 files changed

+50
-22
lines changed

12 files changed

+50
-22
lines changed

.editorconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ dotnet_diagnostic.RCS1162.severity = suggestion
139139
dotnet_diagnostic.RCS1188.severity = suggestion
140140
dotnet_diagnostic.RCS1189.severity = suggestion
141141
dotnet_diagnostic.RCS1207.severity = suggestion
142+
dotnet_diagnostic.RCS1228.severity = suggestion
142143
dotnet_diagnostic.RCS1237.severity = none
143144
dotnet_diagnostic.RCS1244.severity = suggestion
144145
dotnet_diagnostic.RCS1248.severity = suggestion
@@ -148,6 +149,7 @@ dotnet_diagnostic.RCS1253.severity = suggestion
148149
dotnet_diagnostic.RCS1254.severity = suggestion
149150
dotnet_diagnostic.RCS1255.severity = none
150151
dotnet_diagnostic.RCS1260.severity = suggestion
152+
dotnet_diagnostic.RCS9001.severity = suggestion
151153

152154
dotnet_diagnostic.IDE0007.severity = none
153155
dotnet_diagnostic.IDE0007WithoutSuggestion.severity = none
@@ -171,7 +173,7 @@ dotnet_diagnostic.IDE0026.severity = none
171173
dotnet_diagnostic.IDE0026WithoutSuggestion.severity = none
172174
dotnet_diagnostic.IDE0027.severity = none
173175
dotnet_diagnostic.IDE0027WithoutSuggestion.severity = none
174-
dotnet_diagnostic.IDE0028.severity = suggestion
176+
dotnet_diagnostic.IDE0028.severity = none # Collection initialization can be simplified
175177
dotnet_diagnostic.IDE0029.severity = suggestion
176178
dotnet_diagnostic.IDE0031.severity = suggestion
177179
dotnet_diagnostic.IDE0033.severity = suggestion
@@ -196,6 +198,11 @@ dotnet_diagnostic.IDE0079.severity = none
196198
dotnet_diagnostic.IDE0090.severity = none
197199
dotnet_diagnostic.IDE0220.severity = none
198200
dotnet_diagnostic.IDE0270.severity = silent
201+
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
202+
dotnet_diagnostic.IDE0300.severity = none # Use collection expression
203+
dotnet_diagnostic.IDE0301.severity = none # ImmutableArray<object>.Empty -> []
204+
dotnet_diagnostic.IDE0303.severity = none # ImmutableArray.Create(x) -> [x]
205+
dotnet_diagnostic.IDE0305.severity = none # x.ToArray() -> [.. x]
199206
dotnet_diagnostic.IDE1005.severity = suggestion
200207
dotnet_diagnostic.IDE1006.severity = suggestion
201208

@@ -205,4 +212,8 @@ dotnet_diagnostic.RS1026.severity = none
205212

206213
dotnet_diagnostic.CA1806.severity = none
207214
dotnet_diagnostic.CA1826.severity = none
215+
dotnet_diagnostic.CA1860.severity = none
216+
dotnet_diagnostic.CA1861.severity = none
208217
dotnet_diagnostic.CA2231.severity = none
218+
219+
dotnet_diagnostic.SYSLIB1045.severity = silent # Use 'GeneratedRegexAttribute' to generate the regular expression implementation at compile-time.

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
working-directory: src/Snippetica.CodeGeneration.SnippetGenerator
8181
- run: dotnet build --no-restore
8282
working-directory: src/Snippetica.CodeGeneration.SnippetGenerator
83-
- run: "src/Snippetica.CodeGeneration.SnippetGenerator/bin/Release/net6.0/Snippetica.CodeGeneration.SnippetGenerator src src/Snippetica.CodeGeneration.Metadata/Data"
83+
- run: "src/Snippetica.CodeGeneration.SnippetGenerator/bin/Release/net8.0/Snippetica.CodeGeneration.SnippetGenerator src src/Snippetica.CodeGeneration.Metadata/Data"
8484
name: "Generate snippets"
8585
working-directory: "."
8686
- uses: microsoft/[email protected]
@@ -129,7 +129,7 @@ jobs:
129129
working-directory: src/Snippetica.CodeGeneration.SnippetGenerator
130130
- run: dotnet build --no-restore
131131
working-directory: src/Snippetica.CodeGeneration.SnippetGenerator
132-
- run: "./src/Snippetica.CodeGeneration.SnippetGenerator/bin/Release/net6.0/Snippetica.CodeGeneration.SnippetGenerator src src/Snippetica.CodeGeneration.Metadata/Data"
132+
- run: "./src/Snippetica.CodeGeneration.SnippetGenerator/bin/Release/net8.0/Snippetica.CodeGeneration.SnippetGenerator src src/Snippetica.CodeGeneration.Metadata/Data"
133133
working-directory: "."
134134
name: "Generate snippets"
135135
- run: >

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
## [2.1.0] - 2023-12-11
10+
911
### Fixed
1012

1113
- Fix snippets for abstract method ([PR](https://github.com/josefpihrt/snippetica/pull/82))

src/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<LangVersion>10.0</LangVersion>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<LangVersion>12.0</LangVersion>
66
<Authors>Josef Pihrt</Authors>
77
<Copyright>Copyright (c) 2016-2023 Josef Pihrt</Copyright>
88
<EnableNETAnalyzers>true</EnableNETAnalyzers>

src/Snippetica.CodeGeneration.Common/EnumerableExtensions.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ public static class EnumerableExtensions
99
{
1010
public static bool CountExceeds<TSource>(this IEnumerable<TSource> collection, int value)
1111
{
12-
if (collection is null)
13-
throw new ArgumentNullException(nameof(collection));
14-
15-
if (value < 0)
16-
throw new ArgumentOutOfRangeException(nameof(value));
12+
ArgumentNullException.ThrowIfNull(collection);
13+
ArgumentOutOfRangeException.ThrowIfNegative(value);
1714

1815
if (value == 0)
1916
return false;

src/Snippetica.CodeGeneration.Common/IO/IOUtility.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public static void SaveSnippet(Snippet snippet, bool onlyIfChanged = true)
4444

4545
public static void SaveSnippet(Snippet snippet, string filePath, bool onlyIfChanged = true)
4646
{
47-
if (snippet is null)
48-
throw new ArgumentNullException(nameof(snippet));
47+
ArgumentNullException.ThrowIfNull(snippet);
4948

5049
SaveOptions settings = CreateSaveSettings();
5150

src/Snippetica.CodeGeneration.Metadata/SnippeticaMetadata.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ namespace Snippetica.CodeGeneration;
1212

1313
public class SnippeticaMetadata
1414
{
15+
private static readonly JsonSerializerOptions _serializerOptions = new()
16+
{
17+
WriteIndented = true,
18+
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
19+
Converters = { new JsonStringEnumConverter() },
20+
ReadCommentHandling = JsonCommentHandling.Skip,
21+
};
22+
1523
public SnippetDirectory[] Directories { get; init; }
1624

1725
public ShortcutInfo[] Shortcuts { get; init; }
@@ -22,13 +30,7 @@ public static SnippeticaMetadata Load(string filePath, string sourcePath)
2230
{
2331
JsonSnippeticaMetadata jsonMetadata = JsonSerializer.Deserialize<JsonSnippeticaMetadata>(
2432
File.ReadAllText(filePath),
25-
new JsonSerializerOptions()
26-
{
27-
WriteIndented = true,
28-
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
29-
Converters = { new JsonStringEnumConverter() },
30-
ReadCommentHandling = JsonCommentHandling.Skip,
31-
});
33+
_serializerOptions);
3234

3335
var metadata = new SnippeticaMetadata()
3436
{

src/Snippetica.CodeGeneration.SnippetGenerator/Program.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ private static void SaveChangedSnippets(SnippetDirectory[] directories)
115115

116116
private static IEnumerable<(string, List<Snippet>)> FindDuplicateShortcuts(IEnumerable<Snippet> snippets)
117117
{
118-
if (snippets is null)
119-
throw new ArgumentNullException(nameof(snippets));
118+
ArgumentNullException.ThrowIfNull(snippets);
120119

121120
return FindDuplicateShortcuts();
122121

src/Snippetica.VisualStudioCode.Vsix/Snippetica.CSharp/package/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
## [2.1.0] - 2023-12-11
10+
11+
### Fixed
12+
13+
- Fix snippets for abstract method ([PR](https://github.com/josefpihrt/snippetica/pull/82))
14+
915
## [2.0.2] - 2023-11-05
1016

1117
## [2.0.1] - 2023-11-05

src/Snippetica.VisualStudioCode.Vsix/Snippetica.Cpp/package/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
## [2.1.0] - 2023-12-11
10+
11+
### Fixed
12+
13+
- Fix snippets for abstract method ([PR](https://github.com/josefpihrt/snippetica/pull/82))
14+
915
## [2.0.2] - 2023-11-05
1016

1117
## [2.0.1] - 2023-11-05

0 commit comments

Comments
 (0)