Skip to content

Commit

Permalink
move to ImplicitUsings (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Nov 9, 2021
1 parent db14694 commit 2639611
Show file tree
Hide file tree
Showing 284 changed files with 566 additions and 1,510 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<SignAssembly>true</SignAssembly>
<Deterministic>true</Deterministic>
<Features>strict</Features>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<!-- We're aware it's out of support but this is a library and it doesn't require nca3.1. -->
Expand Down
7 changes: 7 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<ItemGroup>
<!-- Workaround the fact that http doesnt exist in earlier frameworks -->
<Using Remove="System.Net.Http"/>
<Using Remove="System.Net.Http.Json"/>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Sentry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".root", ".root", "{9D7E2F87
CHANGELOG.md = CHANGELOG.md
CONTRIBUTING.md = CONTRIBUTING.md
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
README.md = README.md
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Sentry.Extensibility;
using Sentry.Internal;
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/Sentry.Benchmarks/BreadcrumbOverheadBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;

namespace Sentry.Benchmarks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using BenchmarkDotNet.Attributes;

namespace Sentry.Benchmarks;
Expand Down
3 changes: 0 additions & 3 deletions benchmarks/Sentry.Benchmarks/FakeHttpClientFactory.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Sentry.Http;

namespace Sentry.Benchmarks;
Expand Down
1 change: 0 additions & 1 deletion benchmarks/Sentry.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Linq;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Environments;
Expand Down
1 change: 0 additions & 1 deletion benchmarks/Sentry.Benchmarks/RetryAfterHandlerOverhead.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Sentry.Internal.Http;
using static System.Threading.CancellationToken;
Expand Down
1 change: 0 additions & 1 deletion benchmarks/Sentry.Benchmarks/ScopeManagementBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using BenchmarkDotNet.Attributes;
using Sentry.Extensibility;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using BenchmarkDotNet.Attributes;

namespace Sentry.Benchmarks;
Expand Down
5 changes: 5 additions & 0 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Using Include="Sentry"/>
<Using Include="Sentry.Extensibility"/>
<Using Include="System.Diagnostics"/>
</ItemGroup>
</Project>
7 changes: 0 additions & 7 deletions samples/Sentry.Samples.AspNetCore.Basic/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Sentry.AspNetCore;

namespace Sentry.Samples.AspNetCore.Basic;

Expand Down
4 changes: 0 additions & 4 deletions samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace Sentry.Samples.AspNetCore.Blazor.Wasm;

Expand Down
3 changes: 0 additions & 3 deletions samples/Sentry.Samples.AspNetCore.Grpc/GameService.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Data;
using System.Net.Http;
using System.Threading.Tasks;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using Microsoft.Extensions.Logging;
using Sentry.AspNetCore.Samples.Grpc;

namespace Sentry.Samples.AspNetCore.Grpc;
Expand Down
2 changes: 0 additions & 2 deletions samples/Sentry.Samples.AspNetCore.Grpc/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Net;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Sentry.AspNetCore;
using Sentry.AspNetCore.Grpc;
Expand Down
5 changes: 0 additions & 5 deletions samples/Sentry.Samples.AspNetCore.Grpc/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Sentry.Samples.AspNetCore.Grpc;

public class Startup
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Samples.AspNetCore.Mvc.Models;
using Sentry;

namespace Samples.AspNetCore.Mvc.Controllers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using Microsoft.AspNetCore.Http;
using Sentry;
using Sentry.Extensibility;

namespace Samples.AspNetCore.Mvc;

public class ExampleEventProcessor : ISentryEventProcessor
Expand Down
3 changes: 0 additions & 3 deletions samples/Sentry.Samples.AspNetCore.Mvc/GameService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Data;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace Samples.AspNetCore.Mvc;

Expand Down
2 changes: 0 additions & 2 deletions samples/Sentry.Samples.AspNetCore.Mvc/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Net;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace Samples.AspNetCore.Mvc;

Expand Down
2 changes: 0 additions & 2 deletions samples/Sentry.Samples.AspNetCore.Mvc/SpecialException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Samples.AspNetCore.Mvc;

public class SpecialException : Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using Sentry;
using Sentry.Extensibility;

namespace Samples.AspNetCore.Mvc;

public class SpecialExceptionProcessor : SentryEventExceptionProcessor<SpecialException>
Expand Down
8 changes: 0 additions & 8 deletions samples/Sentry.Samples.AspNetCore.Mvc/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Sentry.AspNetCore;
using Sentry.Extensibility;

namespace Samples.AspNetCore.Mvc;

public class Startup
Expand Down
5 changes: 0 additions & 5 deletions samples/Sentry.Samples.AspNetCore.Serilog/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Sentry.Samples.AspNetCore3.Mvc.Models;

namespace Samples.AspNetCore5.Mvc.Controllers;
Expand Down
4 changes: 0 additions & 4 deletions samples/Sentry.Samples.AspNetCore5.Mvc/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Sentry.AspNetCore;
using Sentry.Extensibility;

namespace Sentry.Samples.AspNetCore5.Mvc;

Expand Down
7 changes: 0 additions & 7 deletions samples/Sentry.Samples.AspNetCore5.Mvc/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Sentry.AspNetCore;

namespace Sentry.Samples.AspNetCore5.Mvc;

public class Startup
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Microsoft.AspNetCore.Hosting;

// The entrypoint used when the function is deployed to AWS.
public class LambdaEntryPoint : Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;


// Only used for testing locally: dotnet run
public static class LocalEntryPoint
Expand Down
5 changes: 0 additions & 5 deletions samples/Sentry.Samples.Aws.Lambda.AspNetCoreServer/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

public class Startup
{
public Startup(IConfiguration configuration) => Configuration = configuration;
Expand Down
2 changes: 0 additions & 2 deletions samples/Sentry.Samples.Console.Basic/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Sentry;

using (SentrySdk.Init("https://eb18e953812b41c3aeb042e666fd3b5c@o447951.ingest.sentry.io/5428537"))
{
// The following exception is captured and sent to Sentry
Expand Down
4 changes: 0 additions & 4 deletions samples/Sentry.Samples.Console.Customized/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;
using System.Xml.Xsl;
using Sentry;
using Sentry.Extensibility;

// One of the ways to set your DSN is via an attribute:
// It could be set via AssemblyInfo.cs and patched via CI.
Expand Down
3 changes: 0 additions & 3 deletions samples/Sentry.Samples.EntityFramework/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using System.Linq;
using Sentry;

using var _ = SentrySdk.Init(o =>
{
Expand Down
1 change: 0 additions & 1 deletion samples/Sentry.Samples.GenericHost/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.IO;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down
4 changes: 0 additions & 4 deletions samples/Sentry.Samples.GenericHost/SampleHostedService.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Sentry;

internal class SampleHostedService : IHostedService
{
Expand Down
2 changes: 0 additions & 2 deletions samples/Sentry.Samples.Google.Cloud.Functions/Function.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;
using System.Threading.Tasks;
using Google.Cloud.Functions.Framework;
using Google.Cloud.Functions.Hosting;
using Microsoft.AspNetCore.Http;
Expand Down
1 change: 0 additions & 1 deletion samples/Sentry.Samples.Log4Net/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Security.Principal;
using log4net;
using log4net.Config;
Expand Down
3 changes: 0 additions & 3 deletions samples/Sentry.Samples.ME.Logging/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Sentry;
using Sentry.Extensions.Logging;

internal class Program
Expand Down
1 change: 0 additions & 1 deletion samples/Sentry.Samples.NLog/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using NLog;
using NLog.Config;
using NLog.Targets;
Expand Down
1 change: 0 additions & 1 deletion samples/Sentry.Samples.Serilog/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using Serilog;
using Serilog.Context;
using Serilog.Events;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Web;
using Sentry.Internal.ScopeStack;

Expand Down
3 changes: 0 additions & 3 deletions src/Sentry.AspNet/Internal/SystemWebHttpRequest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using Sentry.Extensibility;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Security.Claims;
using System.Web;
using Sentry.Extensibility;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using Google.Protobuf;
using Sentry.Extensibility;

Expand Down
1 change: 0 additions & 1 deletion src/Sentry.AspNetCore.Grpc/ScopeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.ComponentModel;
using Google.Protobuf;
using Grpc.Core;
Expand Down
2 changes: 0 additions & 2 deletions src/Sentry.AspNetCore.Grpc/SentryGrpcInterceptor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Interceptors;
using Microsoft.Extensions.Options;
Expand Down
2 changes: 0 additions & 2 deletions src/Sentry.AspNetCore/ApplicationBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
#if NETSTANDARD2_0
using IHostApplicationLifetime = Microsoft.AspNetCore.Hosting.IApplicationLifetime;
#else
Expand Down
1 change: 0 additions & 1 deletion src/Sentry.AspNetCore/AspNetCoreEventProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using Sentry.Extensibility;
using Sentry.Protocol;
using OperatingSystem = Sentry.Protocol.OperatingSystem;
Expand Down
1 change: 0 additions & 1 deletion src/Sentry.AspNetCore/AspNetCoreExceptionProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using Sentry.Extensibility;
using Sentry.Protocol;

Expand Down
3 changes: 0 additions & 3 deletions src/Sentry.AspNetCore/HttpRequestAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Sentry.Extensibility;

Expand Down
2 changes: 0 additions & 2 deletions src/Sentry.AspNetCore/SamplingExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;

namespace Sentry.AspNetCore;

/// <summary>
Expand Down
3 changes: 0 additions & 3 deletions src/Sentry.AspNetCore/ScopeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
Expand Down
Loading

0 comments on commit 2639611

Please sign in to comment.