Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerin-of-the-Toast committed Mar 24, 2022
2 parents 8f0b0d5 + 543b040 commit 21b951d
Show file tree
Hide file tree
Showing 1,869 changed files with 799,043 additions and 553,827 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Feature Request ✨
description: Suggest an idea or this project
description: Suggest an idea for this project

body:
- type: markdown
Expand Down
65 changes: 65 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
"[C++]":
- "**/*.cpp"
- "**/*.h"

"[JSON]":
- "**/*.json"

"[Python]":
- "**/*.py"

"<Documentation>":
- "**/*.md"
- doc/**/*

"Code: Tooling":
- tools/**/*

"Code: Tests":
- tests/**/*

"NPC / Factions":
- data/json/npcs/**/*

"Bionics":
- "data/json/bionics.json"

"Player Faction Base / Camp":
- "src/basecamp.(cpp|h)"
- data/json/mapgen/basecamps/**/*

"Items: Ammo / Guns":
- data/json/items/gun/**/*
- data/json/items/ammo/**/*

"SDL: Tiles / Sound":
- gfx/**/*
- sound/**/*

"Translation":
- lang/**/*

"Mods: Aftershock":
- data/mods/Aftershock/**/*
- data/mods/aftershock_exoplanet/**/*

"Mods: Dark Days of the Dead":
- data/mods/classic_zombies/**/*

"Mods: Dark Skies":
- data/mods/Dark-Skies-Above/**/*

"Mods: Dinoclysm":
- data/mods/DinoMod/**/*

"Mods: Generic Guns":
- data/mods/Generic_Guns/**/*

"Mods: MMA":
- data/mods/MMA/**/*

"Mods: Magiclysm":
- data/mods/Magiclysm/**/*

"Mods: No Hope":
- data/mods/No_Hope/**/*
12 changes: 12 additions & 0 deletions .github/workflows/assign_mission_target_needs_om_special.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Detect missions that are missing .start.assign_mission_target.om_special

on: pull_request

jobs:
run-the-tool:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- run: ./tools/json_tools/assign_mission_target_needs_om_special.bash 2>&1
2 changes: 1 addition & 1 deletion .github/workflows/astyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ jobs:
- name: Display Corrections
if: failure()
run: |
make astyle
make astyle-fast
git diff
61 changes: 61 additions & 0 deletions .github/workflows/detect-translation-file-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Detect translation file changes


