dotnet / dotnet/format

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

Open
#856 5 comments 0 reactions 0 assignees View on GitHub
Documentation
Dominant language
No language data
Stars
1.9k
Forks
173
Avg merge
10d 13h
Merged PRs (30d)
1

Description

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:

```csharp
//
```

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.