1
0
Fork 0

PROJECT: update AStyleWhore (renamed to AStyleHelper)

This commit is contained in:
Duncan Ogilvie 2017-11-04 18:34:54 +01:00
parent ae20041edb
commit 4d413d0f0f
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
6 changed files with 43 additions and 40 deletions

2
.gitignore vendored
View File

@ -69,7 +69,7 @@ RDb*
src/build-*/
# Exceptions
!/hooks/AStyleWhore.exe
!/hooks/AStyleHelper.exe
!/hooks/AStyle.dll
!/bin/x64dbg_shell_remove.reg
!*.lib

View File

@ -1,2 +1,2 @@
@echo off
hooks\AStyleWhore.exe Silent
hooks\AStyleHelper.exe Silent

View File

@ -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>

View File

@ -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).

View File

@ -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