Skip to content

Commit d4d27d8

Browse files
authored
Release 4.5.0 (#1189)
1 parent 914b232 commit d4d27d8

File tree

8 files changed

+114
-24
lines changed

8 files changed

+114
-24
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.5.0] - 2023-08-27
11+
1012
### Added
1113

1214
- Add SECURITY.md ([#1147](https://github.com/josefpihrt/roslynator/pull/1147))

src/Analyzers.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,13 +1441,17 @@ void M(
14411441
<MessageFormat>A line is too long ({0} characters).</MessageFormat>
14421442
<DefaultSeverity>Info</DefaultSeverity>
14431443
<IsEnabledByDefault>false</IsEnabledByDefault>
1444-
<Summary>This analyzer reports any line that is longer than maximal length.
1444+
<Summary>This analyzer reports any line that is longer than maximum length.
14451445

1446-
Default maximal length is 140.</Summary>
1446+
Default maximum length is 140.</Summary>
14471447
<ConfigOptions>
14481448
<Option Key="max_line_length" />
14491449
<Option Key="tab_length" />
14501450
</ConfigOptions>
1451+
<Remarks>Code fixer is available for this analyzer but it cannot handle all cases as it's not possible to wrap a line in all cases (e.g. long string literals).
1452+
1453+
If a particular line seems that it could be reasonably wrapped but it's not, please file an [issue](https://github.com/JosefPihrt/Roslynator/issues/new).
1454+
</Remarks>
14511455
</Analyzer>
14521456
<Analyzer>
14531457
<Id>RCS0057</Id>
@@ -7416,12 +7420,12 @@ void M()
74167420
<SupportsFadeOut>true</SupportsFadeOut>
74177421
<Summary>This analyzer reports unnecessary syntax that can be safely removed such as:
74187422
* empty destructor
7419-
* empty 'else' clause
7420-
* empty empty statement
7421-
* empty 'finally' clause
7422-
* empty namespace declaration
7423+
* empty `else` clause
7424+
* empty `finally` clause
7425+
* empty `namespace` declaration
74237426
* empty object initializer
7424-
* empty region directive
7427+
* empty `#region`
7428+
* empty statement
74257429
</Summary>
74267430
</Analyzer>
74277431
<Analyzer Identifier="AddOrRemoveTrailingComma">

src/Common/ConfigOptions.Generated.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static partial class ConfigOptions
132132
key: ConfigOptionKeys.MaxLineLength,
133133
defaultValue: "140",
134134
defaultValuePlaceholder: "<NUM>",
135-
description: "Max line length");
135+
description: "Maximum line length");
136136

137137
public static readonly ConfigOptionDescriptor NewLineAtEndOfFile = new(
138138
key: ConfigOptionKeys.NewLineAtEndOfFile,
@@ -186,13 +186,13 @@ public static partial class ConfigOptions
186186
key: ConfigOptionKeys.TabLength,
187187
defaultValue: "4",
188188
defaultValuePlaceholder: "<NUM>",
189-
description: "A length of a tab character.");
189+
description: "A number of spaces that are equivalent to a tab character");
190190

191191
public static readonly ConfigOptionDescriptor TrailingCommaStyle = new(
192192
key: ConfigOptionKeys.TrailingCommaStyle,
193193
defaultValue: null,
194194
defaultValuePlaceholder: "include|omit|omit_when_single_line",
195-
description: "Include/omit trailing comma in initializer or enum.");
195+
description: "Include/omit trailing comma in initializer or enum");
196196