on:
pull_request:
branches:
- master
paths:
- lang/po/*.po
- lang/po/*.pot


jobs:
detect-translation-file-changes:
runs-on: ubuntu-latest
steps:
- name: "Detect translation file changes"
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const skip_phrase = 'Translation file changes are intended';
if (context.payload.pull_request.body.includes(skip_phrase)) {
console.log('PR body contains skip phrase. Exiting.');
return;
}
core.setFailed('Translation file changes detected, but a skip phrase is not found in the PR body.')
console.log(
'Fetching comments of pull request %d of repository %s/%s.',
context.issue.number, context.repo.owner, context.repo.repo
);
const comments = await github.paginate(
github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
}
);
const body = 'It appears you modified a `.po` or `.pot` file. '
+ 'These translation files are automatically generated, '
+ 'pushed to, and pulled from Transifex, and should not be '
+ 'modified otherwise. If these changes are intended, please '
+ 'add `' + skip_phrase + '` to the '
+ 'PR body.';
const bot_comments = comments.filter(
comment => comment.user.type === 'Bot'
&& comment.user.login === 'github-actions[bot]'
&& comment.body === body
);
if (bot_comments.length > 0) {
console.log('Comment already exists. Exiting.');
return;
}
console.log('Posting comment.');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
13 changes: 13 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# I don't want no bot removing stuff for me
sync-labels: ""
2 changes: 1 addition & 1 deletion .github/workflows/msvc-full-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
# run-vcpkg tries to hash vcpkg.json but complans if it finds more than one.
# That said, we also have our custom vcpkg_triplets to hash, so we keep everything the same.
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-x64
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-x64-1
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/object_creator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
with:
# run-vcpkg tries to hash vcpkg.json but complans if it finds more than one.
# That said, we also have our custom vcpkg_triplets to hash, so we keep everything the same.
appendedCacheKey: ${{ hashFiles( '$msvc-full-features/vcpkg.json', 'msvc-object_creator/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-x64
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', 'msvc-object_creator/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-x64-1
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
- name: "Validate SUMMARY"
uses: CleverRaven/pr-validator@master
with:
description-regex: '(\n|^)#### Summary\s+`{0,3}(SUMMARY:\s+)?(None|((Features|Content|Interface|Mods|Balance|Bugfixes|Performance|Infrastructure|Build|I18N) +".*"))`{0,3}\s*(\n|$)'
description-regex: '(\n|^)#### Summary\s+`{0,3}(SUMMARY:\s+)?(None|((Features|Content|Interface|Mods|Balance|Bugfixes|Performance|Infrastructure|Build|I18N) +".+"))`{0,3}\s*(\n|$)'
description-regex-flags: 'i'
4 changes: 2 additions & 2 deletions .github/workflows/pull-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: "Pull translations"
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: tx pull
run: tx pull --force
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
Expand All @@ -34,5 +34,5 @@ jobs:
delete-branch: true
base: master
title: Routine i18n updates on ${{ steps.current-date.outputs.formattedTime }}
body: "#### Summary\nNone"
body: "#### Summary\nNone\n\n#### Additional context\n`Translation file changes are intended`"
labels: Translation
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
uses: lukka/run-vcpkg@v10
id: runvcpkg
with:
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-${{ matrix.arch }}-2
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-${{ matrix.arch }}-1
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
Expand All @@ -179,9 +179,7 @@ jobs:
- name: Install dependencies (windows mxe)
if: matrix.mxe != 'none'
run: |
sudo apt install astyle autoconf automake autopoint bash bison bzip2 cmake flex gettext git g++ gperf intltool \
libffi-dev libgdk-pixbuf2.0-dev libtool libltdl-dev libssl-dev libxml-parser-perl lzip make mingw-w64 openssl \
p7zip-full patch perl pkg-config python ruby scons sed unzip wget xz-utils g++-multilib libc6-dev-i386 libtool-bin
sudo apt install gettext
- name: Install MXE
if: matrix.mxe != 'none'
run: |
Expand Down
20 changes: 9 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
# make NOOPT=1
# Astyle all source files.
# make astyle
# Astyle all source files as fast as possible.
# make astyle-fast
# Check if source files are styled properly.
# make astyle-check
# Style the whitelisted json files (maintain the current level of styling).
Expand Down Expand Up @@ -731,14 +733,7 @@ ifeq ($(TILES), 1)
ODIR = $(ODIRTILES)
endif
else
ifeq ($(LOCALIZE),1)
NCURSES_PREFIX = ncursesw
else
NCURSES_PREFIX = ncurses
endif
ifdef OSXCROSS
NCURSES_PREFIX = ncurses
endif
NCURSES_PREFIX = ncursesw
# ONLY when not cross-compiling, check for pkg-config or ncurses5-config
# When doing a cross-compile, we can't rely on the host machine's -configs
ifeq ($(CROSS),)
Expand Down Expand Up @@ -1199,20 +1194,23 @@ $(ODIR)/.astyle-check-stamp: $(ASTYLE_SOURCES)

endif

astyle-fast: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $(ASTYLE_SOURCES)

astyle-all: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $(ASTYLE_SOURCES)
mkdir -p $(ODIR) && touch $(ODIR)/.astyle-check-stamp

# Test whether the system has a version of astyle that supports --dry-run
ifeq ($(shell if $(ASTYLE_BINARY) -Q -X --dry-run src/game.h > /dev/null; then echo foo; fi),foo)
ASTYLE_CHECK=$(shell $(ASTYLE_BINARY) --options=.astylerc --dry-run -X -Q --ascii $(ASTYLE_SOURCES))
ASTYLE_CHECK=$(shell $(ASTYLE_BINARY) --options=.astylerc --dry-run -X -Q --ascii $(ASTYLE_SOURCES) | sed -E "s/Formatted[[:space:]]+(.*)/Needs formatting: \1\\\n/" | tr -d '\n')
endif

astyle-check:
ifdef ASTYLE_CHECK
$(info $(ASTYLE_BINARY) -V: $(shell $(ASTYLE_BINARY) -V))
@if [ "$(findstring Formatted,$(ASTYLE_CHECK))" = "" ]; then echo "no astyle regressions";\
else printf "astyle regressions found.\n$(ASTYLE_CHECK)\n" && false; fi
@if [ "$(findstring Needs formatting:,$(ASTYLE_CHECK))" = "" ]; then echo "no astyle regressions";\
else printf "astyle regressions found.\n$(ASTYLE_CHECK)" && false; fi
else
@echo Cannot run an astyle check, your system either does not have astyle, or it is too old.
endif
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/get_all_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def print_modlist(modlist, master_list):
total_conversions = set()

for info in glob.glob('data/mods/*/modinfo.json'):
mod_info = json.load(open(info))
mod_info = json.load(open(info, encoding='utf-8'))
for e in mod_info:
if(e["type"] == "MOD_INFO" and
("obsolete" not in e or not e["obsolete"])):
Expand Down
Loading

0 comments on commit 21b951d

Please sign in to comment.