Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 1ce82b3

Browse files
Merge branch 'master' into update-graphql-submodule
2 parents 4816bd9 + c80d56b commit 1ce82b3

File tree

88 files changed

+235
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+235
-135
lines changed

src/CredentialManagement/NativeMethods.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
using System.Text;
55
using Microsoft.Win32.SafeHandles;
66

7+
#pragma warning disable CA1034 // Nested types should not be visible
8+
#pragma warning disable CA1051 // Do not declare visible instance fields
9+
#pragma warning disable CA1707 // Identifiers should not contain underscores
10+
711
namespace GitHub.Authentication.CredentialManagement
812
{
913
public static class NativeMethods
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("Reliability", "CA2007:Do not directly await a Task", Justification = "Discouraged for VSSDK projects.")]
9+

src/GitHub.Api/LoginManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ async Task<ApplicationAuthorization> HandleTwoFactorAuthorization(
289289
}
290290
}
291291

292-
ApplicationAuthorization EnsureNonNullAuthorization(ApplicationAuthorization auth)
292+
static ApplicationAuthorization EnsureNonNullAuthorization(ApplicationAuthorization auth)
293293
{
294294
// If a mock IGitHubClient is not set up correctly, it can return null from
295295
// IGutHubClient.Authorization.Create - this will cause an infinite loop in Login()

src/GitHub.App/Api/ApiClient.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace GitHub.Api
1818
{
1919
public partial class ApiClient : IApiClient
2020
{
21-
const string ScopesHeader = "X-OAuth-Scopes";
2221
const string ProductName = Info.ApplicationInfo.ApplicationDescription;
2322
static readonly ILogger log = LogManager.ForContext<ApiClient>();
2423

src/GitHub.App/Collections/VirtualizingList.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
using GitHub.Logging;
1313
using Serilog;
1414

15+
#pragma warning disable CA1010 // Collections should implement generic interface
16+
#pragma warning disable CA1033 // Interface methods should be callable by child types
17+
#pragma warning disable CA1710 // Identifiers should have correct suffix
18+
1519
namespace GitHub.Collections
1620
{
1721
/// <summary>

src/GitHub.App/Collections/VirtualizingListCollectionView.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
using System.Collections.Specialized;
55
using System.Windows.Data;
66

7+
#pragma warning disable CA1010 // Collections should implement generic interface
8+
#pragma warning disable CA1033 // Interface methods should be callable by child types
9+
#pragma warning disable CA1710 // Identifiers should have correct suffix
10+
711
namespace GitHub.Collections
812
{
913
/// <summary>
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
using System.Diagnostics.CodeAnalysis;
2-
3-
[assembly: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "GitHub.ViewModels.CreateRepoViewModel.#ResetState()")]
4-
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.Resources.resources")]
5-
[assembly: SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "GitHub.Caches.CredentialCache.#InsertObject`1(System.String,!!0,System.Nullable`1<System.DateTimeOffset>)")]
6-
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.App.Resources.resources")]
7-
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String)")]
8-
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String,System.Text.Encoding)")]
9-
101
// This file is used by Code Analysis to maintain SuppressMessage
112
// attributes that are applied to this project.
123
// Project-level suppressions either have no target or are given
@@ -16,3 +7,15 @@
167
// Code Analysis results, point to "Suppress Message", and click
178
// "In Suppression File".
189
// You do not need to add suppressions to this file manually.
10+
11+
using System.Diagnostics.CodeAnalysis;
12+
13+
[assembly: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "GitHub.ViewModels.CreateRepoViewModel.#ResetState()")]
14+
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.Resources.resources")]
15+
[assembly: SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "GitHub.Caches.CredentialCache.#InsertObject`1(System.String,!!0,System.Nullable`1<System.DateTimeOffset>)")]
16+
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.App.Resources.resources")]
17+
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String)")]
18+
[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)", Scope = "member", Target = "GitHub.Services.PullRequestService.#CreateTempFile(System.String,System.String,System.String,System.Text.Encoding)")]
19+
[assembly: SuppressMessage("Design", "CA1056:Uri properties should not be strings")]
20+
[assembly: SuppressMessage("Design", "CA1054:Uri parameters should not be strings")]
21+
[assembly: SuppressMessage("Reliability", "CA2007:Do not directly await a Task", Justification = "Discouraged for VSSDK projects.")]

src/GitHub.App/Services/EnterpriseCapabilitiesService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task<EnterpriseLoginMethods> ProbeLoginMethods(Uri enterpriseBaseUr
5555
}
5656
}
5757

58-
private async Task<EnterpriseMeta> GetMetadata(IConnection connection)
58+
private static async Task<EnterpriseMeta> GetMetadata(IConnection connection)
5959
{
6060
var endpoint = new Uri("meta", UriKind.Relative);
6161
var response = await connection.Get<EnterpriseMeta>(endpoint, null, null).ConfigureAwait(false);

src/GitHub.App/Services/ErrorMessageTranslator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using ReactiveUI.Legacy;
88

99
#pragma warning disable CS0618 // Type or member is obsolete
10+
#pragma warning disable CA1034 // Nested types should not be visible
1011

1112
namespace GitHub.Services
1213
{

src/GitHub.App/Services/ModelService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
using Serilog;
2323
using static Octokit.GraphQL.Variable;
2424

25+
#pragma warning disable CA1034 // Nested types should not be visible
26+
2527
namespace GitHub.Services
2628
{
2729
[Export(typeof(IModelService))]
@@ -365,7 +367,7 @@ RemoteRepositoryModel Create(RepositoryCacheItem item)
365367
};
366368
}
367369

368-
GitReferenceModel Create(GitReferenceCacheItem item)
370+
static GitReferenceModel Create(GitReferenceCacheItem item)
369371
{
370372
return new GitReferenceModel(item.Ref, item.Label, item.Sha, item.RepositoryCloneUrl);
371373
}

0 commit comments

Comments
 (0)