Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerin-of-the-Toast committed Jun 20, 2023
2 parents be1b2d9 + 0d97f08 commit abbd848
Show file tree
Hide file tree
Showing 1,930 changed files with 1,030,654 additions and 632,277 deletions.
16 changes: 16 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,37 @@ modernize-*,\
performance-*,\
readability-*,\
-readability-braces-around-statements,\
-bugprone-assignment-in-if-condition,\
-bugprone-easily-swappable-parameters,\
-bugprone-implicit-widening-of-multiplication-result,\
-bugprone-narrowing-conversions,\
-bugprone-throw-keyword-missing,\
-bugprone-unchecked-optional-access,\
-bugprone-unhandled-exception-at-new,\
-misc-confusable-identifiers,\
-misc-const-correctness,\
-misc-no-recursion,\
-misc-non-private-member-variables-in-classes,\
-misc-use-anonymous-namespace,\
-modernize-concat-nested-namespaces,\
-modernize-macro-to-enum,\
-modernize-pass-by-value,\
-modernize-return-braced-init-list,\
-modernize-use-default-member-init,\
-modernize-use-nodiscard,\
-performance-unnecessary-copy-initialization,\
-readability-container-data-pointer,\
-readability-convert-member-functions-to-static,\
-readability-duplicate-include,\
-readability-else-after-return,\
-readability-function-cognitive-complexity,\
-readability-identifier-length,\
-readability-identifier-naming,\
-readability-implicit-bool-conversion,\
-readability-magic-numbers,\
-readability-named-parameter,\
-readability-simplify-boolean-expr,\
-readability-suspicious-call-argument,\
-readability-use-anyofallof,\
"
WarningsAsErrors: '*'
Expand Down
27 changes: 27 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM mcr.microsoft.com/devcontainers/cpp:0-ubuntu-22.04

# NOTE: Uninstall CMake extensions
# This is not a supported method by CDDA maintainers and it's confusing have this in the editor
# TODO: Not possible yet, waiting on upstream.
# Considered trying to get cheeky and deleting the folder but I believe that is held on the host
# This would require building out a more full featured container. Easier to wait and see.
# RUN code --uninstall-extension ms-vscode.cmake-tools && \
# code --uninstall-extensiontwxs.cmake

ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2"

# Optionally install the cmake for vcpkg
COPY ./reinstall-cmake.sh /tmp/

RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
fi \
&& rm -f /tmp/reinstall-cmake.sh

# [Optional] Uncomment this section to install additional vcpkg ports.
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"

# [Optional] Uncomment this section to install additional packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends libsdl2-dev libsdl2-ttf-dev \
libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev build-essential astyle ccache
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "Cataclysm",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"github.vscode-github-actions",
"ms-vscode.makefile-tools",
"EditorConfig.EditorConfig",
"chiehyu.vscode-astyle"
]
}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
59 changes: 59 additions & 0 deletions .devcontainer/reinstall-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
set -e

CMAKE_VERSION=${1:-"none"}

if [ "${CMAKE_VERSION}" = "none" ]; then
echo "No CMake version specified, skipping CMake reinstallation"
exit 0
fi

# Cleanup temporary directory and associated files when exiting the script.
cleanup() {
EXIT_CODE=$?
set +e
if [[ -n "${TMP_DIR}" ]]; then
echo "Executing cleanup of tmp files"
rm -Rf "${TMP_DIR}"
fi
exit $EXIT_CODE
}
trap cleanup EXIT


echo "Installing CMake..."
apt-get -y purge --auto-remove cmake
mkdir -p /opt/cmake

architecture=$(dpkg --print-architecture)
case "${architecture}" in
arm64)
ARCH=aarch64 ;;
amd64)
ARCH=x86_64 ;;
*)
echo "Unsupported architecture ${architecture}."
exit 1
;;
esac

CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh"
CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt"
TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX)

echo "${TMP_DIR}"
cd "${TMP_DIR}"

curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O

sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}"
sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license

ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = .git,__pycache__,lang/json
exclude = .git,__pycache__,lang/json,tools/clang-tidy-plugin/test/check_clang_tidy.py
ignore =
# E265 forces comments to have a space after the '#'. We have a bunch of
# optional debugging code commented out this way, and not having a space is
Expand Down
26 changes: 0 additions & 26 deletions .github/CODEOWNERS

This file was deleted.

2 changes: 2 additions & 0 deletions .github/comment-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ users:
- irwiss
- strategineer
- pjf
- SurFlurer
- Procyonae

keywords:
- name: confirm-bug
Expand Down
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,6 @@
- "**/**vehicle**"
- "**/vehicle**"
- "src/veh_**"

