Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repo] dotnet format ci follow-up #5012

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/dotnet-format-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- '.editorconfig'

jobs:
check-format:
check-format-stable:
runs-on: windows-latest

steps:
Expand All @@ -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 --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 --verify-no-changes
run: dotnet format OpenTelemetry.sln --no-restore --verify-no-changes
env:
ExposeExperimentalFeatures: true
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace OpenTelemetry.Logs;
#if EXPOSE_EXPERIMENTAL_FEATURES
public
#else
internal
internal
#endif
static class OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace OpenTelemetry.Logs;
#if EXPOSE_EXPERIMENTAL_FEATURES
public
#else
internal
internal
#endif
static class OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ public void W3CTraceContextTestSuiteAsync(string value)
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;
Expand All @@ -84,7 +81,6 @@ public void W3CTraceContextTestSuiteAsync(string value)

return result;
});
#pragma warning restore SA1008 // Opening parenthesis should be spaced correctly

app.RunAsync();

Expand Down