Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SuddenEyePuncture committed Jul 3, 2021
2 parents 4abed49 + 0f172bb commit 45348a5
Show file tree
Hide file tree
Showing 956 changed files with 34,493 additions and 9,902 deletions.
69 changes: 53 additions & 16 deletions .clang-tidy
Expand Up @@ -4,6 +4,30 @@
# this codebase and we do not intend to fix. The disabled checks appearing
# thereafter in a separate alphabetical list have yet to be triaged. We may
# fix their errors or recategorise them as checks we don't care about.
#
# Comments on the checks we have decided are not worthwhile:
#
# * cert-dcl21-cpp (postfix operator++ and operator-- should return const objects)
# This is an unconventional code style, and conflicts with
# readability-const-return-type.
#
# * cert-env33-c (calls to system, popen)
# Unlikely to catch bugs, and using system is convenient for portability.
#
# * cert-err58-cpp (exceptions from static variable declarations)
# We have lots of memory allocations in static variable declarations, and
# that's fine.
#
# * modernize-use-auto
# We prefer an almost-always-avoid-auto style.
#
# * modernize-use-trailing-return-type
# An arbitrary style convention we haven't adopted.
#
# * readability-braces-around-statements
# Covered by astyle and buggy in clang-tidy 8. Can enable once we have a newer
# clang-tidy.

Checks: "\
bugprone-*,\
cata-*,\
Expand All @@ -21,34 +45,47 @@ modernize-*,\
-modernize-use-trailing-return-type,\
performance-*,\
readability-*,\
-readability-braces-around-statements,\
-bugprone-branch-clone,\
-bugprone-infinite-loop,\
-bugprone-misplaced-widening-cast,\
-bugprone-narrowing-conversions,\
-bugprone-unused-return-value,\
-cert-err34-c,\
-cert-flp30-c,\
-cert-msc30-c,\
-cert-msc32-c,\
-cert-msc50-cpp,\
-cert-msc51-cpp,\
-bugprone-redundant-branch-condition,\
-bugprone-reserved-identifier,\
-bugprone-signed-char-misuse,\
-bugprone-sizeof-expression,\
-bugprone-unhandled-self-assignment,\
-cert-dcl37-c,\
-cert-dcl51-cpp,\
-cert-oop54-cpp,\
-cert-str34-c,\
-clang-analyzer-core.CallAndMessage,\
-clang-analyzer-deadcode.DeadStores,\
-misc-misplaced-const,\
-misc-no-recursion,\
-misc-non-private-member-variables-in-classes,\
-misc-redundant-expression,\
-modernize-avoid-bind,\
-modernize-avoid-c-arrays,\
-modernize-loop-convert,\
-modernize-pass-by-value,\
-modernize-return-braced-init-list,\
-modernize-use-default-member-init,\
-modernize-use-emplace,\
-performance-inefficient-vector-operation,\
-performance-noexcept-move-constructor,\
-performance-implicit-conversion-in-loop,\
-performance-inefficient-string-concatenation,\
-performance-type-promotion-in-math-fn,\
-modernize-use-override,\
-performance-no-automatic-move,\
-performance-trivially-destructible,\
-performance-unnecessary-value-param,\
-readability-braces-around-statements,\
-readability-avoid-const-params-in-decls,\
-readability-convert-member-functions-to-static,\
-readability-else-after-return,\
-readability-function-size,\
-readability-function-cognitive-complexity,\
-readability-implicit-bool-conversion,\
-readability-isolate-declaration,\
-readability-magic-numbers,\
-readability-make-member-function-const,\
-readability-named-parameter,\
-readability-qualified-auto,\
-readability-redundant-access-specifiers,\
-readability-use-anyofallof,\
"
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test|tools).*'
Expand Down
20 changes: 18 additions & 2 deletions .github/CONTRIBUTING.md
Expand Up @@ -2,12 +2,28 @@

**Opening a new issue?** Please read [ISSUES.md](../ISSUES.md) first.