"Game: Defense Mode":
- "src/gamemode_defense**"
52 changes: 52 additions & 0 deletions .github/reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
files:
'data/mods/Aftershock/**':
- Maleclypse
- John-Candlebury
'data/mods/DinoMod/**':
- LyleSY
'data/mods/BombasticPerks/**':
- bombasticSlacks
'data/mods/MMA/**':
- Hymore246
'data/mods/classic_zombies/**':
- I-am-Erk
'data/mods/generic_guns/**':
- tenmillimaster
'data/mods/Magiclysm/**':
- KorGgenT
- GuardianDll
'data/mods/My_Sweet_Cataclysm/**':
- Fris0uman
'data/mods/ruralbiome/**':
- I-am-Erk
'data/mods/speedydex/**':
- KorGgenT
'data/mods/stats_through_kills/**':
- KorGgenT
'data/mods/Xedra_Evolved/**':
- Maleclypse
- GuardianDll
'data/mods/innawood/**':
- Light-Wave
'data/mods/MA/**':
- ZhilkinSerg
'data/mods/No_Hope/**':
- Night-Pryanik

'**/.clang-tidy':
- jbytheway
'**/magic*.cpp':
- KorGgenT
'**/magic*.h':
- KorGgenT
'tools/**':
- jbytheway
- int-ua
'src/widget.cpp':
- wapcaplet
- dseguin
'src/widget.h':
- wapcaplet
- dseguin
'src/ui_manager.*':
- Qrox
49 changes: 8 additions & 41 deletions .github/vcpkg_ports/sdl2/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,21 @@
"homepage": "https://www.libsdl.org/download-2.0.php",
"license": "Zlib",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
{ "name": "vcpkg-cmake", "host": true },
{ "name": "vcpkg-cmake-config", "host": true }
],
"default-features": [
"base"
],
"features": {
"base": {
"description": "Base functionality for SDL",
"dependencies": [
{
"name": "sdl2",
"default-features": false,
"features": [
"ibus",
"wayland",
"x11"
],
"platform": "linux"
}
]
},
"ibus": {
"description": "Build with ibus IME support",
"supports": "linux"
},
"samplerate": {
"description": "Use libsamplerate for audio rate conversion",
"dependencies": [
"libsamplerate"
]
},
"vulkan": {
"description": "Vulkan functionality for SDL"
},
"wayland": {
"description": "Build with Wayland support",
"supports": "linux"
"dependencies": [ { "name": "sdl2", "default-features": false, "features": [ "ibus", "wayland", "x11" ], "platform": "linux" } ]
},
"x11": {
"description": "Build with X11 support",
"supports": "!windows"
}
"ibus": { "description": "Build with ibus IME support", "supports": "linux" },
"samplerate": { "description": "Use libsamplerate for audio rate conversion", "dependencies": [ "libsamplerate" ] },
"vulkan": { "description": "Vulkan functionality for SDL" },
"wayland": { "description": "Build with Wayland support", "supports": "linux" },
"x11": { "description": "Build with X11 support", "supports": "!windows" }
}
}
33 changes: 22 additions & 11 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Clang-tidy (clang-12, tiles)
name: Clang-tidy 16

on:
push:
Expand Down Expand Up @@ -49,26 +49,37 @@ jobs:
# parts: the src directory and everything else
subset: [ 'src', 'other' ]

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
CMAKE: 1
CLANG: clang++-12
COMPILER: clang++-12
CLANG: clang++-16
COMPILER: clang++-16
CATA_CLANG_TIDY: plugin
CATA_CLANG_TIDY_SUBSET: ${{ matrix.subset }}
TILES: 1
SOUND: 1
RELEASE: 1
steps:
- uses: actions/checkout@v3
- name: install dependencies
- name: install LLVM 16
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main"
sudo apt-get update
sudo apt-get install libncursesw5-dev clang-12 libclang-12-dev llvm-12-dev llvm-12-tools \
libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev ccache \
gettext jq
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt update
sudo apt install llvm-16 llvm-16-dev llvm-16-tools clang-16 clang-tidy-16 clang-tools-16 \
libclang-16-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev \
libpulse-dev ccache gettext jq
- name: install dependencies
run: |
sudo apt install python3-pip libncursesw5-dev ninja-build cmake gettext
pip3 install --user lit
- name: ensure clang-tidy and FileCheck commands point to LLVM 16
run: |
mkdir ~/llvm-command-override
ln -s /usr/bin/clang-tidy-16 ~/llvm-command-override/clang-tidy
ln -s /usr/bin/FileCheck-16 ~/llvm-command-override/FileCheck
echo "$HOME/llvm-command-override" >> $GITHUB_PATH
- name: checkout repository
uses: actions/checkout@v3
- name: prepare
run: bash ./build-scripts/requirements.sh
- name: determine changed files
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libncursesw5-dev ccache gettext parallel
sudo locale-gen en_US.UTF-8 de_DE.UTF-8
- name: install SDL2 dependencies (ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && matrix.tiles == 1 }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msvc-full-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
- name: Run tests
if: ${{ github.ref_name != 'master' }}
run: |
.\Cataclysm-test-vcpkg-static-Release-x64.exe --min-duration 0.2 --rng-seed time
.\Cataclysm-test-vcpkg-static-Release-x64.exe --min-duration 20 --rng-seed time
- name: Dump disk usage logs if job failed
if: failure()
Expand Down
Loading

0 comments on commit abbd848

Please sign in to comment.