[repo] dotnet format ci follow-up (#5012)

Co-authored-by: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com>
This commit is contained in:
Mikel Blanchard 2023-11-02 15:34:52 -07:00 committed by GitHub
parent defaffa91f
commit c8f939e60b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 12 deletions

View File

@ -10,12 +10,17 @@ name: dotnet format
on:
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.cs'
- '.editorconfig'
paths:
- '**.md'
jobs:
check-format:
check-format-stable:
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'
check-format-experimental:
runs-on: ubuntu-latest
steps:

View File

@ -13,7 +13,7 @@ on:
- '.editorconfig'
jobs:
check-format:
check-format-stable:
runs-on: windows-latest
steps:
@ -23,5 +23,28 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
- name: dotnet restore
run: dotnet restore
- name: dotnet format
run: dotnet format OpenTelemetry.sln --verify-no-changes
run: dotnet format OpenTelemetry.sln --no-restore --verify-no-changes
env:
ExposeExperimentalFeatures: false
check-format-experimental:
runs-on: windows-latest
steps:
- name: check out code
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
- name: dotnet restore
run: dotnet restore
- name: dotnet format
run: dotnet format OpenTelemetry.sln --no-restore --verify-no-changes
env:
ExposeExperimentalFeatures: true

View File

@ -29,7 +29,7 @@ namespace OpenTelemetry.Logs;
#if EXPOSE_EXPERIMENTAL_FEATURES
public
#else
internal
internal
#endif
static class OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions
{

View File

@ -25,7 +25,7 @@ namespace OpenTelemetry.Logs;
#if EXPOSE_EXPERIMENTAL_FEATURES
public
#else
internal
internal
#endif
static class OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions
{

View File

@ -57,9 +57,6 @@ public class W3CTraceContextTests : IDisposable
var builder = WebApplication.CreateBuilder();
using var app = builder.Build();
// disabling due to failing dotnet-format
// TODO: investigate why dotnet-format fails.
#pragma warning disable SA1008 // Opening parenthesis should be spaced correctly
app.MapPost("/", async ([FromBody] Data[] data) =>
{
var result = string.Empty;
@ -84,7 +81,6 @@ public class W3CTraceContextTests : IDisposable
return result;
});
#pragma warning restore SA1008 // Opening parenthesis should be spaced correctly
app.RunAsync();