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.

When i change stylecop.json to include "xmlHeader": false" and remove XML headers, it gives SA1633 "The file header XML is invalid" warning

See original GitHub issue

SA1633 should not occur with “xmlHeader”: false". Disabling SA1633 causes all header checking to be disabled, but I want the header to be checked as specified by StyleCop docs.

Sample json:

{
  "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
  "settings": {
    "documentationRules": {
      "copyrightText": "Copyright (c) 2013-2017  XYZ LLC."
	  "xmlHeader": false"
	  headerDecoration": "--------------------------------------------------------------------------------------------------------------------"
    }
  }
}

Sample CS file:

// --------------------------------------------------------------------------------------------------------------------
// Copyright (c) 2013-2017  XYZ LLC.
// --------------------------------------------------------------------------------------------------------------------

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sharwellcommented, Jun 26, 2017
{
  "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
  "settings": {
    "documentationRules": {
      "xmlHeader": false,
      "copyrightText": "{decoration}\r\nCopyright (c) 2013-2017  {companyName}.\r\n{decoration}",
      "companyName": "XYZ LLC",
      "variables": {
        "decoration": "--------------------------------------------------------------------------------------------------------------------"
      }
    }
  }
}
0reactions
sharwellcommented, Jun 26, 2017

@philipag I forgot we fixed that a long time ago, so everything works if you just put \n in the settings file. I filed #2477 to make everything also “just work” if you put \r\n in the settings file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does "File has no header" build warning in visual ...
cs files. I've googled but get swamped with results for "SA1633: The file has no header, the header Xml is invalid, or the...
Read more >
stylecop.json 1.0.5
stylecop.json ... raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
Read more >
StyleCop: A Detailed Guide to Starting and Using It
First, you can use rule set files to configure which rules are checked and how strongly you feel about them. Second, you can...
Read more >
StyleCop Rules Documentation
The StyleCop tool provides warnings that indicate style and consistency rule violations in C# code. By default, the tool integrates into Visual Studio...
Read more >
Stylecop.json setting is ignored during code cleanup and ...
Add file header option is presented when stylecop.json is in project. I'm expecting the same for code cleanup automatically when "Update file header"...
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