From 3537c516fb9217e4b8e4537a0e9f907d83b603e7 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 24 Jan 2020 04:40:23 +1000 Subject: [PATCH] Configure StyleCop (not running) and revert using-inside-namespace --- .stylecop.json | 16 + .../BizHawk.Client.DiscoHawk.csproj | 1 + .../BizHawk.Client.EmuHawk.csproj | 1 + BizHawk.Common/Ranges.cs | 12 +- BizHawk.Common/SimpleTime.cs | 8 +- BizHawk.Common/Util.cs | 16 +- Common.abs.props | 5 + Common.ruleset | 361 ++++++++++++++++++ CommonStyleCopAnalyzer.abs.props | 9 + 9 files changed, 411 insertions(+), 18 deletions(-) create mode 100644 .stylecop.json create mode 100644 Common.ruleset create mode 100644 CommonStyleCopAnalyzer.abs.props diff --git a/.stylecop.json b/.stylecop.json new file mode 100644 index 0000000000..f0f8c54f48 --- /dev/null +++ b/.stylecop.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/1.2.0-beta.113/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "documentationRules": { + "documentExposedElements": false, + "documentInterfaces": false, + "documentInternalElements": false + }, + "indentation": { + "useTabs": true + }, + "orderingRules": { + "usingDirectivesPlacement": "outsideNamespace" + } + } +} diff --git a/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj b/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj index c0f76ea17b..266fbc1fa8 100644 --- a/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj +++ b/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj @@ -71,6 +71,7 @@ true + diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index e867f48a54..143e2439aa 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -89,6 +89,7 @@ true + diff --git a/BizHawk.Common/Ranges.cs b/BizHawk.Common/Ranges.cs index 30523d85b8..2d7b3aa2e5 100644 --- a/BizHawk.Common/Ranges.cs +++ b/BizHawk.Common/Ranges.cs @@ -1,11 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +using BizHawk.Common.NumberExtensions; + namespace BizHawk.Common { - using System; - using System.Collections.Generic; - using System.Linq; - - using BizHawk.Common.NumberExtensions; - /// semantically similar to , but obviously does no checks at runtime public struct RangeStruct where T : unmanaged, IComparable { diff --git a/BizHawk.Common/SimpleTime.cs b/BizHawk.Common/SimpleTime.cs index 745f7d617d..7413217483 100644 --- a/BizHawk.Common/SimpleTime.cs +++ b/BizHawk.Common/SimpleTime.cs @@ -1,8 +1,8 @@ -namespace BizHawk.Common -{ - using System; - using System.Diagnostics; +using System; +using System.Diagnostics; +namespace BizHawk.Common +{ /// Create a new instance of this class in a block, and it will measure the time elapsed until the block finishes executing. Provide a label to print to stdout or provide a callback for custom behaviour. public class SimpleTime : IDisposable { diff --git a/BizHawk.Common/Util.cs b/BizHawk.Common/Util.cs index e1c26c1a21..fa648dcf96 100644 --- a/BizHawk.Common/Util.cs +++ b/BizHawk.Common/Util.cs @@ -1,12 +1,12 @@ -namespace BizHawk.Common -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.IO.Compression; - using System.Linq; - using System.Threading; +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Threading; +namespace BizHawk.Common +{ public static unsafe class Util { public static void CopyStream(Stream src, Stream dest, long len) diff --git a/Common.abs.props b/Common.abs.props index afb2f94974..442bf5c154 100644 --- a/Common.abs.props +++ b/Common.abs.props @@ -1,5 +1,6 @@ + $(SolutionDir)Common.ruleset prompt false 8.0 @@ -17,4 +18,8 @@ TRACE true + + + + diff --git a/Common.ruleset b/Common.ruleset new file mode 100644 index 0000000000..a274081952 --- /dev/null +++ b/Common.ruleset @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CommonStyleCopAnalyzer.abs.props b/CommonStyleCopAnalyzer.abs.props new file mode 100644 index 0000000000..fe16bbe0dc --- /dev/null +++ b/CommonStyleCopAnalyzer.abs.props @@ -0,0 +1,9 @@ + + + $(SolutionDir)Common.ruleset + + + + + +