question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation culture settings are ignored in the stylecop.json

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jamestoyercommented, Jun 3, 2017

@Gusdor So it turns out if you install the pre-release version it does appear to work as expected. v1.1.0-beta001 for reference

0reactions
AngusMcIntyrecommented, Feb 3, 2017

Was 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:

{
  "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
  "settings": {
    "documentationRules": {
      "documentPrivateFields": true,
      "documentPrivateElements":  true,
      "documentationCulture": "en-GB"
    }
  }
}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found