Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Check dotnet format in travis #198

Merged
merged 16 commits into from
Sep 13, 2019
Merged
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
###############################
# Core EditorConfig Options #
###############################

# dotnet-format requires version 3.1.37601
# dotnet tool update -g dotnet-format
# remember to have: git config --global core.autocrlf false #(which is usually default)

root = true

# Every file

[*]
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
end_of_line = lf
#indent_style = tab # TODO
erikzhang marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ mono: none
dotnet: 2.2.300

before_install:
- cd tests/neo-vm.Tests
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ulimit -n 2048; fi

install:
- dotnet tool install -g dotnet-format --version 4.0.40103 --add-source https://dotnet.myget.org/F/format/api/v3/index.json
- export PATH="$PATH:$HOME/.dotnet/tools"
- dotnet-format --version
before_script:
- echo "Checking format..."
- dotnet format --check --dry-run -w src/neo-vm -v diagnostic # check C# formatting for the source
- dotnet format --check --dry-run -w tests/neo-vm.Tests -v diagnostic # check C# formatting for the unit tests
- cd tests/neo-vm.Tests
script:
- dotnet restore
- find * -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- dotnet restore
- find * -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
after_success:
# After all tests OK, Send CodeDov report
- echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
Expand Down
2 changes: 1 addition & 1 deletion neo-vm.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.15
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Debugger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

namespace Neo.VM
{
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/ExecutionContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/ExecutionEngine.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Neo.VM.Types;
using Neo.VM.Types;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Instruction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text;
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/OpCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ public enum OpCode : byte

//Reserved = 0xAC,
//Reserved = 0xAE,

// Array
/// <summary>
/// An array is removed from top of the main stack. Its size is put on top of the main stack.
Expand Down
4 changes: 2 additions & 2 deletions src/neo-vm/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("neo-vm.Tests")]
[assembly: InternalsVisibleTo("neo-vm.Tests")]
4 changes: 2 additions & 2 deletions src/neo-vm/RandomAccessStack.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -95,4 +95,4 @@ public void Set(int index, T item)
list[(list.Count - index - 1)] = item;
}
}
}
}
2 changes: 1 addition & 1 deletion src/neo-vm/Script.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;

Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/ScriptBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Numerics;
using System.Text;
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/StackItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Neo.VM.Types;
using Neo.VM.Types;
using System;
using System.Collections.Generic;
using System.Numerics;
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Types/Array.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Types/Boolean.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.Numerics;

Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Types/ByteArray.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;

namespace Neo.VM.Types
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Types/Integer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.Numerics;

Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Types/InteropInterface.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;

namespace Neo.VM.Types
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Types/Map.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Types/Struct.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics;

namespace Neo.VM.Types
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/Unsafe.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.CompilerServices;

namespace Neo.VM
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/VMState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Neo.VM
namespace Neo.VM
{
public enum VMState : byte
{
Expand Down
2 changes: 1 addition & 1 deletion src/neo-vm/neo-vm.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Copyright>2016-2019 The Neo Project</Copyright>
Expand Down
4 changes: 2 additions & 2 deletions tests/neo-vm.Tests/Converters/ScriptConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Neo.Test.Extensions;
using Newtonsoft.Json;

Expand Down Expand Up @@ -40,4 +40,4 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
}
}
}
}
}
4 changes: 2 additions & 2 deletions tests/neo-vm.Tests/Extensions/JsonExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;

Expand Down Expand Up @@ -43,4 +43,4 @@ public static string ToJson(this object ut)
return JsonConvert.SerializeObject(ut, _settings);
}
}
}
}
4 changes: 2 additions & 2 deletions tests/neo-vm.Tests/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;

namespace Neo.Test.Extensions
Expand Down Expand Up @@ -54,4 +54,4 @@ public static byte[] FromHexString(this string value)
return result;
}
}
}
}
4 changes: 2 additions & 2 deletions tests/neo-vm.Tests/Helpers/RandomHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace Neo.Test.Helpers
{
Expand Down Expand Up @@ -46,4 +46,4 @@ public static short RandInt16()
return (short)_rand.Next(short.MaxValue);
}
}
}
}
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/APPEND.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "APPEND",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/ARRAYSIZE.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "ARRAYSIZE",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/NEWARRAY.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "NEWARRAY",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/NEWMAP.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "NEWMAP",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/NEWSTRUCT.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "NEWSTRUCT",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/PACK.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "PACK",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/PICKITEM.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "PICKITEM",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/REMOVE.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "REMOVE",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/REVERSE.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "REVERSE",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/SETITEM.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "SETITEM",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Arrays/UNPACK.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Arrays",
"name": "UNPACK",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/BitwiseLogic/EQUAL.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Bitwise Logic",
"name": "EQUAL same types",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Control/NOP.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Control",
"name": "NOP",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Control/RET.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Control",
"name": "RET",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Control/SYSCALL.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Control",
"name": "SYSCALL",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Exceptions/THROW.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Exceptions",
"name": "THROW",
"tests":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Exceptions",
"name": "THROWIFNOT",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Numeric/NOT.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Numeric",
"name": "NOT",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Numeric/NUMEQUAL.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Numeric",
"name": "NUMEQUAL same types",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Numeric/NUMNOTEQUAL.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Numeric",
"name": "NUMNOTEQUAL same types",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Numeric/SHL.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Numeric",
"name": "SHL",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Numeric/SHR.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Numeric",
"name": "SHR",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Numeric/SIGN.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Numeric",
"name": "SIGN",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Push/PUSH0.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Push",
"name": "PUSH0",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Push/PUSHBYTES1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Push",
"name": "PUSHBYTES1",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Push/PUSHBYTES10.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Push",
"name": "PUSHBYTES10",
"tests":
Expand Down
2 changes: 1 addition & 1 deletion tests/neo-vm.Tests/Tests/OpCodes/Push/PUSHBYTES11.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"category": "Push",
"name": "PUSHBYTES11",
"tests":
Expand Down
Loading