forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
- Loading branch information
Showing
965 changed files
with
333,650 additions
and
239,164 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: v1 | ||
|
||
labels: | ||
- label: "<Enhancement / Feature>" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Features +\".+\"\\s*(\n|$)" | ||
|
||
- label: "Info / User Interface" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Interface +\".+\"\\s*(\n|$)" | ||
|
||
- label: "Mods" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Mods +\".+\"\\s*(\n|$)" | ||
|
||
- label: "Game: Balance" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Balance +\".+\"\\s*(\n|$)" | ||
|
||
- label: "<Bugfix>" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Bugfixes +\".+\"\\s*(\n|$)" | ||
|
||
- label: "Code: Performance" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Performance +\".+\"\\s*(\n|$)" | ||
|
||
- label: "Code: Infrastructure / Style / Static Analysis" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Infrastructure +\".+\"\\s*(\n|$)" | ||
|
||
- label: "Code: Build" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*Build +\".+\"\\s*(\n|$)" | ||
|
||
- label: "Translation" | ||
matcher: | ||
body: "(\\s|^)#### Summary\\s*I18N +\".+\"\\s*(\n|$)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Summary Labeler | ||
|
||
on: | ||
- pull_request_target | ||
|
||
jobs: | ||
uses: | ||
name: labeler | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: fuxingloh/multi-labeler@main | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
config-path: '.github/summary-labels.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/bin/bash | ||
|
||
# Shell script intended for clang-tidy check | ||
|
||
echo "Using bash version $BASH_VERSION" | ||
set -exo pipefail | ||
|
||
num_jobs=3 | ||
|
||
# We might need binaries installed via pip, so ensure that our personal bin dir is on the PATH | ||
export PATH=$HOME/.local/bin:$PATH | ||
|
||
if [ "$RELEASE" = "1" ] | ||
then | ||
build_type=MinSizeRel | ||
else | ||
build_type=Debug | ||
fi | ||
|
||
cmake_extra_opts=() | ||
|
||
if [ "$CATA_CLANG_TIDY" = "plugin" ] | ||
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-12/lib/cmake/llvm") | ||
cmake_extra_opts+=("-DClang_DIR=/usr/lib/llvm-12/lib/cmake/clang") | ||
fi | ||
|
||
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/12.0.0/include") | ||
fi | ||
|
||
mkdir -p build | ||
cd build | ||
cmake \ | ||
-DBACKTRACE=ON \ | ||
${COMPILER:+-DCMAKE_CXX_COMPILER=$COMPILER} \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-DCMAKE_BUILD_TYPE="$build_type" \ | ||
-DTILES=${TILES:-0} \ | ||
-DSOUND=${SOUND:-0} \ | ||
"${cmake_extra_opts[@]}" \ | ||
.. | ||
|
||
if [ "$CATA_CLANG_TIDY" = "plugin" ] | ||
then | ||
make -j$num_jobs CataAnalyzerPlugin | ||
export PATH=$PWD/tools/clang-tidy-plugin/clang-tidy-plugin-support/bin:$PATH | ||
if ! which FileCheck | ||
then | ||
ls -l tools/clang-tidy-plugin/clang-tidy-plugin-support/bin | ||
ls -l /usr/bin | ||
echo "Missing FileCheck" | ||
exit 1 | ||
fi | ||
CATA_CLANG_TIDY=clang-tidy | ||
lit -v tools/clang-tidy-plugin/test | ||
fi | ||
|
||
"$CATA_CLANG_TIDY" --version | ||
|
||
# Show compiler C++ header search path | ||
${COMPILER:-clang++} -v -x c++ /dev/null -c | ||
# And the same for clang-tidy | ||
"$CATA_CLANG_TIDY" ../src/version.cpp -- -v | ||
|
||
# Run clang-tidy analysis instead of regular build & test | ||
# We could use CMake to create compile_commands.json, but that's super | ||
# slow, so use compiledb <https://github.com/nickdiego/compiledb> | ||
# instead. | ||
compiledb -n make | ||
|
||
cd .. | ||
rm -f compile_commands.json && ln -s build/compile_commands.json | ||
|
||
# We want to first analyze all files that changed in this PR, then as | ||
# many others as possible, in a random order. | ||
set +x | ||
all_cpp_files="$( \ | ||
grep '"file": "' build/compile_commands.json | \ | ||
sed "s+.*$PWD/++;s+\"$++")" | ||
changed_files="$( ( test -f ./files_changed && cat ./files_changed ) || echo unknown )" | ||
changed_cpp_files="$( \ | ||
echo "$changed_files" | grep -F "$all_cpp_files" || true )" | ||
if [ -n "$changed_cpp_files" ] | ||
then | ||
remaining_cpp_files="$( \ | ||
echo "$all_cpp_files" | grep -v -F "$changed_cpp_files" || true )" | ||
else | ||
remaining_cpp_files="$all_cpp_files" | ||
fi | ||
|
||
function analyze_files_in_random_order | ||
{ | ||
if [ -n "$1" ] | ||
then | ||
echo "$1" | shuf | \ | ||
xargs -P "$num_jobs" -n 1 ./build-scripts/clang-tidy-wrapper.sh -quiet | ||
else | ||
echo "No files to analyze" | ||
fi | ||
} | ||
|
||
echo "Analyzing changed files" | ||
analyze_files_in_random_order "$changed_cpp_files" | ||
|
||
# Check for changes to any files that would require us to run clang-tidy across everything | ||
changed_global_files="$( \ | ||
echo "$changed_files" | \ | ||
egrep -i "\.h$|clang-tidy|build-scripts|cmake|unknown" || true )" | ||
if [ -n "$changed_global_files" ] | ||
then | ||
first_changed_file="$(echo "$changed_global_files" | head -n 1)" | ||
echo "Analyzing remaining files because $first_changed_file was changed" | ||
analyze_files_in_random_order "$remaining_cpp_files" | ||
fi | ||
set -x |
Oops, something went wrong.