Skip to content

Commit

Permalink
Added more checks to .pre-commit-config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlaine committed Sep 1, 2020
1 parent f023d38 commit 45679f6
Show file tree
Hide file tree
Showing 48 changed files with 52 additions and 60 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,3 @@ StatementMacros:
TabWidth: 4
UseTab: Never
...

17 changes: 6 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
repos:
#- repo: https://github.com/pre-commit/pre-commit-hooks
#rev: v2.0.0
#hooks:
#- id: check-added-large-files
#- id: check-case-conflict
#- id: check-json
#- id: check-merge-conflict
#- id: check-symlinks
#- id: check-yaml
#- id: trailing-whitespace
#- id: end-of-file-fixer
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: check-added-large-files
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: local
hooks:
- id: clang-format
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Microsoft SEAL uses a customized `.clang-format` configuration for C++ code styl
A script `tools/scripts/clang-format-all.sh` is provided to easily format all C++ sources and headers in the `native` directory.

Documentation are mostly written in GitHub-flavored Markdown.
A line break is required after each full sentence.
A line break is required after each full sentence.
2 changes: 1 addition & 1 deletion android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</adaptive-icon>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</adaptive-icon>
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -20,7 +20,7 @@ allprojects {
repositories {
google()
jcenter()

}
}

Expand Down
1 change: 0 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

2 changes: 1 addition & 1 deletion dotnet/examples/7_Performance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private static void BFVPerformanceTest(SEALContext context)

bool hasZLIB = Serialization.IsSupportedComprMode(ComprModeType.ZLIB);
bool hasZSTD = Serialization.IsSupportedComprMode(ComprModeType.ZSTD);

using EncryptionParameters parms = context.FirstContextData.Parms;
using Modulus plainModulus = parms.PlainModulus;
ulong polyModulusDegree = parms.PolyModulusDegree;
Expand Down
2 changes: 1 addition & 1 deletion dotnet/examples/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ public static void PrintLine([CallerLineNumber] int lineNumber = 0)
Console.Write("Line {0,3} --> ", lineNumber);
}
}
}
}
2 changes: 1 addition & 1 deletion dotnet/nuget/NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ packages in this known location. In Microsoft Visual Studio 2019, for example, y
After this, you should be able to add a reference to this package in your own .NET project. After
creating or opening your project in Visual Studio, you can right click on the project in the
Solution Explorer window, and select `Manage NuGet packages...`. In the window that appears
you will be able to select the `Microsoft.Research.SEAL` NuGet package to add to your project.
you will be able to select the `Microsoft.Research.SEAL` NuGet package to add to your project.
2 changes: 1 addition & 1 deletion dotnet/src/EncryptionParameterQualifiers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,4 @@ protected override void DestroyNativeObject()
NativeMethods.EPQ_Destroy(NativePtr);
}
}
}
}
2 changes: 1 addition & 1 deletion dotnet/src/MemoryPoolHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ protected override void DestroyNativeObject()
NativeMethods.MemoryPoolHandle_Destroy(NativePtr);
}
}
}
}
2 changes: 1 addition & 1 deletion dotnet/src/SEALContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -518,4 +518,4 @@ protected override void DestroyNativeObject()
}
}
}
}
}
2 changes: 1 addition & 1 deletion dotnet/src/ValCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ public static bool IsValidFor(GaloisKeys galoisKeys, SEALContext context)
return result;
}
}
}
}
2 changes: 1 addition & 1 deletion dotnet/tests/MemoryManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public void SwitchProfileTest()
Assert.IsTrue(globalHandle.IsInitialized);
}
}
}
}
2 changes: 1 addition & 1 deletion dotnet/tests/MemoryPoolHandleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ public void ExceptionsTest()
Utilities.AssertThrows<ArgumentNullException>(() => handle.Set(null));
}
}
}
}
2 changes: 1 addition & 1 deletion native/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ target_sources(sealexamples
${CMAKE_CURRENT_LIST_DIR}/5_rotation.cpp
${CMAKE_CURRENT_LIST_DIR}/6_serialization.cpp
${CMAKE_CURRENT_LIST_DIR}/7_performance.cpp
)
)
2 changes: 1 addition & 1 deletion native/examples/SEALExamples.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/examples/SEALExamples.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/src/SEAL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,4 @@
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/src/SEAL.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,4 @@
<Filter>Other</Filter>
</None>
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/src/SEAL_C.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/src/SEAL_C.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@
<Filter>Other</Filter>
</Text>
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/src/seal/c/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ static_assert(false, "Require architecture == x64");

#endif // _MSC_VER

#define SEAL_C_FUNC SEAL_C_DECOR HRESULT SEAL_C_CALL
#define SEAL_C_FUNC SEAL_C_DECOR HRESULT SEAL_C_CALL
2 changes: 1 addition & 1 deletion native/src/seal/c/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
break;
}
return TRUE;
}
}
2 changes: 1 addition & 1 deletion native/src/seal/c/encryptionparameterqualifiers.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ SEAL_C_FUNC EPQ_SecLevel(void *thisptr, int *sec_level);

SEAL_C_FUNC EPQ_ParameterErrorName(void *thisptr, char *outstr, uint64_t *length);

SEAL_C_FUNC EPQ_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length);
SEAL_C_FUNC EPQ_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length);
2 changes: 1 addition & 1 deletion native/src/seal/c/galoiskeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ SEAL_C_FUNC GaloisKeys_GetIndex(uint32_t galois_elt, uint64_t *index)
{
return E_INVALIDARG;
}
}
}
2 changes: 1 addition & 1 deletion native/src/seal/c/memorymanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ SEAL_C_FUNC MMProf_Destroy(void *thisptr)