Contributing to Cataclysm: Dark Days Ahead is easy — simply fork the repository here on GitHub, make your changes, and then send us a pull request.
**Want an introductory guide for creating game content?** You might want to
read the [Guide to adding new content to CDDA for first time
contributors](https://github.com/CleverRaven/Cataclysm-DDA/wiki/Guide-to-adding-new-content-to-CDDA-for-first-time-contributors)
on the CDDA wiki.

Cataclysm:Dark Days Ahead is released under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See http://creativecommons.org/licenses/by-sa/3.0/ for details.
This means any contribution you make to the project will also be covered by the same license, and this license is irrevocable.

## Guidelines
## Using a good text editor

Most of the Cataclysm: Dark Days Ahead game data is defined in JSON files.
These files are intended to be easy for you to edit, but there are some
pitfalls. Using Windows Notepad can get you into trouble, because it likes to
insert a special character called a BOM at the start of the file, which CDDA
does not want.

If you're going to be editing JSON files consider getting a more fully-featured
editor such as [Notepad++](https://notepad-plus-plus.org/).

## Contributing to GitHub

Contributing to Cataclysm: Dark Days Ahead is easy — simply fork the repository here on GitHub, make your changes, and then send us a pull request.

There are a couple of guidelines we suggest sticking to:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/CBA.yml
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- 0.F-dev
paths:
- '**.cpp'
- '**.h'
Expand All @@ -16,6 +17,7 @@ on:
pull_request:
branches:
- master
- 0.F-dev
paths:
- '**.cpp'
- '**.h'
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/clang-tidy.yml
@@ -1,9 +1,10 @@
name: Clang-tidy (clang-8, tiles)
name: Clang-tidy (clang-12, tiles)

on:
push:
branches:
- master
- 0.F-dev
paths:
- '**.cpp'
- '**.h'
Expand All @@ -15,6 +16,7 @@ on:
pull_request:
branches:
- master
- 0.F-dev
paths:
- '**.cpp'
- '**.h'
Expand All @@ -26,11 +28,11 @@ on:

jobs:
build:
runs-on: ubuntu-16.04
runs-on: ubuntu-20.04
env:
CMAKE: 1
CLANG: clang++-8
COMPILER: clang++-8
CLANG: clang++-12
COMPILER: clang++-12
CATA_CLANG_TIDY: plugin
TILES: 1
SOUND: 1
Expand All @@ -41,9 +43,10 @@ jobs:
fetch-depth: 1
- name: install dependencies
run: |
#sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main"
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-8 libclang-8-dev llvm-8-dev llvm-8-tools \
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
- name: prepare
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cmake-format.yml
Expand Up @@ -4,13 +4,15 @@ on:
push:
branches:
- master
- 0.F-dev
paths:
- '**/CMakeLists.txt'
- '**.cmake'
- '**.cmake.in'
pull_request:
branches:
- master
- 0.F-dev
paths:
- '**/CMakeLists.txt'
- '**.cmake'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/flake8.yml
Expand Up @@ -4,11 +4,13 @@ on:
push:
branches:
- master
- 0.F-dev
paths:
- '**.py'
pull_request:
branches:
- master
- 0.F-dev
paths:
- '**.py'

Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/matrix.yml
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- 0.F-dev
paths-ignore:
- 'android/**'
- 'build-data/osx/**'
Expand All @@ -18,6 +19,7 @@ on:
pull_request:
branches:
- master
- 0.F-dev
paths-ignore:
- 'android/**'
- 'build-data/osx/**'
Expand Down Expand Up @@ -71,16 +73,27 @@ jobs:
tiles: 1
native: osx
title: Clang 12, macOS 10.15, Tiles
- compiler: g++
os: ubuntu-latest
cmake: 0
tiles: 1
title: GCC, Ubuntu cross-compile to MinGW-Win64, Tiles
ldflags: -static-libgcc -static-libstdc++
mxe_target: i686-w64-mingw32.static
wine: wine
name: ${{ matrix.title }}
runs-on: ${{ matrix.os }}
env:
CMAKE: ${{ matrix.cmake }}
COMPILER: ${{ matrix.compiler }}
MXE_TARGET: ${{ matrix.mxe_target }}
WINE: ${{ matrix.wine }}
OS: ${{ matrix.os }}
TILES: ${{ matrix.tiles }}
SOUND: ${{ matrix.tiles }}
SANITIZE: ${{ matrix.sanitize }}
TEST_STAGE: ${{ matrix.test-stage }}
LDFLAGS: ${{ matrix.ldflags }}
EXTRA_TEST_OPTS: --error-format=github-action
NATIVE: ${{ matrix.native }}
GOLD: ${{ matrix.gold }}
Expand Down Expand Up @@ -132,8 +145,9 @@ jobs:
- name: build and test
run: bash ./build-scripts/build.sh
- name: upload artifacts if failed
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
if: failure()
with:
name: cata_test
path: tests/cata_test
if-no-files-found: ignore
1 change: 1 addition & 0 deletions .github/workflows/pr-validator.yml
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- master
- 0.F-dev
types: [opened, edited, synchronize]
jobs:
validate:
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -27,7 +27,7 @@ os: linux
branches:
only:
- master
- development
- 0.F-dev

# Overall strategy for what sorts of builds to include:
# We want a build for each compiler and each platform.
Expand Down Expand Up @@ -99,7 +99,8 @@ jobs:
- stage: "Platforms and Tidy"
# MXE variant using alternate repository http://mirror.mxe.cc/repos/apt
env: COMPILER=g++ LDFLAGS="-static-libgcc -static-libstdc++" MXE_TARGET="i686-w64-mingw32.static" WINE="wine" TILES=1 SOUND=1
name: "Mingw-w64 Make cross-compile to Windows with Tiles and Sound"
name: "MinGW-Win64 Make cross-compile to Windows with Tiles and Sound"
if: type != pull_request
compiler: gcc
addons: &gcc
apt:
Expand Down
22 changes: 13 additions & 9 deletions build-scripts/build.sh
Expand Up @@ -71,16 +71,16 @@ then
cmake_extra_opts+=("-DCATA_CLANG_TIDY_PLUGIN=ON")
# Need to specify the particular LLVM / Clang versions to use, lest it
# use the llvm-7 that comes by default on the Travis Xenial image.
cmake_extra_opts+=("-DLLVM_DIR=/usr/lib/llvm-8/lib/cmake/llvm")
cmake_extra_opts+=("-DClang_DIR=/usr/lib/llvm-8/lib/cmake/clang")
cmake_extra_opts+=("-DLLVM_DIR=/usr/lib/llvm-12/lib/cmake/llvm")
cmake_extra_opts+=("-DClang_DIR=/usr/lib/llvm-12/lib/cmake/clang")
fi

if [ "$COMPILER" = "clang++-8" -a -n "$GITHUB_WORKFLOW" -a -n "$CATA_CLANG_TIDY" ]
if [ "$COMPILER" = "clang++-12" -a -n "$GITHUB_WORKFLOW" -a -n "$CATA_CLANG_TIDY" ]
then
# This is a hacky workaround for the fact that the custom clang-tidy we are
# using is built for Travis CI, so it's not using the correct include directories
# for GitHub workflows.
cmake_extra_opts+=("-DCMAKE_CXX_FLAGS=-isystem /usr/include/clang/8.0.0/include")
cmake_extra_opts+=("-DCMAKE_CXX_FLAGS=-isystem /usr/include/clang/12.0.0/include")
fi

mkdir build
Expand Down Expand Up @@ -195,11 +195,15 @@ else

if [ -n "$TEST_STAGE" ]
then
# Run the tests one more time, without actually running any tests, just to verify that all
# the mod data can be successfully loaded

mods="$(./build-scripts/get_all_mods.py)"
run_test './tests/cata_test --user-dir=all_modded --mods='"${mods}" '~*' ''
# Run the tests with all the mods, without actually running any tests,
# just to verify that all the mod data can be successfully loaded.
# Because some mods might be mutually incompatible we might need to run a few times.

./build-scripts/get_all_mods.py | \
while read mods
do
run_test './tests/cata_test --user-dir=all_modded --mods='"${mods}" '~*' ''
done
fi
fi
ccache --show-stats
Expand Down

0 comments on commit 45348a5

Please sign in to comment.