Skip to content

Commit

Permalink
Merge branch 'main' into mfogliatto/add-otlplogexporter-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mfogliatto authored Mar 9, 2023
2 parents aa64c70 + c1f1116 commit 5ce3339
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 7 deletions.
12 changes: 7 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Fixes #.
Fixes #
Design discussion issue #

## Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:
## Merge requirement checklist

* [ ] Appropriate `CHANGELOG.md` updated for non-trivial changes
* [ ] Design discussion issue #
* [ ] Changes in public API reviewed
* [ ] [CONTRIBUTING](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/CONTRIBUTING.md) guidelines followed (nullable enabled, static analysis, etc.)
* [ ] Unit tests added/updated
* [ ] Appropriate `CHANGELOG.md` files updated for non-trivial changes
* [ ] Changes in public API reviewed (if applicable)
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,42 @@ only and does not affect the actual build of the project.
This repository also includes StyleCop ruleset files under the `./build` folder.
These files are used to configure the _StyleCop.Analyzers_ which runs during
build. Breaking the rules will result in a build failure.

## New projects

New projects are required to:

* Use [nullable reference
types](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/nullable-reference-types).

This should be enabled automatically via
[Common.props](https://github.com/open-telemetry/opentelemetry-dotnet/blob/990deee419ab4c1449efd628bed3df57a50963a6/build/Common.props#L9).
New project MUST NOT disable this.

* Pass [static
analysis](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/overview).

New projects MUST enable static analysis by specifying
`<AnalysisLevel>latest-all</AnalysisLevel>` in the project file (`.csproj`).

> **Note**
> There are other project-level features enabled automatically via
[Common.props](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/build/Common.props)
new projects must NOT manually override these settings.

## New code

New code files MUST enable [nullable reference
types](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/nullable-reference-types)
manually in projects where it is not automatically enabled project-wide. This is
done by specifying `#nullable enable` towards the top of the file (usually after
the copyright header). We are currently working towards enabling nullable
context in every project by updating code as it is worked on, this requirement
is to make sure the surface area of code needing updates is shrinking and not
expanding.

> **Note**
> The first time a project is updated to use nullable context in public APIs
some housekeeping needs to be done in public API definitions (`.publicApi`
folder). This can be done automatically via a code fix offered by the public API
analyzer.
2 changes: 1 addition & 1 deletion examples/MicroserviceExample/WebApi/WebApi.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5ce3339

Please sign in to comment.