Closed ghost closed 4 years ago
Good idea! Is there something out there that does not require CR or R#? I'm fine with the naming conventions. Would also be nice to include that in the linter somehow.
The big plus with including the dotSettings files (i'm assuming it is the same with the CR format) it that it layers automatically on the other settings. So anyone using R# would get Tasty's rules automatically without fiddling in their own settings.
This would also work for the formatting (spacing, brackets, blank lines), syntax (use of var, using) and file layout (order of private fields, ctors, methods) rules. I will propose defaults based on what is currently used in the project.
I'll dig the R# and CR docs and look what alternatives/additions are available.
We should include a .editorconfig https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2019
Here is the official one from Roslyn https://github.com/dotnet/roslyn/blob/master/.editorconfig
@hazard999 Is there a way we can enforce this at build time?
@Paramethod I am fine with this if it's the same.
There is only one thing we should really look into: Never get conflicting rules and have a single source of truth.
Another one I am thinking of is: often tests have different configurations (for example snake case) but cause we are Tasty
we can have the same config for src
and test
👼
Here is a patch file with Microsoft.CodeQuality.Analyzers and an editorconfig
but this generates way to many errors, warnings and messages...
Commands\TastyCommand.cs(21,47): error CA1805: Member 'IsDefault' is explicitly initialized to its default value [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Protocols\SerialiTestCase.cs(32,43): error CA2227: Change 'TestCases' to be read-only by removing the property setter [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Protocols\SerialiTestCase.cs(33,44): error CA2227: Change 'TestGroups' to be read-only by removing the property setter [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\ExecutionContext.cs(24,32): error CA2227: Change 'TestQueue' to be read-only by removing the property setter [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Remote\EnvironmentVariables.cs(6,39): error CA1802: Field 'InteractiveConnectionType' is declared as 'readonly' but is initialized with a constant value. Mark this field as 'const' instead. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Remote\EnvironmentVariables.cs(7,39): error CA1802: Field 'InteractiveConnectionId' is declared as 'readonly' but is initialized with a constant value. Mark this field as 'const' instead. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
ITastyRemote.cs(13,36): error CA1716: Rename virtual/interface member ITastyRemote.Exit so that it no longer conflicts with the reserved language keyword 'Exit'. Using a reserved keyword as the name of a virtual/interface member makes it harder for consumers in other languages to override/implement the member. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Remote\EnvironmentVariables.cs(5,39): error CA1802: Field 'InteractiveMode' is declared as 'readonly' but is initialized with a constant value. Mark this field as 'const' instead. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Plugins\InvalidPluginException.cs(8,18): error CA1032: Add the following constructor to InvalidPluginException: public InvalidPluginException() [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Plugins\InvalidPluginException.cs(8,18): error CA1032: Add the following constructor to InvalidPluginException: public InvalidPluginException(string message) [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Plugins\InvalidPluginException.cs(8,18): error CA1032: Add the following constructor to InvalidPluginException: public InvalidPluginException(string message, Exception innerException) [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(18,47): error CA1805: Member 'LoadPlugins' is explicitly initialized to its default value [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(24,13): error CA1062: In externally visible method 'TestGroup TastyTestCaseExtensions.Describe(TestGroup group, string name, Action action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(40,13): error CA1062: In externally visible method 'TestGroup TastyTestCaseExtensions.Describe(TestGroup group, string name, Func<Task> action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(35,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
ITastyRemote.cs(16,42): error CA1716: In virtual/interface member ITastyRemote.Report(SerializableTestCase), rename parameter case so that it no longer conflicts with the reserved language keyword 'case'. Using a reserved keyword as the name of a parameter on a virtual/interface member makes it harder for consumers in other languages to override/implement the member. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(56,24): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.It(TestGroup group, string name, Action action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(72,24): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.It(TestGroup group, string name, Func<(bool success, string message)> action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(87,24): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.It(TestGroup group, string name, Func<bool> action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(102,24): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.It(TestGroup group, string name, Func<Task> action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(98,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(118,24): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.It(TestGroup group, string name, Func<Task<(bool success, string message)>> action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(114,48): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(129,24): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.It(TestGroup group, string name, Executable action)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(165,13): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.Ignored(TestCase test)', validate parameter 'test' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(171,13): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.Ignored(TestCase test, Func<bool?> predicate)', validate parameter 'test' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(177,13): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.Ignored(TestCase test, bool ignored)', validate parameter 'test' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(183,13): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.Ignored(TestCase test, string reason)', validate parameter 'test' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(190,13): error CA1062: In externally visible method 'TestCase TastyTestCaseExtensions.Forced(TestCase test, Func<bool> predicate)', validate parameter 'test' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(19,39): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(20,39): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(21,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.TestCaseExtensions.cs(196,13): error CA1062: In externally visible method 'TestGroup TastyTestCaseExtensions.Forced(TestGroup group, Func<bool> predicate)', validate parameter 'group' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\StopWatchGroupMiddleware.cs(13,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\TestPipelineCompletedMiddleware.cs(11,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\TestPipelineCompletedMiddleware.cs(17,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Plugins\PluginLoader.cs(14,21): error CA1822: Member 'LoadPlugins' does not access instance data and can be marked as static [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestExecutorExtensions.cs(11,20): error CA1062: In externally visible method 'TestExecutor TestExecutorExtensions.Use(TestExecutor app, Func<TestExecutionContext, Func<Task>, Task> middleware)', validate parameter 'app' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestExecutor.cs(89,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestExecutorExtensions.cs(23,20): error CA1062: In externally visible method 'TestExecutor TestExecutorExtensions.UseGroup(TestExecutor app, Func<TestGroupContext, Func<Task>, Task> middleware)', validate parameter 'app' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\StopWatchMiddleware.cs(15,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestExecutorExtensions.cs(35,20): error CA1062: In externally visible method 'TestExecutor TestExecutorExtensions.UseRuntime(TestExecutor app, Func<RuntimeContext, Func<Task>, Task> middleware)', validate parameter 'app' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ReportTestMiddleware.cs(21,21): error CA1031: Modify 'UseTestReporters' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ReportTestMiddleware.cs(13,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ReportTestMiddleware.cs(19,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\IgnoreTestMiddleware.cs(35,17): error CA1031: Modify 'UseIgnoreTestExecutor' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ClearConsoleMiddleware.cs(24,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\IgnoreTestMiddleware.cs(26,39): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\IgnoreTestMiddleware.cs(32,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\BeforeEachTestMiddleware.cs(13,44): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\BeforeEachTestMiddleware.cs(19,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\AfterEachTestMiddleware.cs(10,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\AfterEachTestMiddleware.cs(19,48): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ForceTestMiddleware.cs(28,17): error CA1031: Modify 'UseForcedTestExecutor' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ForceTestMiddleware.cs(20,35): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ForceTestMiddleware.cs(25,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\RunCommandMiddleware.cs(14,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\RunCommandMiddleware.cs(19,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\CollectTestCaseMiddleware.cs(21,22): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\SelectCommandMiddleware.cs(19,45): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\SelectCommandMiddleware.cs(43,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ExecuteTestMiddleware.cs(20,17): error CA1031: Modify 'UseTestExecutor' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ExecuteTestMiddleware.cs(15,40): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestMiddleware\ExecuteTestMiddleware.cs(25,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ResetRemoteConsoleColorMiddleware.cs(10,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ResetRemoteConsoleColorMiddleware.cs(16,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ResetConsoleColorMiddleware.cs(12,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\CollectTestGroupMiddleware.cs(21,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ConnectToRemoteStreamMiddleware.cs(24,65): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ConnectToRemoteStreamMiddleware.cs(27,66): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ConnectToRemoteStreamMiddleware.cs(28,60): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ConnectToRemoteStreamMiddleware.cs(42,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Remote\NamedPipeRemoteHook.cs(89,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\DetectInteractiveRunMiddleware.cs(10,51): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\DetectInteractiveRunMiddleware.cs(14,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ReportTestMiddleware.cs(15,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ReportTestMiddleware.cs(20,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\CurrentScopeGroupMiddleware.cs(11,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ReportSummaryMiddleware.cs(16,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ReportSummaryMiddleware.cs(21,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ReportSummaryMiddleware.cs(24,35): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Remote\NamedPipeRemoteHook.cs(58,13): error CA1062: In externally visible method 'Task<ITastyRemote> TastyRemoteDefaults.AttachToStream(TastyScope scope, Stream remoteStream)', validate parameter 'scope' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\ExecuteTestGroupMiddleware.cs(24,17): error CA1031: Modify 'UseTestGroupExecutor' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\ExecuteTestGroupMiddleware.cs(13,40): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\ExecuteTestGroupMiddleware.cs(21,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Utils\PromiseHelper.cs(86,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Utils\PromiseHelper.cs(88,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\ReportExitCodeMiddleware.cs(15,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\RemoteStreamDisposalMiddleware.cs(10,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\ForcedTestCasesMiddleware.cs(27,16): error CA1031: Modify 'UseTestGroupForceVisitor' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\ForcedTestCasesMiddleware.cs(25,26): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestGroupMiddleware\ReportTestGroupMiddleware.cs(12,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Utils\FinallyAction.cs(51,13): error CA1031: Modify '.ctor' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Utils\PromiseHelper.cs(28,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Utils\PromiseHelper.cs(30,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Utils\FinallyAction.cs(112,13): error CA1031: Modify '.ctor' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\EndTestPipelineMiddleware.cs(13,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\EndTestPipelineMiddleware.cs(23,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\RegisterCommandsMiddleware.cs(23,31): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Execution\TestRuntime\RegisterCommandsMiddleware.cs(28,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(42,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(81,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(63,25): error CA1031: Modify 'VisitForcedTestCases' to catch a more specific allowed exception type, or rethrow the exception [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(89,19): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(53,35): error CA1062: In externally visible method 'TastyScope TastyScope.RegisterCommand(Func<(string name, Func<RuntimeContext, Task> command)> commandRegistration)', validate parameter 'commandRegistration' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(59,48): error CA1062: In externally visible method 'TastyScope TastyScope.RegisterCommand(Func<(string name, Func<RuntimeContext, Task> command, string? description)> commandRegistration)', validate parameter 'commandRegistration' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(65,59): error CA1062: In externally visible method 'TastyScope TastyScope.RegisterCommand(Func<(string name, Func<RuntimeContext, Task> command, string? description, bool? isDefault)> commandRegistration)', validate parameter 'commandRegistration' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(88,70): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(112,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Commands\ExecuteTestsCommand.cs(32,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(187,27): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(203,48): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(256,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(313,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(316,26): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(278,23): error CA2007: Consider calling ConfigureAwait on the awaited task [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
Tasty.Scope.cs(308,45): error CA1801: Parameter args of method Run is never used. Remove the parameter or use it in the method body. [D:\Work\Tasty\src\Xenial.Tasty.Core\Xenial.Tasty.Core.csproj]
@hazard999 I have no problem with the configure await calls (we should do that anyway). But does that catch a private int _MyVar
??
Hmmm looks not to bad to me, we should give it a try with the .editorconfig
@Paramethod EditorConfig works from commandline with dotnet format, we also can lint and it works without R# and CR. We just need a rule set that matches your suggestion https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2019
@Paramethod have a look at #85. Should be working out fine i guess.
Most of the naming rules have no violation (except instance and static fields), but I think it would be good that we all agree on what we should use. Here are the ones I use in my project as a starting point:
As for the how we enforce them. Perhaps we could include the dotsettings (Resharper) and the CodeRush settings equivalent so it offers options for contributors. Thoughts?