mirror of https://github.com/x64dbg/TitanEngine
Update AStyle formatting tools
This commit is contained in:
parent
0f81825ff0
commit
cda4385d6d
BIN
AStyle.dll
BIN
AStyle.dll
Binary file not shown.
BIN
AStyleWhore.exe
BIN
AStyleWhore.exe
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
||||||
|
@echo off
|
||||||
|
hooks\AStyleHelper.exe Silent
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
|
<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>
|
||||||
|
<AStyleHelper.Properties.Settings>
|
||||||
|
<setting name="Pattern" serializeAs="String">
|
||||||
|
<value>*.c;*.h;*.cpp;*.hpp</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="Options" serializeAs="String">
|
||||||
|
<value>style=allman, convert-tabs, align-pointer=type, align-reference=middle, indent=spaces, indent-col1-comments, pad-oper, unpad-paren, keep-one-line-blocks, close-templates</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="Ignore" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="License" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
</AStyleHelper.Properties.Settings>
|
||||||
|
</applicationSettings>
|
||||||
|
</configuration>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# hooks
|
||||||
|
|
||||||
|
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 [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
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Simple script to auto-format every source file before committing.
|
# Simple script to auto-format every source file before committing.
|
||||||
#
|
#
|
||||||
|
|
||||||
#check if the formatter is present
|
#check if the formatter is present
|
||||||
if [ ! -f ./AStyleWhore.exe ]; then
|
if [ ! -f ./hooks/AStyleHelper.exe ]; then
|
||||||
echo "AStyleWhore not found!"
|
echo "AStyleHelper not found!"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#format the code
|
#format the code
|
||||||
"./AStyleWhore.exe" Silent
|
"./hooks/AStyleHelper.exe" Silent
|
||||||
|
|
||||||
#exit when nothing needs to be done
|
#exit when nothing needs to be done
|
||||||
if [ $? == 0 ]; then
|
if [ $? == 0 ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#stage the formatted files (when staged in this commit)
|
#stage the formatted files (when staged in this commit)
|
||||||
gitFiles=$(git diff-index --name-only --cached HEAD)
|
gitFiles=$(git diff-index --name-only --cached HEAD)
|
||||||
if [[ -n "${gitFiles}" ]]; then
|
if [[ -n "${gitFiles}" ]]; then
|
||||||
for fname in $gitFiles; do
|
for fname in $gitFiles; do
|
||||||
git add --all -- "${fname}"
|
git add --all -- "${fname}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#cancel commit if the changes were undone by the formatting
|
#cancel commit if the changes were undone by the formatting
|
||||||
gitFiles=$(git diff-index --name-only --cached HEAD)
|
gitFiles=$(git diff-index --name-only --cached HEAD)
|
||||||
if [ -z "$gitFiles" ]; then
|
if [ -z "$gitFiles" ]; then
|
||||||
"./AStyleWhore.exe" "After formatting, no files were staged..."
|
"./hooks/AStyleHelper.exe" "After formatting, no files were staged..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue