Skip to content

Commit

Permalink
Apply initial pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
lethosor committed Apr 12, 2022
1 parent 0fc451d commit d1f0edd
Show file tree
Hide file tree
Showing 118 changed files with 481 additions and 543 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildmaster-rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
pull_request:
description: Pull request ID
type: number
type: string
required: true # remove if we support commit rebuilds later

jobs:
Expand Down
1 change: 0 additions & 1 deletion CMake/Modules/FindSphinx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ find_package_handle_standard_args(Sphinx DEFAULT_MSG
)

mark_as_advanced(SPHINX_EXECUTABLE)

2 changes: 1 addition & 1 deletion README.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
<body>
Follow this <a href='./docs/index.html'>link to the documentation.</a>
</body>
</html>
</html>
112 changes: 56 additions & 56 deletions build/build-osx.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,88 +7,88 @@ LUA_PATCH=1
ME=$PWD/`basename $0`

usage() {
echo "Usage: $0 [options] {DF_OSX_PATH}"
echo -e "\told\t- use on pre-Snow Leopard OSX installations"
echo -e "\tbrew\t- if GCC 4.5 was installed with homebrew"
echo -e "\tport\t- if GCC 4.5 was insalled with macports"
echo -e "\tclean\t- delete ../build-osx before compiling"
echo "Example:"
echo -e "\t$0 old brew ../../../personal/df_osx"
echo -e "\t$0 port clean /Users/dfplayer/df_osx"
exit $1
echo "Usage: $0 [options] {DF_OSX_PATH}"
echo -e "\told\t- use on pre-Snow Leopard OSX installations"
echo -e "\tbrew\t- if GCC 4.5 was installed with homebrew"
echo -e "\tport\t- if GCC 4.5 was insalled with macports"
echo -e "\tclean\t- delete ../build-osx before compiling"
echo "Example:"
echo -e "\t$0 old brew ../../../personal/df_osx"
echo -e "\t$0 port clean /Users/dfplayer/df_osx"
exit $1
}

options() {
case $1 in
brew)
echo "Using homebrew gcc."
export CC=/usr/local/bin/gcc-4.5
export CXX=/usr/local/bin/g++-4.5
targetted=1
;;
port)
echo "Using macports gcc."
export CC=/opt/local/bin/gcc-mp-4.5
export CXX=/opt/local/bin/g++-mp-4.5
targetted=1
;;
old)
LUA_PATCH=0
;;
clean)
echo "Deleting ../build-osx"
rm -rf ../build-osx
;;
*)
;;
esac
case $1 in
brew)
echo "Using homebrew gcc."
export CC=/usr/local/bin/gcc-4.5
export CXX=/usr/local/bin/g++-4.5
targetted=1
;;
port)
echo "Using macports gcc."
export CC=/opt/local/bin/gcc-mp-4.5
export CXX=/opt/local/bin/g++-mp-4.5
targetted=1
;;
old)
LUA_PATCH=0
;;
clean)
echo "Deleting ../build-osx"
rm -rf ../build-osx
;;
*)
;;
esac
}

