Browse Source

More stylecode fixes

pull/107/head
Sebastian Stehle 8 years ago
parent
commit
e223ee0135
  1. 32
      Squidex.ruleset
  2. 1
      src/Squidex.Domain.Apps.Core/Schemas/DateTimeField.cs
  3. 27
      stylecop.json
  4. 0
      tests/Squidex.Domain.Apps.Write.Tests/Apps/AppCommandMiddlewareTests.cs
  5. 0
      tests/Squidex.Domain.Apps.Write.Tests/Assets/AssetCommandMiddlewareTests.cs
  6. 0
      tests/Squidex.Domain.Apps.Write.Tests/Contents/ContentCommandMiddlewareTests.cs
  7. 0
      tests/Squidex.Domain.Apps.Write.Tests/Schemas/SchemaCommandMiddlewareTests.cs
  8. 3
      tests/Squidex.Domain.Apps.Write.Tests/Squidex.Domain.Apps.Write.Tests.csproj
  9. 2
      tests/Squidex.Domain.Apps.Write.Tests/Webhooks/WebhookCommandMiddlewareTests.cs
  10. 2
      tests/Squidex.Domain.Apps.Write.Tests/Webhooks/WebhookDomainObjectTests.cs
  11. 3
      tests/Squidex.Infrastructure.Tests/UsageTracking/BackgroundUsageTrackerTests.cs

32
Squidex.ruleset

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Squidex Rules" Description="Squidex Rules" ToolsVersion="14.0"> <RuleSet Name="Squidex Rules" Description="Squidex Rules" ToolsVersion="14.0">
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.SpacingRules"> <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1002" Action="Error" /> <Rule Id="SA1002" Action="Error" />
<Rule Id="SA1003" Action="Error" /> <Rule Id="SA1003" Action="Error" />
<Rule Id="SA1008" Action="None" /> <Rule Id="SA1008" Action="None" />
@ -10,9 +10,13 @@
<Rule Id="SA1025" Action="Error" /> <Rule Id="SA1025" Action="Error" />
<Rule Id="SA1026" Action="Error" /> <Rule Id="SA1026" Action="Error" />
<Rule Id="SA1028" Action="Error" /> <Rule Id="SA1028" Action="Error" />
</Rules> <Rule Id="SA1000" Action="Error" />
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.ReadabilityRules"> <Rule Id="SA1001" Action="Error" />
<Rule Id="SA1101" Action="None" /> <Rule Id="SA1101" Action="None" />
<Rule Id="SA1004" Action="Error" />
<Rule Id="SA1107" Action="None" />
<Rule Id="SA1010" Action="Error" />
<Rule Id="SA1111" Action="None" />
<Rule Id="SA1116" Action="None" /> <Rule Id="SA1116" Action="None" />
<Rule Id="SA1117" Action="None" /> <Rule Id="SA1117" Action="None" />
<Rule Id="SA1118" Action="None" /> <Rule Id="SA1118" Action="None" />
@ -21,8 +25,6 @@
<Rule Id="SA1127" Action="None" /> <Rule Id="SA1127" Action="None" />
<Rule Id="SA1128" Action="Error" /> <Rule Id="SA1128" Action="Error" />
<Rule Id="SA1129" Action="Error" /> <Rule Id="SA1129" Action="Error" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.OrderingRules">
<Rule Id="SA1200" Action="None" /> <Rule Id="SA1200" Action="None" />
<Rule Id="SA1201" Action="None" /> <Rule Id="SA1201" Action="None" />
<Rule Id="SA1202" Action="None" /> <Rule Id="SA1202" Action="None" />
@ -31,19 +33,13 @@
<Rule Id="SA1208" Action="Error" /> <Rule Id="SA1208" Action="Error" />
<Rule Id="SA1210" Action="Error" /> <Rule Id="SA1210" Action="Error" />
<Rule Id="SA1214" Action="Error" /> <Rule Id="SA1214" Action="Error" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.NamingRules">
<Rule Id="SA1306" Action="Error" /> <Rule Id="SA1306" Action="Error" />
<Rule Id="SA1311" Action="Error" /> <Rule Id="SA1311" Action="Error" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.MaintainabilityRules">
<Rule Id="SA1400" Action="Error" /> <Rule Id="SA1400" Action="Error" />
<Rule Id="SA1401" Action="Error" /> <Rule Id="SA1401" Action="Error" />
<Rule Id="SA1402" Action="None" /> <Rule Id="SA1402" Action="None" />
<Rule Id="SA1407" Action="Error" /> <Rule Id="SA1407" Action="Error" />
<Rule Id="SA1408" Action="None" /> <Rule Id="SA1408" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.LayoutRules">
<Rule Id="SA1502" Action="Error" /> <Rule Id="SA1502" Action="Error" />
<Rule Id="SA1504" Action="Error" /> <Rule Id="SA1504" Action="Error" />
<Rule Id="SA1505" Action="Error" /> <Rule Id="SA1505" Action="Error" />
@ -54,14 +50,20 @@
<Rule Id="SA1513" Action="Error" /> <Rule Id="SA1513" Action="Error" />
<Rule Id="SA1515" Action="None" /> <Rule Id="SA1515" Action="None" />
<Rule Id="SA1516" Action="None" /> <Rule Id="SA1516" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.DocumentationRules">
<Rule Id="SA1600" Action="None" /> <Rule Id="SA1600" Action="None" />
<Rule Id="SA1612" Action="None" /> <Rule Id="SA1612" Action="None" />
<Rule Id="SA1615" Action="None" /> <Rule Id="SA1615" Action="None" />
<Rule Id="SA1623" Action="None" /> <Rule Id="SA1623" Action="None" />
<Rule Id="SA1633" Action="None" /> <Rule Id="SA1633" Action="Error" />
<Rule Id="SA1649" Action="Error" /> <Rule Id="SA1649" Action="Error" />
<Rule Id="SA1652" Action="None" /> <Rule Id="SA1652" Action="None" />
<Rule Id="SA1634" Action="Error" />
<Rule Id="SA1635" Action="Error" />
<Rule Id="SA1636" Action="Error" />
<Rule Id="SA1637" Action="Error" />
<Rule Id="SA1638" Action="Error" />
<Rule Id="SA1639" Action="None" />
<Rule Id="SA1640" Action="Error" />
<Rule Id="SA1641" Action="Error" />
</Rules> </Rules>
</RuleSet> </RuleSet>

