VERY experimental Nintendo Switch 2 emulator
C++
force no-tab/trailing spaces with git hook
Lectem85183a702ab3
diff --git a/.gitconfig b/.gitconfignew file mode 100644index 0000000000..4cab7f2d97--- /dev/null+++ b/.gitconfig@@ -0,0 +1,2 @@+[core]+ whitespace = blank-at-eol,trailing-space,tab-in-indentdiff --git a/CMakeLists.txt b/CMakeLists.txtindex fc742317c0..d958dfc352 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -4,6 +4,13 @@ cmake_minimum_required(VERSION 2.8.11)project(citra)+if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit)+ message(STATUS "Copying pre-commit hook")+ file(COPY hooks/pre-commit+ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks+ FILE_PERMISSIONS WORLD_EXECUTE )+endif()+if (NOT MSVC)set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -pthread")set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")diff --git a/hooks/pre-commit b/hooks/pre-commitnew file mode 100644index 0000000000..44010fa1a0--- /dev/null+++ b/hooks/pre-commit@@ -0,0 +1,23 @@+#!/bin/sh++#check the config, in case the user really wants to allow tabs...+allowtabs=$(git config hooks.allowtabs)+if [ "$allowtabs" != "true" ] &&+ git diff --cached | egrep '^\+.* '+then+ cat<<END;+Error: This commit would contain a tab, which is against this repo's policy.+END+ exit 1+fi++# If there are whitespace errors, print the offending file names and fail.+if+# Use git built-in checks for trailing whitespaces+ ! git diff --check --cached+then+ cat<<END;+Error: This commit would contain trailing spaces, which is against this repo's policy.+END+ exit 1+fi