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.

Improve Documentation Around `// <auto-generated/>`

See original GitHub issue

We have a third party source file that we are using (NDesk.Options) which has its own code style. We do not want to apply any formatting to this file. Instead we want to exclude this from analysis/formatting.

As per https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2960#issuecomment-642851675

The way to work around this is to put this at the top of the file:

// <auto-generated/>

However testing dotnet-format has shown that this MUST be the first line of the file, where as Visual Studio/Roslyn Analyzers appear to be a bit more forgiving (it looks like so long as it is part of the first comment block it works).

This should probably be documented somewhere if this is intended.

C:\GitHub\VisualStudioSolutionUpdater>dotnet format --version
5.0.152601+7d7b7f05e9ed67cc4c983b9164add3eb32fa6518

FWIW the .editorconfig suggestion also works as documented by Sam and should probably be called out as well.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sharwellcommented, Nov 5, 2020

However testing dotnet-format has shown that this MUST be the first line of the file

This is a bug in dotnet-format

0reactions
JoeRobichcommented, Nov 6, 2020

@aolszowka No worries. I agree that we should have documentation for this scenario. We also support the generated_code editorconfig settings described in https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019#configure-generated-code

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation generators: 6 great tools you should know
A documentation generator is a tool that programmatically generates technical and software documentation. Most commonly, auto-generated documentation is used ...
Read more >
The secret to successful autogenerated docs - ezyang's blog
The secret to successful autogenerated docs · It's OK not to write documentation immediately after writing code (better not yet than poorly).
Read more >
Is there any logical reason to auto-generate code ...
The only time you should need any kind of documentation for code is to explain why a method/function is doing something, the name...
Read more >
Mintlify taps AI to automatically generate documentation ...
Mintlify aims to address the challenges around documentation with automation, specifically auto-generating documentation.
Read more >
Auto generate function documentation in Visual Studio
Don't just stop with the autogenerated documentation. The value of a tool like this is that it automatically generates the documentation that ...
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