1
src/Squidex.Domain.Apps.Core/Schemas/DateTimeField.cs

@ -22,7 +22,6 @@ using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Core.Schemas namespace Squidex.Domain.Apps.Core.Schemas
{ {
[TypeName("DateTimeField")]
public sealed class DateTimeField : Field<DateTimeFieldProperties> public sealed class DateTimeField : Field<DateTimeFieldProperties>
{ {
public DateTimeField(long id, string name, Partitioning partitioning) public DateTimeField(long id, string name, Partitioning partitioning)

27
stylecop.json

@ -0,0 +1,27 @@
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"orderingRules": {
"elementOrder": [
"kind",
"constant",
"static",
"readonly"
],
"usingDirectivesPlacement": "outsideNamespace"
},
"layoutRules": {
"newlineAtEndOfFile": "omit"
},
"documentationRules": {
"companyName": "Squidex UG (haftungsbeschränkt)",
"copyrightText": "Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} license.",
"variables": {
"licenseName": "MIT",
"licenseFile": "LICENSE"
},
"headerDecoration": "==========================================================================",
"fileNamingConvention": "stylecop"
}
}
}

0
tests/Squidex.Domain.Apps.Write.Tests/Apps/AppCommandHandlerTests.cs → tests/Squidex.Domain.Apps.Write.Tests/Apps/AppCommandMiddlewareTests.cs

0
tests/Squidex.Domain.Apps.Write.Tests/Assets/AssetCommandHandlerTests.cs → tests/Squidex.Domain.Apps.Write.Tests/Assets/AssetCommandMiddlewareTests.cs

0
tests/Squidex.Domain.Apps.Write.Tests/Contents/ContentCommandHandlerTests.cs → tests/Squidex.Domain.Apps.Write.Tests/Contents/ContentCommandMiddlewareTests.cs

0
tests/Squidex.Domain.Apps.Write.Tests/Schemas/SchemaCommandHandlerTests.cs → tests/Squidex.Domain.Apps.Write.Tests/Schemas/SchemaCommandMiddlewareTests.cs

3
tests/Squidex.Domain.Apps.Write.Tests/Squidex.Domain.Apps.Write.Tests.csproj

@ -24,4 +24,7 @@
<ItemGroup> <ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup> </ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\Squidex.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
</Project> </Project>

2
tests/Squidex.Domain.Apps.Write.Tests/Webhooks/WebhookCommandMiddlewareTests.cs

@ -13,8 +13,8 @@ using FakeItEasy;
using Squidex.Domain.Apps.Core.Webhooks; using Squidex.Domain.Apps.Core.Webhooks;
using Squidex.Domain.Apps.Read.Schemas; using Squidex.Domain.Apps.Read.Schemas;
using Squidex.Domain.Apps.Read.Schemas.Services; using Squidex.Domain.Apps.Read.Schemas.Services;
using Squidex.Domain.Apps.Write.Webhooks.Commands;
using Squidex.Domain.Apps.Write.TestHelpers; using Squidex.Domain.Apps.Write.TestHelpers;
using Squidex.Domain.Apps.Write.Webhooks.Commands;
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Squidex.Infrastructure.CQRS.Commands; using Squidex.Infrastructure.CQRS.Commands;
using Xunit; using Xunit;

2
tests/Squidex.Domain.Apps.Write.Tests/Webhooks/WebhookDomainObjectTests.cs

@ -8,8 +8,8 @@
using System; using System;
using Squidex.Domain.Apps.Events.Webhooks; using Squidex.Domain.Apps.Events.Webhooks;
using Squidex.Domain.Apps.Write.Webhooks.Commands;
using Squidex.Domain.Apps.Write.TestHelpers; using Squidex.Domain.Apps.Write.TestHelpers;
using Squidex.Domain.Apps.Write.Webhooks.Commands;
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Squidex.Infrastructure.CQRS; using Squidex.Infrastructure.CQRS;
using Xunit; using Xunit;

3
tests/Squidex.Infrastructure.Tests/UsageTracking/BackgroundUsageTrackerTests.cs

@ -76,7 +76,8 @@ namespace Squidex.Infrastructure.UsageTracking
[Fact] [Fact]
public async Task Should_fill_missing_days() public async Task Should_fill_missing_days()
{ {
DateTime dateFrom = DateTime.Today, dateTo = DateTime.Today.AddDays(7); var dateFrom = DateTime.Today;
var dateTo = DateTime.Today.AddDays(7);
IReadOnlyList<StoredUsage> originalData = new List<StoredUsage> IReadOnlyList<StoredUsage> originalData = new List<StoredUsage>
{ {

Loading…
Cancel
Save