Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse committed Jul 3, 2021
2 parents d1402eb + 0f172bb commit bd086de
Show file tree
Hide file tree
Showing 1,151 changed files with 86,957 additions and 73,708 deletions.
69 changes: 53 additions & 16 deletions .clang-tidy
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
6 changes: 5 additions & 1 deletion .github/workflows/CBA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- 0.F-dev
paths:
- '**.cpp'
- '**.h'
Expand All @@ -12,9 +13,11 @@ on:
- '**/Makefile'
- '**.hpp'
- '**.cmake'
- '.github/workflows/CBA.yml'
pull_request:
branches:
- master
- 0.F-dev
paths:
- '**.cpp'
- '**.h'
Expand All @@ -23,6 +26,7 @@ on:
- '**/Makefile'
- '**.hpp'
- '**.cmake'
- '.github/workflows/CBA.yml'


jobs:
Expand Down Expand Up @@ -51,7 +55,7 @@ jobs:
- name: make
run: |
ClangBuildAnalyzer --start .
CLANG=clang++-9 CXXFLAGS=-ftime-trace make
CLANG=clang++-10 CXXFLAGS=-ftime-trace make
ClangBuildAnalyzer --stop . buildAnalysis
- name: Analyze
run: ClangBuildAnalyzer --analyze buildAnalysis
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/check-translation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check printf format string in translations

on:
pull_request:
paths:
- 'lang/po/*.po'
- 'tools/check_po_printf_format.py'

jobs:
check-po-printf:
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install polib
- name: "Checkout"
uses: actions/checkout@v2
- name: "Check printf format string in translations"
run: ./tools/check_po_printf_format.py
13 changes: 7 additions & 6 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Clang-tidy (clang-8, tiles)
name: Clang-tidy (clang-12, tiles)

on:
push:
Expand Down Expand Up @@ -28,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 @@ -43,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
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master, 0.8-branch, 0.9-branch, 0.A-branch, 0.B-branch, 0.C-branch, 0.D-branch, 0.E-branch, gh-pages ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '31 12 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

- run: |
make RELEASE=1 RUNTESTS=0
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
18 changes: 15 additions & 3 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,40 @@ jobs:
sanitize: address
native: linux64
title: GCC 8, Ubuntu, Tiles, ASan
- compiler: clang++-9
- compiler: clang++-12
os: ubuntu-latest
cmake: 0
tiles: 1
sanitize: address,undefined
native: linux64
title: Clang 9, Ubuntu, Tiles, ASan, UBSan
title: Clang 12, Ubuntu, Tiles, ASan, UBSan
- compiler: clang++
os: macos-10.15
cmake: 0
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 @@ -134,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
Loading

0 comments on commit bd086de

Please sign in to comment.