Skip to content

Commit ce39dbd

Browse files
authored
Merge pull request #2934 from TheCakeIsNaOH/remove-warnings-1
(maint) Resolve a number of warnings
2 parents b807315 + d99aaa4 commit ce39dbd

File tree

15 files changed

+15
-16
lines changed

15 files changed

+15
-16
lines changed

src/chocolatey.tests/infrastructure.app/commands/ChocolateyPinCommandSpecs.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public void should_set_pin_when_command_is_add()
436436

437437
configuration.PinCommand.Name = "regular";
438438
//packageManager.Setup(pm => pm.LocalRepository).Returns(localRepository.Object);
439-
NuGetVersion nugetVersion = null;
439+
//NuGetVersion nugetVersion = null;
440440
//nuget woes
441441
//localRepository.Setup(r => r.FindPackage(configuration.PinCommand.Name, nugetVersion)).Returns(package.Object);
442442
configuration.PinCommand.Command = PinCommandType.add;

src/chocolatey.tests/infrastructure.app/services/TemplateServiceSpecs.cs

-2
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ public class when_generate_is_called_with_built_in_option_set : TemplateServiceS
670670
{
671671
private Action because;
672672
private readonly ChocolateyConfiguration config = new ChocolateyConfiguration();
673-
private string verifiedDirectoryPath;
674673

675674
public override void Context()
676675
{
@@ -705,7 +704,6 @@ public class when_generate_is_called_with_built_in_option_set_and_defaulttemplat
705704
{
706705
private Action because;
707706
private readonly ChocolateyConfiguration config = new ChocolateyConfiguration();
708-
private string verifiedDirectoryPath;
709707

710708
public override void Context()
711709
{

src/chocolatey/EnumerableExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static class EnumerableExtensions
3131
/// <typeparam name="T"></typeparam>
3232
/// <param name="source">The source.</param>
3333
/// <returns>
34-
/// Source if not null; otherwise Enumerable.Empty&lt;<see cref="T" />&gt;
34+
/// Source if not null; otherwise Enumerable.Empty&lt;<see cref="or_empty_list_if_null{T}" />&gt;
3535
/// </returns>
3636
public static IEnumerable<T> or_empty_list_if_null<T>(this IEnumerable<T> source)
3737
{

src/chocolatey/LogExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void ResetLoggers()
5252
}
5353

5454
/// <summary>
55-
/// Gets the logger for <see cref="T" />.
55+
/// Gets the logger for <see cref="Log{T}" />.
5656
/// </summary>
5757
/// <typeparam name="T"></typeparam>
5858
/// <param name="type">The type to get the logger for.</param>

src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public static void parse_arguments_and_update_configuration(ICollection<string>
135135
/// Shows the help menu and prints the options
136136
/// </summary>
137137
/// <param name="optionSet">The option_set.</param>
138+
/// <param name="helpMessage">The action that displays the message</param>
138139
private static void show_help(OptionSet optionSet, Action helpMessage)
139140
{
140141
if (helpMessage != null)

src/chocolatey/infrastructure.app/nuget/ChocolateyNuGetSettings.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ChocolateyNuGetSettings : ISettings
1414
{
1515
//private ClientPolicyContext
1616
private const string CONFIG_SECTION_NAME = "config";
17-
private SettingSection _configSettingSection;
17+
//private SettingSection _configSettingSection;
1818

1919
public ChocolateyNuGetSettings(ChocolateyConfiguration config)
2020
{
@@ -40,7 +40,7 @@ public SettingSection GetSection(string sectionName)
4040
case CONFIG_SECTION_NAME:
4141
//TODO fix
4242
return null;
43-
break;
43+
//break;
4444
default:
4545
return null;
4646
}

src/chocolatey/infrastructure.app/nuget/NugetCommon.cs

+3
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ public static void SetHttpHandlerCredentialService(ChocolateyConfiguration confi
348348
() => GetCredentialProvidersAsync(configuration)), false, true));
349349
}
350350

351+
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously.
352+
// We don't care about this method being synchronous because this is just used to pass in the credential provider to Lazy<ICredentialService>
351353
private static async Task<IEnumerable<ICredentialProvider>> GetCredentialProvidersAsync(ChocolateyConfiguration configuration)
354+
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
352355
{
353356
return new List<ICredentialProvider>() { new ChocolateyNugetCredentialProvider(configuration) };
354357
}

src/chocolatey/infrastructure.app/services/IPendingRebootService.cs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ namespace chocolatey.infrastructure.app.services
2222
/// Test to see if there are any known situations that require
2323
/// a System reboot.
2424
/// </summary>
25-
/// <param name="config">The current Chocolatey Configuration</param>
2625
/// <returns><c>true</c> if reboot is required; otherwise <c>false</c>.</returns>
2726
public interface IPendingRebootService
2827
{

src/chocolatey/infrastructure.app/services/NugetService.cs

-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace chocolatey.infrastructure.app.services
3939
using DateTime = adapters.DateTime;
4040
using Environment = System.Environment;
4141
using IFileSystem = filesystem.IFileSystem;
42-
using chocolatey.infrastructure.app.utility;
4342
using NuGet.Common;
4443
using NuGet.Configuration;
4544
using NuGet.PackageManagement;
@@ -75,7 +74,6 @@ private IDateTime DateTime
7574
/// <param name="nugetLogger">The nuget logger</param>
7675
/// <param name="packageInfoService">Package information service</param>
7776
/// <param name="filesService">The files service</param>
78-
/// <param name="packageDownloader">The downloader used to download packages</param>
7977
public NugetService(IFileSystem fileSystem, ILogger nugetLogger, IChocolateyPackageInformationService packageInfoService, IFilesService filesService)
8078
{
8179
_fileSystem = fileSystem;

src/chocolatey/infrastructure.app/services/WindowsFeatureService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace chocolatey.infrastructure.app.services
3333
/// Alternative Source for Enabling Windows Features
3434
/// </summary>
3535
/// <remarks>
36-
/// https://technet.microsoft.com/en-us/library/hh825265.aspx?f=255&MSPPError=-2147217396
36+
/// <![CDATA[https://technet.microsoft.com/en-us/library/hh825265.aspx?f=255&MSPPError=-2147217396]]>
3737
/// Win 7 - https://technet.microsoft.com/en-us/library/dd744311.aspx
3838
/// Maybe Win2003/2008 - http://www.wincert.net/forum/files/file/8-deployment-image-servicing-and-management-dism/ | http://wincert.net/leli55PK/DISM/
3939
/// </remarks>

src/chocolatey/infrastructure/adapters/IEnvironment.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ public interface IEnvironment
132132
/// An <see cref="T:System.Collections.IDictionary"/> object that contains all environment variable names and their values from the source specified by the <paramref name="target"/> parameter; otherwise, an empty dictionary if no environment variables are found.
133133
///
134134
/// </returns>
135-
/// <param name="target">One of the <see cref="T:System.EnvironmentVariableTarget"/> values.
136-
/// </param><exception cref="T:System.Security.SecurityException">The caller does not have the required permission to perform this operation for the specified value of <paramref name="target"/>.
135+
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission to perform this operation for the specified value of <paramref name="target"/>.
137136
/// </exception><exception cref="T:System.NotSupportedException">This method cannot be used on Windows 95 or Windows 98 platforms.
138137
/// </exception><exception cref="T:System.ArgumentException"><paramref name="target"/> contains an illegal value.
139138
/// </exception><filterpriority>1</filterpriority><PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode"/></PermissionSet>

src/chocolatey/infrastructure/adapters/IProcess.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface IProcess : IDisposable
2727
event EventHandler<DataReceivedEventArgs> ErrorDataReceived;
2828

2929
/// <summary>
30-
/// Gets or sets the properties to pass into the <see cref='System.Diagnostics.Process.Start' /> method for the
30+
/// Gets or sets the properties to pass into the <see cref='System.Diagnostics.Process.Start()' /> method for the
3131
/// <see
3232
/// cref='System.Diagnostics.Process' />
3333
/// .

src/chocolatey/infrastructure/registration/AssemblyResolution.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public static System.Reflection.Assembly resolve_extension_or_merged_assembly(ob
351351
return resolvedAssembly.UnderlyingType;
352352
}
353353
}
354-
catch (Exception ex)
354+
catch (Exception)
355355
{
356356
// This catch statement is empty on purpose, we do
357357
// not want to do anything if it fails to load.

src/chocolatey/infrastructure/registration/SimpleInjectorContainer.cs

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ private static Container initialize()
9595
/// </summary>
9696
/// <param name="componentRegistry">The component registry.</param>
9797
/// <param name="container">The container.</param>
98+
/// <param name="extensions">Any extension libraries</param>
9899
private static void load_component_registry(Type componentRegistry, Container container, IEnumerable<ExtensionInformation> extensions)
99100
{
100101
if (componentRegistry == null)

src/chocolatey/infrastructure/results/IResult.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace chocolatey.infrastructure.results
2424
public interface IResult
2525
{
2626
/// <summary>
27-
/// Gets a value indicating whether this <see cref="IResults" /> is successful.
27+
/// Gets a value indicating whether this <see cref="IResult" /> is successful.
2828
/// </summary>
2929
/// <value>
3030
/// <c>true</c> if success; otherwise, <c>false</c>.

0 commit comments

Comments
 (0)