Skip to content

Commit

Permalink
Apply the new editorconfig formatting stuff to all the netstandard fi…
Browse files Browse the repository at this point in the history
…les:

- This doesn't apply all conventions, since some are just suggestions, and some only apply to new code.
- Lots of BOMs are gone...we'll see if that was a good idea.
- Some of these settings might not be the best, or need tweaking, but at least things will get to be more standardized moving forward.
  • Loading branch information
masojus committed Nov 11, 2017
1 parent 410e679 commit fdefe32
Show file tree
Hide file tree
Showing 73 changed files with 398 additions and 367 deletions.
32 changes: 26 additions & 6 deletions .editorconfig
Expand Up @@ -82,7 +82,6 @@ csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

## Braces

csharp_prefer_braces = true

## Newline settings
Expand All @@ -102,7 +101,6 @@ csharp_indent_switch_labels = true
csharp_indent_labels = flush_left

## Spacing

csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
Expand All @@ -126,18 +124,25 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false


# name all constant fields using PascalCase

dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const

dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# name all readonly fields using PascalCase
dotnet_naming_rule.readonly_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.readonly_fields_should_be_pascal_case.symbols = readonly_fields
dotnet_naming_rule.readonly_fields_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.readonly_fields.applicable_kinds = field
dotnet_naming_symbols.readonly_fields.required_modifiers = readonly


# internal and private fields should be _camelCase
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
Expand All @@ -148,3 +153,18 @@ dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = priva

dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case

# async methods end in Async
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion

dotnet_naming_symbols.any_async_methods.applicable_kinds = method
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
dotnet_naming_symbols.any_async_methods.required_modifiers = async

### NOTE : unfortunately just looking for the 'async' modifier won't catch all methods that
### return an awaitable.

dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case
6 changes: 3 additions & 3 deletions Keen.NetStandard.Test/AddOnsTest.cs
@@ -1,7 +1,7 @@
using Keen.Core.DataEnrichment;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using Keen.Core.DataEnrichment;
using NUnit.Framework;


namespace Keen.Core.Test
Expand Down Expand Up @@ -38,7 +38,7 @@ public void IpToGeo_Send_Success()

var a = AddOn.IpToGeo("an_ip", "geocode");

Assert.DoesNotThrow(() => client.AddEvent("AddOnTest", new {an_ip = "70.187.8.97"}, new List<AddOn> {a}));
Assert.DoesNotThrow(() => client.AddEvent("AddOnTest", new { an_ip = "70.187.8.97" }, new List<AddOn> { a }));
}

[Test]
Expand Down
6 changes: 3 additions & 3 deletions Keen.NetStandard.Test/DatasetTests.cs
@@ -1,10 +1,10 @@
using Keen.Core.Dataset;
using System.Collections.Generic;
using System.Threading.Tasks;
using Keen.Core.Dataset;
using Keen.Core.Query;
using Moq;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using System.Collections.Generic;
using System.Threading.Tasks;


namespace Keen.Core.Test
Expand Down
8 changes: 4 additions & 4 deletions Keen.NetStandard.Test/DatasetTests_Integration.cs
@@ -1,14 +1,14 @@
using Keen.Core.Dataset;
using Keen.Core.Query;
using Moq;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Keen.Core.Dataset;
using Keen.Core.Query;
using Moq;
using NUnit.Framework;


namespace Keen.Core.Test
Expand Down
2 changes: 1 addition & 1 deletion Keen.NetStandard.Test/DelegatingHandlerMock.cs
@@ -1,4 +1,4 @@
using System.Net.Http;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

Expand Down
4 changes: 2 additions & 2 deletions Keen.NetStandard.Test/EventCachePortableTestable.cs
@@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;


namespace Keen.Core.Test
Expand All @@ -16,4 +16,4 @@ internal static async Task<EventCachePortableTestable> NewTestableAsync()

internal void ResetStaticMembers() => events.Clear();
}
}
}
6 changes: 3 additions & 3 deletions Keen.NetStandard.Test/EventCacheTest.cs
@@ -1,10 +1,10 @@
using Keen.Core.EventCache;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Keen.Core.EventCache;
using Newtonsoft.Json.Linq;
using NUnit.Framework;


namespace Keen.Core.Test
Expand Down
4 changes: 2 additions & 2 deletions Keen.NetStandard.Test/EventCollectionMock.cs
@@ -1,6 +1,6 @@
using Newtonsoft.Json.Linq;
using System;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;


namespace Keen.Core.Test
Expand All @@ -20,7 +20,7 @@ class EventCollectionMock : IEventCollection

public Task<JObject> GetSchema(string collection)
{
return Task.Run(()=>_getSchema(collection, _settings));
return Task.Run(() => _getSchema(collection, _settings));
}

public Task DeleteCollection(string collection)
Expand Down
4 changes: 2 additions & 2 deletions Keen.NetStandard.Test/EventMock.cs
@@ -1,8 +1,8 @@
using Keen.Core.EventCache;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Keen.Core.EventCache;
using Newtonsoft.Json.Linq;


namespace Keen.Core.Test
Expand Down
5 changes: 3 additions & 2 deletions Keen.NetStandard.Test/FuncHandler.cs
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -30,7 +30,8 @@ internal class FuncHandler : IHttpMessageHandler

public Func<HttpRequestMessage,
CancellationToken,
Task<HttpResponseMessage>> DefaultAsync { get; set; }
Task<HttpResponseMessage>> DefaultAsync
{ get; set; }


public async Task<HttpResponseMessage> SendAsync(
Expand Down

0 comments on commit fdefe32

Please sign in to comment.