delete profile;
return S_OK;
}
}
2 changes: 1 addition & 1 deletion native/src/seal/c/memorypoolhandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ SEAL_C_FUNC MemoryPoolHandle_Equals(void *thisptr, void *otherptr, bool *result)

*result = (*pool == *other);
return S_OK;
}
}
2 changes: 1 addition & 1 deletion native/src/seal/c/relinkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ SEAL_C_FUNC RelinKeys_GetIndex(uint64_t key_power, uint64_t *index)
{
return E_INVALIDARG;
}
}
}
2 changes: 1 addition & 1 deletion native/src/seal/c/sealcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ SEAL_C_FUNC SEALContext_UsingKeyswitching(void *thisptr, bool *using_keyswitchin

SEAL_C_FUNC SEALContext_ParameterErrorName(void *thisptr, char *outstr, uint64_t *length);

SEAL_C_FUNC SEALContext_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length);
SEAL_C_FUNC SEALContext_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length);
2 changes: 1 addition & 1 deletion native/src/seal/c/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ SEAL_C_FUNC Version_Major(uint8_t *result);

SEAL_C_FUNC Version_Minor(uint8_t *result);

SEAL_C_FUNC Version_Patch(uint8_t *result);
SEAL_C_FUNC Version_Patch(uint8_t *result);
2 changes: 1 addition & 1 deletion native/src/seal/memorymanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ namespace seal
#else
#pragma message("WARNING: MemoryManager compiled thread-unsafe and MMProfGuard disabled to support /clr")
#endif
} // namespace seal
} // namespace seal
2 changes: 1 addition & 1 deletion native/src/seal/modulus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ namespace seal
}
return result;
}
} // namespace seal
} // namespace seal
2 changes: 1 addition & 1 deletion native/src/seal/util/dwthandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,4 @@ namespace seal
Arithmetic<ValueType, RootType, ScalarType> arithmetic_;
};
} // namespace util
} // namespace seal
} // namespace seal
2 changes: 1 addition & 1 deletion native/src/seal/util/numth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,4 @@ namespace seal
return true;
}
} // namespace util
} // namespace seal
} // namespace seal
2 changes: 1 addition & 1 deletion native/tests/SEALTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.3\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.3\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/tests/SEALTest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion native/tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" version="1.8.1.3" targetFramework="native" />
</packages>
</packages>
2 changes: 1 addition & 1 deletion native/tests/seal/memorymanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ namespace sealtest
}
ASSERT_EQ(1L, pool.use_count());
}
} // namespace sealtest
} // namespace sealtest
2 changes: 1 addition & 1 deletion native/tests/seal/testrunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
}
2 changes: 1 addition & 1 deletion pipelines/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
$ToolsDirectory = Join-Path -Path $Env:BUILD_SOURCESDIRECTORY -ChildPath tools
$NinjaZipFile = Join-Path $ToolsDirectory -ChildPath ninja.zip
$NinjaExeFile = Join-Path $ToolsDirectory -ChildPath ninja.exe
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip" -OutFile $NinjaZipFile
Expand-Archive -Path $NinjaZipFile -DestinationPath $ToolsDirectory
Copy-Item -Path $NinjaExeFile -Destination "c:\Program Files\CMake\bin"
Expand Down
1 change: 0 additions & 1 deletion pipelines/pipeline-CI-Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ stages:
parameters:
debug: false
name: Android

2 changes: 1 addition & 1 deletion pipelines/pipeline-CI-Debug-Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ stages:
- template: jobs.yml
parameters:
debug: true
name: Linux
name: Linux
2 changes: 1 addition & 1 deletion pipelines/pipeline-CI-Debug-Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ stages:
- template: jobs.yml
parameters:
debug: true
name: Windows
name: Windows
2 changes: 1 addition & 1 deletion pipelines/pipeline-CI-Debug-macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ stages:
- template: jobs.yml
parameters:
debug: true
name: macOS
name: macOS
2 changes: 1 addition & 1 deletion tools/scripts/clang-format-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ BASE_DIR=$(dirname "$0")
SEAL_ROOT_DIR=$BASE_DIR/../../
shopt -s globstar
clang-format -i $SEAL_ROOT_DIR/native/**/*.h
clang-format -i $SEAL_ROOT_DIR/native/**/*.cpp
clang-format -i $SEAL_ROOT_DIR/native/**/*.cpp
2 changes: 1 addition & 1 deletion tools/scripts/collect_system_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "Extracting: cmake -LA $SEALDIR > $CMAKE_ENV"
cmake -LA $SEALDIR > $CMAKE_ENV
echo "Extracting: cmake --system-information > $CMAKE_SYSTEM_INFO"
cmake --system-information > $CMAKE_SYSTEM_INFO
echo "Extracting: $CMAKE_CXX_COMPILER_CMD -v > $CMAKE_CXX_COMPILER 2>&1"
echo "Extracting: $CMAKE_CXX_COMPILER_CMD -v > $CMAKE_CXX_COMPILER 2>&1"
$CMAKE_CXX_COMPILER_CMD -v 2> $CMAKE_CXX_COMPILER

ARCHIVE_NAME=../system_info.tar
Expand Down

0 comments on commit 45679f6

Please sign in to comment.