197197
public static readonly ConfigOptionDescriptor UseAnonymousFunctionOrMethodGroup = new(
198198
key: ConfigOptionKeys.UseAnonymousFunctionOrMethodGroup,

src/ConfigOptions.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@
122122
<Option Id="MaxLineLength">
123123
<DefaultValue>140</DefaultValue>
124124
<ValuePlaceholder>&lt;NUM&gt;</ValuePlaceholder>
125-
<Description>Max line length</Description>
125+
<Description>Maximum line length</Description>
126126
</Option>
127127
<Option Id="TabLength">
128128
<DefaultValue>4</DefaultValue>
129129
<ValuePlaceholder>&lt;NUM&gt;</ValuePlaceholder>
130-
<Description>A number of spaces that are equivalent to a tab character.</Description>
130+
<Description>A number of spaces that are equivalent to a tab character</Description>
131131
</Option>
132132
<Option Id="NewLineAtEndOfFile">
133133
<ValuePlaceholder>true|false</ValuePlaceholder>
@@ -205,7 +205,7 @@
205205
<Description>Add/remove blank line after file scoped namespace declaration</Description>
206206
</Option>
207207
<Option Id="TrailingCommaStyle">
208-
<Description>Include/omit trailing comma in initializer or enum.</Description>
208+
<Description>Include/omit trailing comma in initializer or enum</Description>
209209
<Values>
210210
<Value>include</Value>
211211
<Value>omit</Value>

src/Roslynator.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
99
..\.editorconfig = ..\.editorconfig
1010
..\.github\workflows\build.yml = ..\.github\workflows\build.yml
1111
..\ChangeLog.md = ..\ChangeLog.md
12+
VisualStudioCode\package\CHANGELOG.md = VisualStudioCode\package\CHANGELOG.md
1213
Directory.Build.props = Directory.Build.props
1314
..\README.md = ..\README.md
1415
spellcheck = spellcheck

src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public static string CreateAnalyzerMarkdown(AnalyzerMetadata analyzer, Immutable
135135
string title = analyzer.Title.TrimEnd('.');
136136

137137
MDocument document = Document(
138-
CreateFrontMatter(label: analyzer.Id),
138+
CreateFrontMatter(label: (string.IsNullOrEmpty(analyzer.ObsoleteMessage)) ? analyzer.Id : $"[deprecated] {analyzer.Id}"),
139139
Heading1($"{analyzer.Id}: {title}"),
140140
CreateObsoleteWarning(analyzer),
141141
Heading2("Properties"),
@@ -190,7 +190,8 @@ static IEnumerable<object> CreateConfiguration(AnalyzerMetadata analyzer, Immuta
190190
.Select(f => InlineCode(f.Key))
191191
.ToArray();
192192

193-
yield return CreateRequiredOptionsInfoBlock(requiredOptions);
193+
if (requiredOptions.Any())
194+
yield return CreateRequiredOptionsInfoBlock(requiredOptions);
194195

195196
var sb = new StringBuilder();
196197
var isFirst = true;
@@ -205,8 +206,19 @@ static IEnumerable<object> CreateConfiguration(AnalyzerMetadata analyzer, Immuta
205206

206207
isFirst = false;
207208

208-
sb.Append('#');
209-
sb.AppendLine(en.Current.Description);
209+
sb.Append("# ");
210+
211+
if (!string.IsNullOrEmpty(en.Current.Description))
212+
sb.AppendLine(en.Current.Description);
213+
214+
string defaultValue = en.Current.DefaultValue;
215+
216+
if (!string.IsNullOrEmpty(defaultValue))
217+
{
218+
sb.Append("# Default value is ");
219+
sb.AppendLine(defaultValue);
220+
}
221+
210222
sb.Append(en.Current.Key);
211223
sb.Append(" = ");
212224
sb.Append(en.Current.DefaultValuePlaceholder ?? "true");
@@ -227,9 +239,6 @@ static MContainer CreateRequiredOptionsInfoBlock(MInlineCode[] requiredOptions)
227239

228240
static IEnumerable<MObject> CreateContent(MInlineCode[] requiredOptions)
229241
{
230-
if (!requiredOptions.Any())
231-
yield break;
232-
233242
if (requiredOptions.Length == 1)
234243
{
235244
yield return Inline("Option ", requiredOptions[0], " is required to be set for this analyzer to work.");
@@ -256,13 +265,13 @@ static IEnumerable<MElement> CreateAppliesTo(AnalyzerMetadata analyzer)
256265
}
257266

258267
if (analyzer.Id.StartsWith("RCS0"))
259-
yield return BulletItem(Link("Roslynator.Formatting.Analyzers", "https://www.nuget.org/packages/Roslynator.Formatting.Analyzers"));
268+
yield return BulletItem(Link(new[] { "Package ", "Roslynator.Formatting.Analyzers" }, "https://www.nuget.org/packages/Roslynator.Formatting.Analyzers"));
260269

261270
if (analyzer.Id.StartsWith("RCS1"))
262-
yield return BulletItem(Link("Roslynator.Analyzers", "https://www.nuget.org/packages/Roslynator.Analyzers"));
271+
yield return BulletItem(Link(new[] { "Package ", "Roslynator.Analyzers" }, "https://www.nuget.org/packages/Roslynator.Analyzers"));
263272

264273
if (analyzer.Id.StartsWith("RCS9"))
265-
yield return BulletItem(Link("Roslynator.CodeAnalysis.Analyzers", "https://www.nuget.org/packages/Roslynator.CodeAnalysis.Analyzers"));
274+
yield return BulletItem(Link(new[] { "Package ", "Roslynator.CodeAnalysis.Analyzers" }, "https://www.nuget.org/packages/Roslynator.CodeAnalysis.Analyzers"));
266275
}
267276
}
268277

src/VisualStudioCode/package/CHANGELOG.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,80 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.5.0] - 2023-08-27
11+
12+
### Added
13+
14+
- Add SECURITY.md ([#1147](https://github.com/josefpihrt/roslynator/pull/1147))
15+
- Add custom FixAllProvider for [RCS1014](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1014) ([#1070](https://github.com/JosefPihrt/Roslynator/pull/1070)).
16+
- Add more cases to [RCS1097](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1097) ([#1160](https://github.com/JosefPihrt/Roslynator/pull/1160)).
17+
- Add analyzer "Use enum field explicitly" ([RCS1257](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1257)) ([#889](https://github.com/josefpihrt/roslynator/pull/889)).
18+
- Enabled by default.
19+
- Add analyzer "Unnecessary enum flag" [RCS1258](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1258) ([#886](https://github.com/JosefPihrt/Roslynator/pull/886)).
20+
- Enabled by default.
21+
- Make `Roslynator.Rename.SymbolRenamer` public ([#1161](https://github.com/josefpihrt/roslynator/pull/1161))
22+
- Analyzer 'Remove empty syntax' ([RCS1259](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1259)) ([#913](https://github.com/josefpihrt/roslynator/pull/913)).
23+
- This analyzer replaces following analyzers:
24+
- Remove empty empty statement ([RCS1038](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1038))
25+
- Remove empty 'else' clause ([RCS1040](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1040))
26+
- Remove empty object initializer ([RCS1041](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1041))
27+
- Remove empty 'finally' clause ([RCS1066](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1066))
28+
- Remove empty namespace declaration ([RCS1072](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1072))
29+
- Remove empty region directive ([RCS1091](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1091))
30+
- Remove empty destructor ([RCS1106](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1106))
31+
- [CLI] Add glob pattern matching (`--include` or/and `--exclude`) ([#1178](https://github.com/josefpihrt/roslynator/pull/1178), [#1183](https://github.com/josefpihrt/roslynator/pull/1183)).
32+
- Add analyzer "Include/omit trailing comma" ([RCS1256](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1256.md)) ([#931](https://github.com/JosefPihrt/Roslynator/pull/931)).
33+
- Required option: `roslynator_trailing_comma_style = include|omit|omit_when_single_line`
34+
- Not enabled by default
35+
36+
### Changed
37+
38+
- [CLI] Open help in web browser when running command `roslynator help <COMMAND>` ([#1179](https://github.com/josefpihrt/roslynator/pull/1179))
39+
40+
### Fixed
41+
42+
- Fix [RCS1187](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1187) ([#1150](https://github.com/JosefPihrt/Roslynator/pull/1150)).
43+
- Fix [RCS1056](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1056) ([#1154](https://github.com/JosefPihrt/Roslynator/pull/1154)).
44+
- Fix [RCS1208](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1208) ([#1153](https://github.com/JosefPihrt/Roslynator/pull/1153)).
45+
- Fix [RCS1043](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1043) ([#1176](https://github.com/JosefPihrt/Roslynator/pull/1176)).
46+
- [CLI] Fix exit code of `spellcheck` command ([#1177](https://github.com/JosefPihrt/Roslynator/pull/1177)).
47+
- Improve indentation analysis ([#1188](https://github.com/JosefPihrt/Roslynator/pull/1188)).
48+
49+
## [4.4.0] - 2023-08-01
50+
51+
### Added
52+
53+
- Add GitHub workflow ([#1112](https://github.com/josefpihrt/roslynator/pull/1112))
54+
55+
### Changed
56+
57+
- [CLI] Bump Roslyn to 4.6.0 ([#1106](https://github.com/josefpihrt/roslynator/pull/1106)).
58+
- Bump Roslyn to 4.4.0 ([#1116](https://github.com/josefpihrt/roslynator/pull/1116)).
59+
- Migrate documentation to [Docusaurus](https://josefpihrt.github.io/docs/roslynator) ([#922](https://github.com/josefpihrt/roslynator/pull/922)).
60+
- [Testing Framework] Bump Roslyn to 4.6.0 ([#1144](https://github.com/josefpihrt/roslynator/pull/1144)).
61+
62+
### Fixed
63+
64+
- Fix [RCS1016](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1016) ([#1090](https://github.com/josefpihrt/roslynator/pull/1090)).
65+
- Improve inversion of logical expressions to handling additional cases ([#1086](https://github.com/josefpihrt/roslynator/pull/1086)).
66+
- Fix [RCS1084](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1084) ([#1085](https://github.com/josefpihrt/roslynator/pull/1085)).
67+
- Fix [RCS1169](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1169) ([#1092](https://github.com/JosefPihrt/Roslynator/pull/1092)).
68+
- Recognize more shapes of IAsyncEnumerable as being Async ([RCS1047](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1047)) ([#1084](https://github.com/josefpihrt/roslynator/pull/1084)).
69+
- Fix [RCS1197](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1197) ([#1093](https://github.com/JosefPihrt/Roslynator/pull/1093)).
70+
- Fix [RCS1056](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1056) ([#1096](https://github.com/JosefPihrt/Roslynator/pull/1096)).
71+
- Fix [RCS1216](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1216) ([#1094](https://github.com/JosefPihrt/Roslynator/pull/1094)).
72+
- Fix [RCS1146](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1146) ([#1098](https://github.com/JosefPihrt/Roslynator/pull/1098)).
73+
- Fix [RCS1154](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1154) ([#1105](https://github.com/JosefPihrt/Roslynator/pull/1105)).
74+
- Fix [RCS1211](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1211) ([#1095](https://github.com/JosefPihrt/Roslynator/pull/1095)).
75+
- Fix [RCS0005](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0005) ([#1114](https://github.com/JosefPihrt/Roslynator/pull/1114)).
76+
- Fix [RCS1176](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1176) ([#1122](https://github.com/JosefPihrt/Roslynator/pull/1122), [#1140](https://github.com/JosefPihrt/Roslynator/pull/1140)).
77+
- Fix [RCS1085](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1085) ([#1120](https://github.com/josefpihrt/roslynator/pull/1120)).
78+
- Fix [RCS1208](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1208) ([#1119](https://github.com/JosefPihrt/Roslynator/pull/1119)).
79+
- [CLI] Fix member full declaration in generated documentation (command `generate-doc`) ([#1130](https://github.com/josefpihrt/roslynator/pull/1130)).
80+
- Append `?` to nullable reference types.
81+
- Fix [RCS1179](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1179) ([#1129](https://github.com/JosefPihrt/Roslynator/pull/1129)).
82+
- Fix [RCS0060](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0060) ([#1139](https://github.com/JosefPihrt/Roslynator/pull/1139)).
83+
1084
## [4.3.0] - 2023-04-24
1185

1286
### Changed

tools/generate_metadata.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dotnet restore "../src/Tools/Tools.sln" --force
2-
dotnet build "../src/Tools/Tools.sln" --no-restore /p:"Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=1591" /m
2+
dotnet build "../src/Tools/Tools.sln" --no-restore /p:"Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=`"1591,RS1025,RS1026`"" /m
33

44
if(!$?) { Read-Host; Exit }
55

0 commit comments

Comments
 (0)