Documentation culture settings are ignored in the stylecop.json
See original GitHub issueI use next settings in the stylecop.json with StyleCop Analyzers 1.1.0-beta001:
{
"documentationRules": {
"documentationCulture": "ru-RU"
}
}
StyleCop warns me SA1642 (Constructor summary documentation must begin with standard text) when I use such comment:
/// <summary>
/// Инициализирует новый экземпляр <see cref="MyClass"/> .
/// </summary>
public MyClass()
{
}
But DocumentationResources.ru-RU.resx contains:
<data name="NonPrivateConstructorStandardTextFirstPart" xml:space="preserve">
<value>Инициализирует новый экземпляр {0} </value>
</data>
<data name="NonPrivateConstructorStandardTextSecondPart" xml:space="preserve">
<value />
</data>
My comment matches it even in last space. I think “documentationCulture”: “ru-RU” is ignored because when I used English comment SA1642 warning was gone:
/// <summary>
/// Initializes a new instance of the <see cref="MyClass"/> class.
/// </summary>
public MyClass()
{
}
No warning. But it’s suspicious that DocumentationResources.resx contains “Initializes a new instance of the {0}” instead of “Initializes a new instance of the {0} class”:
<data name="NonPrivateConstructorStandardTextFirstPart" xml:space="preserve">
<value>Initializes a new instance of the </value>
</data>
<data name="NonPrivateConstructorStandardTextSecondPart" xml:space="preserve">
<value> {0}</value>
</data>
Working comment doesn’t matches English resource file.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Documentation culture settings are ignored in the stylecop. ...
I use next settings in the stylecop.json with StyleCop Analyzers 1.1.118 { "documentationRules": { "documentationCulture": "ru-RU" } ...
Read more >NET 6 StyleCop.Analyzers ignores "documentationCulture"
But StyleCop wants me to change this word to default "Initializes" word of "en-US" culture, so ignoring documentationCulture parameter value.
Read more >StyleCop SA1642: Not respecting language configuration
JSON. The problem is, that Rider still shows the SA1642 message and expects the (e.g.) constructor documentation to be in english.
Read more >Stylecop.json setting is ignored during code cleanup and ...
I have following stylecop.json file: { "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.
Read more >StyleCop for .NET Makes Code Better
StyleCop de facto is a standard tool for .NET. It analyzes C# source code to enforce a set of style and consistency rules....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Gusdor So it turns out if you install the pre-release version it does appear to work as expected.
v1.1.0-beta001
for referenceWas there any movement on this? I really want to roll out analysers but my team with throw seven fits if they are stuck with ‘z’ in ‘Initialises’. Ghastly! en-GB not working for me. I’ve followed the recommended steps (doctoring csproj file, adding stylecop.json).
csproj:
<AdditionalFiles Include="stylecop.json" />
stylecop.json: