smaller stylecop fixes in Wox.Core and Wox.Infra (#5671)

* Headers
unneeded usings
files need blank line at bottom
Fixed double returns
Returns after braces

* commenting out stylecop
This commit is contained in:
Clint Rutkas
2020-08-05 14:06:42 -07:00
committed by GitHub
parent 30b65028fe
commit 92a2b83bc8
50 changed files with 308 additions and 116 deletions

View File

@@ -1,4 +1,7 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using Wox.Plugin;
@@ -53,4 +56,4 @@ namespace Wox.Core.Plugin
return Execute(_startInfo);
}
}
}
}

View File

@@ -66,7 +66,6 @@ namespace Wox.Core.Plugin
}
return rpc;
}
private string GetParameterByType(object parameter)

View File

@@ -1,13 +1,13 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.Logger;
using Wox.Plugin;
@@ -205,4 +205,4 @@ namespace Wox.Core.Plugin
context = ctx;
}
}
}
}

View File

@@ -1,10 +1,12 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.Logger;
using Wox.Plugin;
@@ -81,7 +83,6 @@ namespace Wox.Core.Plugin
return null;
}
if (!AllowedLanguage.IsAllowed(metadata.Language))
{
Log.Error($"|PluginConfig.GetPluginMetadata|Invalid language <{metadata.Language}> for config <{configPath}>");
@@ -97,4 +98,4 @@ namespace Wox.Core.Plugin
return metadata;
}
}
}
}

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.Windows;
using ICSharpCode.SharpZipLib.Zip;
@@ -118,7 +122,6 @@ namespace Wox.Core.Plugin
return null;
}
if (!AllowedLanguage.IsAllowed(metadata.Language))
{
string error = $"Parse plugin config {configPath} failed: invalid language {metadata.Language}";

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
@@ -221,7 +225,6 @@ namespace Wox.Core.Plugin
{
return new List<ContextMenuResult>();
}
}
public static bool ActionKeywordRegistered(string actionKeyword)
@@ -275,7 +278,6 @@ namespace Wox.Core.Plugin
if (oldActionkeyword != Query.GlobalPluginWildcardSign)
NonGlobalPlugins.Remove(oldActionkeyword);
plugin.Metadata.ActionKeywords.Remove(oldActionkeyword);
}

View File

@@ -1,11 +1,13 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Loader;
using Wox.Infrastructure;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.Logger;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
@@ -80,7 +82,6 @@ namespace Wox.Core.Plugin
plugins.Add(pair);
});
metadata.InitTime += milliseconds;
}
return plugins;
}
@@ -96,6 +97,5 @@ namespace Wox.Core.Plugin
});
return plugins;
}
}
}
}

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using Wox.Plugin;
@@ -47,4 +51,4 @@ namespace Wox.Core.Plugin
return query;
}
}
}
}

View File

@@ -1,3 +1,7 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
namespace Wox.Core.Resource

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Linq;
using System.Windows;
using System.Windows.Media;
@@ -69,6 +73,5 @@ namespace Wox.Core.Resource
return family.FamilyTypefaces.FirstOrDefault(o => o.Style == styleObj && o.Weight == weightObj && o.Stretch == stretchObj)
?? family.ChooseRegularFamilyTypeface();
}
}
}

View File

@@ -1,4 +1,8 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -30,14 +34,12 @@ namespace Wox.Core.Resource
AddWoxLanguageDirectory();
}
private void AddWoxLanguageDirectory()
{
var directory = Path.Combine(Constant.ProgramDirectory, Folder);
_languageDirectories.Add(directory);
}
private void AddPluginLanguageDirectories()
{
foreach (var plugin in PluginManager.GetPluginsForInterface<IPluginI18n>())
@@ -96,7 +98,6 @@ namespace Wox.Core.Resource
LoadLanguage(language);
}
UpdatePluginMetadataTranslations();
}
public bool PromptShouldUsePinyin(string languageCodeToSet)
@@ -214,4 +215,4 @@ namespace Wox.Core.Resource
}
}
}
}
}

View File

@@ -1,4 +1,8 @@
namespace Wox.Core.Resource
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Wox.Core.Resource
{
public static class InternationalizationManager
{
@@ -23,4 +27,4 @@
}
}
}
}
}

View File

@@ -1,4 +1,8 @@
namespace Wox.Core.Resource
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Wox.Core.Resource
{
public class Language
{

View File

@@ -67,5 +67,19 @@
<ProjectReference Include="..\Wox.Infrastructure\Wox.Infrastructure.csproj" />
<ProjectReference Include="..\Wox.Plugin\Wox.Plugin.csproj" />
</ItemGroup>
<!-- <ItemGroup>
<Compile Include="..\..\..\codeAnalysis\GlobalSuppressions.cs">
<Link>GlobalSuppressions.cs</Link>
</Compile>
<AdditionalFiles Include="..\..\..\codeAnalysis\StyleCop.json">
<Link>StyleCop.json</Link>
</AdditionalFiles>
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers">
<Version>1.1.118</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>-->
</Project>