Skip to content

Commit 423466b

Browse files
authored
Bump version to v3.5.3 (#463)
* Bump version to v3.5.3 * Add "/d:sonar.scanner.scanAll=false" for sonar scanner
1 parent e74de13 commit 423466b

7 files changed

Lines changed: 18 additions & 27 deletions

File tree

.github/workflows/SonarCloud.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
# (PRs from forks can't access secrets other than secrets.GITHUB_TOKEN for security reasons)
1818
if: ${{ !github.event.pull_request.head.repo.fork }}
1919
env:
20-
version: '3.5.2'
21-
versionFile: '3.5.2'
20+
version: '3.5.3'
21+
versionFile: '3.5.3'
2222
steps:
2323
- name: Set up JDK 17
2424
uses: actions/setup-java@v4
@@ -53,7 +53,7 @@ jobs:
5353
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5454
shell: powershell
5555
run: |
56-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ github.event.repository.owner.login }}_SmartFormat" /o:"${{ github.event.repository.owner.login }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.exclusions="**/SmartFormat.ZString/**/*" /d:sonar.cs.opencover.reportsPaths="./src/SmartFormat.Tests/**/coverage*.xml"
56+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ github.event.repository.owner.login }}_SmartFormat" /o:"${{ github.event.repository.owner.login }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.scanner.scanAll=false /d:sonar.host.url="https://sonarcloud.io" /d:sonar.exclusions="**/SmartFormat.ZString/**/*" /d:sonar.cs.opencover.reportsPaths="./src/SmartFormat.Tests/**/coverage*.xml"
5757
dotnet sln ./src/SmartFormat.sln remove ./src/Demo/Demo.csproj
5858
dotnet add ./src/SmartFormat.Tests/SmartFormat.Tests.csproj package AltCover
5959
dotnet restore ./src/SmartFormat.sln

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ for:
2727
- ps: dotnet restore SmartFormat.sln --verbosity quiet
2828
- ps: dotnet add .\SmartFormat.Tests\SmartFormat.Tests.csproj package AltCover
2929
- ps: |
30-
$version = "3.5.2"
30+
$version = "3.5.3"
3131
$versionFile = $version + "." + ${env:APPVEYOR_BUILD_NUMBER}
3232
3333
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {

src/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<Copyright>Copyright 2011-$(CurrentYear) SmartFormat Project</Copyright>
99
<RepositoryUrl>https://github.com/axuno/SmartFormat.git</RepositoryUrl>
1010
<PublishRepositoryUrl>true</PublishRepositoryUrl>
11-
<Version>3.5.2</Version>
12-
<FileVersion>3.5.2</FileVersion>
11+
<Version>3.5.3</Version>
12+
<FileVersion>3.5.3</FileVersion>
1313
<AssemblyVersion>3.0.0</AssemblyVersion> <!--only update AssemblyVersion with major releases -->
1414
<LangVersion>latest</LangVersion>
1515
<EnableNETAnalyzers>true</EnableNETAnalyzers>

src/SmartFormat/Core/Parsing/SplitList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public Format this[int index]
5858
{
5959
get
6060
{
61-
if (index > _splits.Count) throw new ArgumentOutOfRangeException(nameof(index)); //NOSONAR - ArgumentOutOfRangeException.ThrowIfGreaterThan < net5.0
61+
// Can't use ArgumentOutOfRangeException.ThrowIfGreaterThan < net5.0
62+
if (index > _splits.Count) throw new ArgumentOutOfRangeException(nameof(index)); //NOSONAR
6263

6364
if (_splits.Count == 0) return _format;
6465

src/SmartFormat/Extensions/PersistentVariables/VariablesGroup.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,7 @@ public void Add(string name, IVariable variable)
123123
/// <returns><see langword="true"/> if a variable with the specified name was removed, <see langword="false"/> if one was not.</returns>
124124
public bool Remove(string name)
125125
{
126-
if (_variableLookup.TryGetValue(name, out var v))
127-
{
128-
return _variableLookup.Remove(name);
129-
}
130-
return false;
126+
return _variableLookup.Remove(name);
131127
}
132128

133129
/// <summary>
@@ -200,4 +196,4 @@ public void Clear()
200196
{
201197
_variableLookup.Clear();
202198
}
203-
}
199+
}

src/SmartFormat/Extensions/PersistentVariablesSource.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,7 @@ public void Add(string name, VariablesGroup group)
139139
/// <returns><see langword="true"/> if a <see cref="VariablesGroup"/> with a matching name was found and removed, or <see langword="true"/> if one was not.</returns>
140140
public bool Remove(string name)
141141
{
142-
if (GroupLookup.TryGetValue(name, out var v))
143-
{
144-
GroupLookup.Remove(name);
145-
return true;
146-
}
147-
148-
return false;
142+
return GroupLookup.Remove(name);
149143
}
150144

151145
/// <inheritdoc cref="Remove(string)"/>
@@ -248,4 +242,4 @@ private static bool TryEvaluateGroup(ISelectorInfo selectorInfo, IVariablesGroup
248242
selectorInfo.Result = variable.GetValue();
249243
return true;
250244
}
251-
}
245+
}

src/SmartFormat/Extensions/PluralLocalizationFormatter.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public PluralLocalizationFormatter(string defaultTwoLetterIsoLanguageName)
4949
}
5050

5151
/// <summary>
52-
/// Gets or sets the two letter ISO language name.
52+
/// Gets or sets the two-letter ISO language name.
5353
/// </summary>
5454
/// <remarks>
5555
/// Culture is now determined in this sequence:<br/>
@@ -79,7 +79,7 @@ public PluralLocalizationFormatter(string defaultTwoLetterIsoLanguageName)
7979
/// With <see cref="CanAutoDetect"/> == <see langword="false"/>, the formatter can only be
8080
/// called by its name in the input format string.
8181
/// <para/>
82-
/// <b>Auto detection only works with more than 1 format argument.
82+
/// <b>Auto-detection only works with more than 1 format argument.
8383
/// It is recommended to set <see cref="CanAutoDetect"/> to <see langword="false"/>. This will be the default in a future version.
8484
/// </b>
8585
/// </summary>
@@ -111,8 +111,8 @@ public bool TryEvaluateFormat(IFormattingInfo formattingInfo)
111111

112112
var useAutoDetection = string.IsNullOrEmpty(formattingInfo.Placeholder?.FormatterName);
113113

114-
// This extension requires at least two plural words for auto detection
115-
// Valid types for auto detection are checked later
114+
// This extension requires at least two plural words for auto-detection
115+
// Valid types for auto-detection are checked later
116116
if (useAutoDetection && pluralWords.Count <= 1) return false;
117117

118118
decimal value;
@@ -133,7 +133,7 @@ public bool TryEvaluateFormat(IFormattingInfo formattingInfo)
133133
break;
134134
default:
135135
{
136-
// Auto detection calls just return a failure to evaluate
136+
// Auto-detection calls just return a failure to evaluate
137137
if (useAutoDetection) return false;
138138

139139
// throw, if the formatter has been called explicitly
@@ -150,7 +150,7 @@ public bool TryEvaluateFormat(IFormattingInfo formattingInfo)
150150

151151
if (pluralIndex < 0 || pluralWords.Count <= pluralIndex)
152152
throw new FormattingException(format, $"Invalid number of plural parameters in {nameof(PluralLocalizationFormatter)}",
153-
pluralWords.Last().EndIndex);
153+
pluralWords.Count - 1);
154154

155155
// Output the selected word (allowing for nested formats):
156156
var pluralForm = pluralWords[pluralIndex];

0 commit comments

Comments
 (0)