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

Commit c80d56b

Browse files
authored
Merge pull request #2135 from github/fixes/trivial-ca-fixes
A bunch of trivial CA warning fixes.
2 parents ae5962f + 249fb72 commit c80d56b

File tree

50 files changed

+81
-107
lines changed

Some content is hidden

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

50 files changed

+81
-107
lines changed

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/GlobalSuppressions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
[assembly: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "Git", Scope = "resource", Target = "GitHub.App.Resources.resources")]
1717
[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)")]
1818
[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("Reliability", "CA2007:Do not directly await a Task", Justification = "Discouraged for VSSDK projects.")]
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/ModelService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ RemoteRepositoryModel Create(RepositoryCacheItem item)
367367
};
368368
}
369369

370-
GitReferenceModel Create(GitReferenceCacheItem item)
370+
static GitReferenceModel Create(GitReferenceCacheItem item)
371371
{
372372
return new GitReferenceModel(item.Ref, item.Label, item.Sha, item.RepositoryCloneUrl);
373373
}

src/GitHub.App/Services/PullRequestEditorService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public int FindMatchingLine(IList<string> fromLines, IList<string> toLines, int
436436
/// <param name="line">The 0-based line we're navigating from.</param>
437437
/// <param name="matchedLines">The number of similar matched lines in <see cref="toLines"/></param>
438438
/// <returns>Find the nearest matching line in <see cref="toLines"/>.</returns>
439-
public int FindNearestMatchingLine(IList<string> fromLines, IList<string> toLines, int line, out int matchedLines)
439+
public static int FindNearestMatchingLine(IList<string> fromLines, IList<string> toLines, int line, out int matchedLines)
440440
{
441441
line = line < fromLines.Count ? line : fromLines.Count - 1; // VS shows one extra line at end
442442
var fromLine = fromLines[line];

src/GitHub.App/ViewModels/CommentThreadViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected IDisposable AddPlaceholder(ICommentViewModel placeholder)
8585
x => x.EditState,
8686
x => x.Body,
8787
(state, body) => (state, body))
88-
.Subscribe(x => PlaceholderChanged(placeholder, x.state, x.body));
88+
.Subscribe(x => PlaceholderChanged(placeholder, x.state));
8989
}
9090

9191
/// <summary>
@@ -120,7 +120,7 @@ protected async Task DeleteDraft(ICommentViewModel comment)
120120

121121
protected abstract (string key, string secondaryKey) GetDraftKeys(ICommentViewModel comment);
122122

123-
void PlaceholderChanged(ICommentViewModel placeholder, CommentEditState state, string body)
123+
void PlaceholderChanged(ICommentViewModel placeholder, CommentEditState state)
124124
{
125125
if (state == CommentEditState.Editing)
126126
{

src/GitHub.App/ViewModels/Dialog/GitHubDialogWindowViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public async Task StartWithConnection<T>(T viewModel)
8181
}
8282
}
8383

84-
public async Task StartWithLogout<T>(T viewModel, IConnection connection)
84+
public Task StartWithLogout<T>(T viewModel, IConnection connection)
8585
where T : IDialogContentViewModel, IConnectionInitializedViewModel
8686
{
8787
var logout = factory.CreateViewModel<ILogOutRequiredViewModel>();
@@ -101,6 +101,7 @@ public async Task StartWithLogout<T>(T viewModel, IConnection connection)
101101
});
102102

103103
Content = logout;
104+
return Task.CompletedTask;
104105
}
105106

106107
async Task<IConnection> ShowLogin()

src/GitHub.App/ViewModels/GitHubPane/PullRequestCheckViewModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace GitHub.ViewModels.GitHubPane
1818
[PartCreationPolicy(CreationPolicy.NonShared)]
1919
public class PullRequestCheckViewModel: ViewModelBase, IPullRequestCheckViewModel
2020
{
21-
const string DefaultAvatar = "pack://application:,,,/GitHub.App;component/Images/default_user_avatar.png";
22-
2321
private readonly IUsageTracker usageTracker;
2422

2523
/// <summary>
-1.29 KB
Binary file not shown.

0 commit comments

Comments
 (0)