Skip to content

Commit ad1a2dd

Browse files
authored
Merge pull request #25 from EmbarkStudios/webbju/add-editorconfig
Formalized coding standard.
2 parents 31a7f11 + 86ec548 commit ad1a2dd

12 files changed

+1039
-1023
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
tab_width = 4
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
charset=utf-8
10+
11+
[*.{cs,vb}]
12+
dotnet_sort_system_directives_first = true
13+
dotnet_separate_import_directive_groups = false

ServerCodeExciser.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.2.32526.322
55
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FA80E53A-9EEF-4F05-BEE3-EC8393F1975B}"
7+
ProjectSection(SolutionItems) = preProject
8+
.editorconfig = .editorconfig
9+
EndProjectSection
10+
EndProject
611
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerCodeExciser", "ServerCodeExciser\ServerCodeExciser.csproj", "{6E4116C9-9BEB-4FBA-B035-D91555E2C981}"
712
EndProject
813
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerCodeExciserTest", "ServerCodeExciserTest\ServerCodeExciserTest.csproj", "{6E4116C9-9BEB-4FBA-B035-D91555E2C982}"

ServerCodeExciser/ServerCodeExciser.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using ServerCodeExcisionCommon;
2-
using Spectre.Console;
3-
using Spectre.Console.Cli;
41
using System;
52
using System.ComponentModel;
63
using System.Diagnostics.CodeAnalysis;
74
using System.IO;
85
using System.Text.Json;
96
using System.Text.Json.Serialization;
7+
using ServerCodeExcisionCommon;
8+
using Spectre.Console;
9+
using Spectre.Console.Cli;
1010
using UnrealAngelscriptServerCodeExcision;
1111

1212
namespace ServerCodeExciser
@@ -69,7 +69,7 @@ public sealed class Settings : CommandSettings
6969
class RootPaths
7070
{
7171
[JsonPropertyName("AngelscriptScriptRoots")]
72-
public string[] AngelscriptScriptRoots { get;set;} = Array.Empty<string>();
72+
public string[] AngelscriptScriptRoots { get; set; } = Array.Empty<string>();
7373
}
7474

7575
public override int Execute([NotNull] CommandContext context, [NotNull] Settings settings)
@@ -91,7 +91,7 @@ public override int Execute([NotNull] CommandContext context, [NotNull] Settings
9191
var desc = File.ReadAllText(settings.InputPath);
9292
var paths = JsonSerializer.Deserialize<RootPaths>(desc);
9393
if (paths != null)
94-
{
94+
{
9595
parameters.InputPaths.UnionWith(paths.AngelscriptScriptRoots);
9696
}
9797
else

ServerCodeExciser/ServerCodeExcisionProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using Antlr4.Runtime;
2-
using ServerCodeExcisionCommon;
31
using System;
42
using System.Collections.Generic;
53
using System.Diagnostics;
64
using System.IO;
75
using System.Linq;
86
using System.Text;
97
using System.Text.RegularExpressions;
8+
using Antlr4.Runtime;
9+
using ServerCodeExcisionCommon;
1010

1111
namespace ServerCodeExciser
1212
{

ServerCodeExciserTest/ExcisionIntegrationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
using System;
2+
using System.IO;
13
using Microsoft.VisualStudio.TestTools.UnitTesting;
24
using ServerCodeExciser;
35
using ServerCodeExcisionCommon;
4-
using System;
5-
using System.IO;
66
using UnrealAngelscriptServerCodeExcision;
77

88
[TestClass]
@@ -110,5 +110,5 @@ private static EExciserReturnValues RunExciserIntegrationTests(string fileExtens
110110
}
111111

112112
return returnCode;
113-
}
113+
}
114114
}

ServerCodeExcisionCommon/IServerCodeExcisionLanguage.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22

33
namespace ServerCodeExcisionCommon
44
{
5-
public interface IServerCodeExcisionLanguage
6-
{
7-
List<string> ServerOnlySymbolRegexes { get; }
5+
public interface IServerCodeExcisionLanguage
6+
{
7+
List<string> ServerOnlySymbolRegexes { get; }
88

9-
List<string> ServerOnlySymbols { get; }
9+
List<string> ServerOnlySymbols { get; }
1010

11-
string ServerPrecompilerSymbol { get; }
11+
string ServerPrecompilerSymbol { get; }
1212

13-
string ServerScopeStartString { get; }
13+
string ServerScopeStartString { get; }
1414

15-
string ServerScopeEndString { get; }
15+
string ServerScopeEndString { get; }
1616

17-
T CreateLexer<T>(Antlr4.Runtime.AntlrInputStream inputStream)
18-
where T : Antlr4.Runtime.Lexer;
17+
T CreateLexer<T>(Antlr4.Runtime.AntlrInputStream inputStream)
18+
where T : Antlr4.Runtime.Lexer;
1919

20-
T CreateParser<T>(Antlr4.Runtime.CommonTokenStream tokenStream)
21-
where T : Antlr4.Runtime.Parser;
20+
T CreateParser<T>(Antlr4.Runtime.CommonTokenStream tokenStream)
21+
where T : Antlr4.Runtime.Parser;
2222

23-
IServerCodeVisitor CreateSimpleVisitor(string code);
23+
IServerCodeVisitor CreateSimpleVisitor(string code);
2424

25-
IServerCodeVisitor CreateFunctionVisitor(string code);
25+
IServerCodeVisitor CreateFunctionVisitor(string code);
2626

27-
IServerCodeVisitor CreateSymbolVisitor(string code);
27+
IServerCodeVisitor CreateSymbolVisitor(string code);
2828

29-
bool AnyServerOnlySymbolsInScript(string script);
30-
}
31-
}
29+
bool AnyServerOnlySymbolsInScript(string script);
30+
}
31+
}

ServerCodeExcisionCommon/IServerCodeVisitor.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
namespace ServerCodeExcisionCommon
44
{
5-
public struct ServerOnlyScopeData
6-
{
7-
public int StartIndex;
8-
public int StopIndex;
9-
public string Opt_ElseContent;
5+
public struct ServerOnlyScopeData
6+
{
7+
public int StartIndex;
8+
public int StopIndex;
9+
public string Opt_ElseContent;
1010

11-
public ServerOnlyScopeData(int startIndex, int stopIndex)
12-
{
13-
StartIndex = startIndex;
14-
StopIndex = stopIndex;
15-
Opt_ElseContent = "";
16-
}
17-
}
11+
public ServerOnlyScopeData(int startIndex, int stopIndex)
12+
{
13+
StartIndex = startIndex;
14+
StopIndex = stopIndex;
15+
Opt_ElseContent = "";
16+
}
17+
}
1818

19-
public interface IServerCodeVisitor
20-
{
21-
List<ServerOnlyScopeData> DetectedServerOnlyScopes { get; }
22-
Dictionary<int, HashSet<string>> ClassStartIdxDummyReferenceData { get; }
23-
int TotalNumberOfFunctionCharactersVisited { get; }
19+
public interface IServerCodeVisitor
20+
{
21+
List<ServerOnlyScopeData> DetectedServerOnlyScopes { get; }
22+
Dictionary<int, HashSet<string>> ClassStartIdxDummyReferenceData { get; }
23+
int TotalNumberOfFunctionCharactersVisited { get; }
2424

25-
void VisitContext(Antlr4.Runtime.Tree.IParseTree context);
26-
}
27-
}
25+
void VisitContext(Antlr4.Runtime.Tree.IParseTree context);
26+
}
27+
}

0 commit comments

Comments
 (0)