# sanity checks
if [[ $# -lt 1 ]]
then
echo "Not enough arguments."
usage 0
echo "Not enough arguments."
usage 0
fi
if [[ $# -gt 4 ]]
then
echo "Too many arguments."
usage 1
echo "Too many arguments."
usage 1
fi

# run through the arguments
for last
do
options $last
options $last
done
# last keeps the last argument

if [[ $targetted -eq 0 ]]
then
echo "You did not specify whether you intalled GCC 4.5 from brew or ports."
echo "If you continue, your default compiler will be used."
read -p "Are you sure you want to continue? [y/N] " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 0
fi
echo "You did not specify whether you intalled GCC 4.5 from brew or ports."
echo "If you continue, your default compiler will be used."
read -p "Are you sure you want to continue? [y/N] " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 0
fi
fi

# check for build folder and start working there
if [[ ! -d ../build-osx ]]
then
mkdir ../build-osx
mkdir ../build-osx
fi
cd ../build-osx

# patch if necessary
if [[ $LUA_PATCH -ne 0 ]]
then
cd ..
echo "$PWD"
sed -e '1,/'"PATCH""CODE"'/d' "$ME" | patch -p0
cd -
cd ..
echo "$PWD"
sed -e '1,/'"PATCH""CODE"'/d' "$ME" | patch -p0
cd -
fi

echo "Generate"
Expand All @@ -101,17 +101,17 @@ make install
# unpatch if /libarary/luaTypes.cpp was patched
if [[ $LUA_PATCH -ne 0 ]]
then
cd ..
echo -n "un"
sed -e '1,/'"PATCH""CODE"'/d' "$ME" | patch -p0 -R
cd -
cd ..
echo -n "un"
sed -e '1,/'"PATCH""CODE"'/d' "$ME" | patch -p0 -R
cd -
fi

exit 0

# PATCHCODE - everything below this line is fed into patch
--- library/LuaTypes.cpp 2014-08-20 00:13:17.000000000 -0700
+++ library/LuaTypes.cpp 2014-08-31 23:31:00.000000000 -0700
--- library/LuaTypes.cpp 2014-08-20 00:13:17.000000000 -0700
+++ library/LuaTypes.cpp 2014-08-31 23:31:00.000000000 -0700
@@ -464,7 +464,7 @@
{
case struct_field_info::STATIC_STRING:
Expand Down
64 changes: 32 additions & 32 deletions build/sublime/dfhack.sublime-project
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"folders":
[
{
"path": "."
}
],
"build_systems":
[
{
"name": "DFHack make",
"working_dir": "$project_path",
"cmd": ["python", "$project_path/build/sublime/make.py", "$file"],
"variants": [
{
"name": "Build all",
"cmd": ["python", "$project_path/build/sublime/make.py", "-a"]
},
{
"name": "Build+install all",
"cmd": ["python", "$project_path/build/sublime/make.py", "-ai"]
},
{
"name": "Build plugin",
"cmd": ["python", "$project_path/build/sublime/make.py", "-ap", "$file"]
},
{
"name": "Build+install plugin",
"cmd": ["python", "$project_path/build/sublime/make.py", "-aip", "$file"]
}
]
}
]
"folders":
[
{
"path": "."
}
],
"build_systems":
[
{
"name": "DFHack make",
"working_dir": "$project_path",
"cmd": ["python", "$project_path/build/sublime/make.py", "$file"],
"variants": [
{
"name": "Build all",
"cmd": ["python", "$project_path/build/sublime/make.py", "-a"]
},
{
"name": "Build+install all",
"cmd": ["python", "$project_path/build/sublime/make.py", "-ai"]
},
{
"name": "Build plugin",
"cmd": ["python", "$project_path/build/sublime/make.py", "-ap", "$file"]
},
{
"name": "Build+install plugin",
"cmd": ["python", "$project_path/build/sublime/make.py", "-aip", "$file"]
}
]
}
]
}
2 changes: 1 addition & 1 deletion build/win32/build-debug.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
call "%VS140COMNTOOLS%vsvars32.bat"
cd VC2015_32
msbuild /m /p:Platform=Win32 /p:Configuration=RelWithDebInfo ALL_BUILD.vcxproj
cd ..
cd ..
2 changes: 1 addition & 1 deletion build/win32/build-release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ call "%VS140COMNTOOLS%vsvars32.bat"
cd VC2015_32
msbuild /m /p:Platform=Win32 /p:Configuration=Release ALL_BUILD.vcxproj
cd ..
pause
pause
Empty file modified build/win32/generate-MSVC-all.bat
100755 → 100644
Empty file.
Empty file modified build/win32/generate-MSVC-gui.bat
100755 → 100644
Empty file.
Empty file modified build/win32/generate-MSVC-minimal.bat
100755 → 100644
Empty file.
Empty file modified build/win32/generate-MSVC-release.bat
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion build/win32/install-debug.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
call "%VS140COMNTOOLS%vsvars32.bat"
cd VC2015_32
msbuild /m /p:Platform=Win32 /p:Configuration=RelWithDebInfo INSTALL.vcxproj
cd ..
cd ..
2 changes: 1 addition & 1 deletion build/win32/install-release.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
call "%VS140COMNTOOLS%vsvars32.bat"
cd VC2015_32
msbuild /m /p:Platform=Win32 /p:Configuration=Release INSTALL.vcxproj
cd ..
cd ..
2 changes: 1 addition & 1 deletion build/win32/package-debug.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ call "%VS140COMNTOOLS%vsvars32.bat"
cd VC2015_32
msbuild /m /p:Platform=Win32 /p:Configuration=RelWithDebInfo PACKAGE.vcxproj
cd ..
exit %ERRORLEVEL%
exit %ERRORLEVEL%
4 changes: 2 additions & 2 deletions build/win32/set_df_path.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If fso.FileExists("DF_PATH.txt") Then
fso.DeleteFile "DF_PATH.txt", True
End If

If IsValue(objF) Then
If IsValue(objF) Then
If InStr(1, TypeName(objF), "Folder") > 0 Then
Set spoFile = fso.CreateTextFile("DF_PATH.txt", True)
spoFile.WriteLine(objF.Self.Path)
Expand All @@ -29,4 +29,4 @@ Function IsValue(obj)
IsValue = True
End If
On Error GoTo 0
End Function
End Function
Empty file modified build/win64/generate-MSVC-all.bat
100755 → 100644
Empty file.
Empty file modified build/win64/generate-MSVC-gui.bat
100755 → 100644
Empty file.
Empty file modified build/win64/generate-MSVC-minimal.bat
100755 → 100644
Empty file.
Empty file modified build/win64/generate-MSVC-release.bat
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion build/win64/package-debug.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd6
cd VC2015
msbuild /m /p:Platform=x64 /p:Configuration=RelWithDebInfo PACKAGE.vcxproj
cd ..
exit %ERRORLEVEL%
exit %ERRORLEVEL%
4 changes: 2 additions & 2 deletions build/win64/set_df_path.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If fso.FileExists("DF_PATH.txt") Then
fso.DeleteFile "DF_PATH.txt", True
End If

If IsValue(objF) Then
If IsValue(objF) Then
If InStr(1, TypeName(objF), "Folder") > 0 Then
Set spoFile = fso.CreateTextFile("DF_PATH.txt", True)
spoFile.WriteLine(objF.Self.Path)
Expand All @@ -29,4 +29,4 @@ Function IsValue(obj)
IsValue = True
End If
On Error GoTo 0
End Function
End Function
1 change: 0 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
DFHack documentation build configuration file
Expand Down
1 change: 0 additions & 1 deletion data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ if(BUILD_TESTS)
DESTINATION blueprints/library/test
)
endif()

1 change: 0 additions & 1 deletion data/blueprints/library/aquifer_tap.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ u <- drainage level
,,,,,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r
,,,,,,,,,,,,r
,,,,,,,,,,,,r

9 changes: 4 additions & 5 deletions data/blueprints/library/dreamfort.csv
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ quickfort undo library/dreamfort.csv -n /perimeter,# Clean up after you find you
quickfort run library/dreamfort.csv -n /surface1,# Run when you find your center tile.
quickfort run library/dreamfort.csv -n /dig_all,"# Run when you find a suitable rock layer for the industry level. It designates digging for industry, services, guildhall, suites, and apartments all in one go. This list does not include the farming level, which we'll dig in the uppermost soil layer a bit later. Note that it is more efficient for your miners if you designate your digging before they dig the central stairs past that level since the stairs are dug at a low priority. This keeps your miners focused on one level at a time. If you need to designate your levels individually due to caverns interrupting the sequence or just because it is your preference, run the level-specific dig blueprints (i.e. /industry1, /services1, /guildhall1, /suites1, and 5 levels of /apartments1) instead of running /dig_all."
""
-- Core fort (should finish at about the third migration wave) --
-- Core fort (should finish at about the third migration wave) --
quickfort run library/dreamfort.csv -n /surface2,# Run after initial trees are cleared.
quickfort run library/dreamfort.csv -n /farming1,# Run when channels are dug and the additional designated trees are cleared.
quickfort run library/dreamfort.csv -n /farming2,# Run when the farming level has been dug out.
Expand All @@ -82,11 +82,11 @@ prioritize ConstructBuilding,# Run when you see the bridges ready to be built so
"quickfort run,orders library/dreamfort.csv -n /surface6",# Run when at least the beehives and weapon rack are constructed and you have linked all levers to their respective bridges.
"quickfort run,orders library/dreamfort.csv -n /surface7",# Run after the surface walls are completed and any marked trees are chopped down.
""
-- Plumbing --
-- Plumbing --
"This is a good time to fill your well cisterns, either with a bucket brigade or by routing water from a freshwater stream or an aquifer (see the library/aquifer_tap.csv blueprint for help with this)."
"Also consider bringing magma up to your services level so you can replace the forge and furnaces on your industry level with more powerful magma versions. This is especially important if your embark has insufficient trees to convert into charcoal. Keep in mind that moving magma is a tricky process and can take a long time. Don't forget to continue making progress through the checklist! If you choose to use magma, I suggest getting it in place before importing the military and smelting automation orders since they make heavy use of furnaces and forges."
""
-- Mature fort (third migration wave onward) --
-- Mature fort (third migration wave onward) --
orders import furnace,# Automated production of basic furnace-related items. Don't forget to create a sand collection zone (or remove the sand- and glass-related orders if you have no sand).
"quickfort run,orders library/dreamfort.csv -n /suites2",# Run when the suites level has been dug out.
"quickfort run,orders library/dreamfort.csv -n /surface8","# Run if/when you need longer trap corridors on the surface for larger sieges, anytime after you run /surface7."
Expand Down Expand Up @@ -334,7 +334,7 @@ corridor/surface_corridor
message(Once the central stairs are mined out deeply enough, you should start digging the industry level in a non-aquifer rock layer. You'll need the boulders from the digging to make blocks.
If your wagon is within the fort perimeter, deconstruct it to get it out of the way.
Once the marked trees are all chopped down (if any), continue with /surface2.) clear trees and set up pastures"
central_stairs/central_stairs repeat(down 10)
central_stairs/central_stairs repeat(down 10)
clear_small/surface_clear_small
zones/surface_zones
name_zones/surface_name_zones
Expand Down Expand Up @@ -2897,4 +2897,3 @@ build2_apartments/apartments_build2
,,,,n,`,h,,n,`,h,,n,`,h,,n,`,h,,n,`,h,,n,`,h,,n,`,h
,,,,`,~,`,,`,~,`,,`,~,`,,`,~,`,,`,~,`,,`,~,`,,`,~,`
,,,,n,`,f,,n,`,f,,n,`,f,,n,`,f,,n,`,f,,n,`,f,,n,`,f

2 changes: 1 addition & 1 deletion data/blueprints/library/quickfortress.csv
Original file line number Diff line number Diff line change
Expand Up @@ -765,4 +765,4 @@ r+,,,,,,,,r+,,r+,,,,,,,,,r+,,r+,,,,,,,,,#
,,,,,,,,,,,,,,,,,,,,,Tl,Tl,Tl,d,,,,,,#
,,,,,,,,,,,,,,,,,,,,,,Tl,,,,,d,Msm,Msm,#
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#
#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#
#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#,#
1 change: 0 additions & 1 deletion dfhack-config/autonick.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,3 @@ Wilder
Wisdom
Wyatt
Zephyr

1 change: 0 additions & 1 deletion docs/Binpatches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,3 @@ The script interface simply lets you designate one of the squads that
are assigned to the barracks/armory containing the selected stand as
the intended user. In order to aid in the choice, it shows the number
of currently assigned racks for every valid squad.

1 change: 0 additions & 1 deletion docs/Contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ If you're not comfortable programming, you can help by:

All those things are crucial, and often under-represented. So if that's
your thing, go get started!

Loading

0 comments on commit d1f0edd

Please sign in to comment.