Skip to content

Commit

Permalink
Adding tab detection script to travis
Browse files Browse the repository at this point in the history
Enforces space intead of tabs for whitespace
  • Loading branch information
Graham Tremper committed Aug 21, 2014
1 parent 959a4e7 commit ed8b0af
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
@@ -1,6 +1,9 @@
language: cpp
compiler: g++
before_install:
# Enforce whitespace guidelines
- ./scripts/whitespace_check.sh

# g++4.8.1
- if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
- if [ "$CXX" == "g++" ]; then export CXX; fi
Expand Down
17 changes: 17 additions & 0 deletions scripts/whitespace_check.sh
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

#
# Enforce spaces instead of tabs
#

ENFORCED_FILES="autowiring examples src CMakeLists.txt"

# Go to root directory

if grep -r $'\t' $ENFORCED_FILES
then
#echo "The Autowiring project prohibits tabs for spacing."
#echo "Tabs found in the following files:"
#grep -rn "\t" $ENFORCED_FILES
exit 1
fi
2 changes: 1 addition & 1 deletion src/autonet/AutoNetServer.cpp
Expand Up @@ -6,5 +6,5 @@ AutoNetServer::AutoNetServer():
CoreThread("AutoNetServer")
{
}

//lol tabs
AutoNetServer::~AutoNetServer(){}
2 changes: 1 addition & 1 deletion src/autotesting/stdafx.h
Expand Up @@ -7,7 +7,7 @@
#include <thread>
#define NOMINMAX
#endif

#ifndef _MSC_VER
#include <stdlib.h>
#endif
Expand Down

0 comments on commit ed8b0af

Please sign in to comment.