Permalink
Browse files

PROJECT: update AStyleWhore (renamed to AStyleHelper)

  • Loading branch information...
mrexodia committed Nov 4, 2017
1 parent ae20041 commit 4d413d0f0f1d03b9aeeec47ee7d0d8d5d6f7cf1d
@@ -69,7 +69,7 @@ RDb*
src/build-*/
# Exceptions
!/hooks/AStyleWhore.exe
!/hooks/AStyleHelper.exe
!/hooks/AStyle.dll
!/bin/x64dbg_shell_remove.reg
!*.lib
@@ -1,2 +1,2 @@
@echo off
hooks\AStyleWhore.exe Silent
hooks\AStyleHelper.exe Silent
Binary file not shown.
@@ -2,12 +2,12 @@
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="AStyleWhore.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="AStyleHelper.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<applicationSettings>
<AStyleWhore.Properties.Settings>
<AStyleHelper.Properties.Settings>
<setting name="Pattern" serializeAs="String">
<value>*.c;*.h;*.cpp;*.hpp</value>
</setting>
@@ -17,6 +17,9 @@
<setting name="Ignore" serializeAs="String">
<value />
</setting>
</AStyleWhore.Properties.Settings>
<setting name="License" serializeAs="String">
<value />
</setting>
</AStyleHelper.Properties.Settings>
</applicationSettings>
</configuration>
@@ -1,5 +1,5 @@
# hooks
This contains two binaries `AStyleWhore.exe` and `AStyle.dll` to format any code before you commit.
This contains two binaries `AStyleHelper.exe` and `AStyle.dll` to format any code before you commit.
If you are unsure about the integrity of the files, don't hesitate to contact me (mrexodia). The source code is available at [BitBucket](https://bitbucket.org/mrexodia/astylewhore). The version of `AStyle.dll` is compiled from `AStyle_2.06_windows.zip` which came from [Sourceforge](https://sourceforge.net/projects/astyle/files/astyle/astyle%202.06/AStyle_2.06_windows.zip/download).
If you are unsure about the integrity of the files, don't hesitate to contact me (mrexodia). The source code is available [here](https://github.com/mrexodia/AStyleHelper). The version of `AStyle.dll` is compiled from `AStyle_2.06_windows.zip` which came from [Sourceforge](https://sourceforge.net/projects/astyle/files/astyle/astyle%202.06/AStyle_2.06_windows.zip/download).
@@ -1,33 +1,33 @@
#!/bin/sh
#
# Simple script to auto-format every source file before committing.
#
#check if the formatter is present
if [ ! -f ./hooks/AStyleWhore.exe ]; then
echo "AStyleWhore not found!"
exit 0
fi
#format the code
"./hooks/AStyleWhore.exe" Silent
#exit when nothing needs to be done
if [ $? == 0 ]; then
exit 0
fi
#stage the formatted files (when staged in this commit)
gitFiles=$(git diff-index --name-only --cached HEAD)
if [[ -n "${gitFiles}" ]]; then
for fname in $gitFiles; do
git add --all -- "${fname}"
done
fi
#cancel commit if the changes were undone by the formatting
gitFiles=$(git diff-index --name-only --cached HEAD)
if [ -z "$gitFiles" ]; then
"./hooks/AStyleWhore.exe" "After formatting, no files were staged..."
exit 1
fi
#!/bin/sh
#
# Simple script to auto-format every source file before committing.
#
#check if the formatter is present
if [ ! -f ./hooks/AStyleHelper.exe ]; then
echo "AStyleHelper not found!"
exit 0
fi
#format the code
"./hooks/AStyleHelper.exe" Silent
#exit when nothing needs to be done
if [ $? == 0 ]; then
exit 0
fi
#stage the formatted files (when staged in this commit)
gitFiles=$(git diff-index --name-only --cached HEAD)
if [[ -n "${gitFiles}" ]]; then
for fname in $gitFiles; do
git add --all -- "${fname}"
done
fi
#cancel commit if the changes were undone by the formatting
gitFiles=$(git diff-index --name-only --cached HEAD)
if [ -z "$gitFiles" ]; then
"./hooks/AStyleHelper.exe" "After formatting, no files were staged..."
exit 1
fi

0 comments on commit 4d413d0

Please sign in to comment.