-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79631 from moxian/iwyu-l-27
Run codebase through IWYU and add a CI check. ~7-10% improvements to build times.
- Loading branch information
Showing
681 changed files
with
3,911 additions
and
1,994 deletions.
There are no files selected for viewing
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,69 @@ | ||
name: IWYU (include-what-you-use) | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'tools/iwyu/**' | ||
- '**/CMakeLists.txt' | ||
- '.github/workflows/iwyu.yml' | ||
|
||
# We only care about the latest revision of a PR, so cancel all previous instances. | ||
concurrency: | ||
group: iwyu-${{ github.event.pull_request.number || github.ref_name }} | ||
cancel-in-progress: true | ||
jobs: | ||
run: | ||
runs-on: ubuntu-24.04 | ||
env: | ||
COMPILER: clang++-19 | ||
steps: | ||
- name: install LLVM 19 | ||
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' && github.event_name != 'pull_request' || github.event.pull_request.draft == false }} | ||
run: | | ||
sudo apt install llvm-19 llvm-19-dev llvm-19-tools clang-19 clang-tidy-19 clang-tools-19 libclang-19-dev | ||
sudo apt install python3-pip ninja-build cmake | ||
- name: checkout IWYU repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: include-what-you-use/include-what-you-use | ||
path: include-what-you-use-src | ||
ref: clang_19 | ||
- name: checkout own repository | ||
uses: actions/checkout@v4 | ||
with: | ||
path: Cataclysm-DDA | ||
- name: build IWYU | ||
id: build-iwyu | ||
run: | | ||
cmake -B iwyu-build -DCMAKE_PREFIX_PATH=/usr/lib/llvm-19 include-what-you-use-src | ||
cmake --build iwyu-build --parallel 4 | ||
echo "IWYU_SRC_DIR=${PWD}/include-what-you-use-src">> "$GITHUB_OUTPUT" | ||
echo "IWYU_BIN_DIR=${PWD}/iwyu-build/bin">> "$GITHUB_OUTPUT" | ||
- uses: ammaraskar/gcc-problem-matcher@master | ||
- name: create CDDA compilation database | ||
run: | | ||
cmake -B Cataclysm-DDA/build \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-DCMAKE_CXX_COMPILER=$COMPILER \ | ||
-DCMAKE_BUILD_TYPE="Release" \ | ||
-DTILES=${TILES:-0} \ | ||
-DSOUND=${SOUND:-0} \ | ||
-DLOCALIZE=${LOCALIZE:-0} \ | ||
Cataclysm-DDA | ||
- name: run the thing | ||
env: | ||
IWYU_SRC_DIR: ${{ steps.build-iwyu.outputs.IWYU_SRC_DIR }} | ||
IWYU_BIN_DIR: ${{ steps.build-iwyu.outputs.IWYU_BIN_DIR }} | ||
run: | | ||
PATH="${PATH}:${IWYU_BIN_DIR}" | ||
cd Cataclysm-DDA | ||
FILES_LIST=$( find src/ tests/ -maxdepth 1 -name '*.cpp' | grep -v -f tools/iwyu/bad_files.txt | sort ) | ||
python ${IWYU_SRC_DIR}/iwyu_tool.py ${FILES_LIST} -p build --output-format clang --jobs 4 -- -Xiwyu "--mapping_file=${PWD}/tools/iwyu/cata.imp" -Xiwyu --cxx17ns -Xiwyu --comment_style=long -Xiwyu --max_line_length=1000 |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
#include <algorithm> | ||
#include <numeric> | ||
#include <string> | ||
#include <utility> | ||
|
||
#include "item.h" | ||
|
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
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
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
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 |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
|
||
class Creature; | ||
class JsonObject; | ||
class anatomy; | ||
|
||
/** | ||
* A structure that contains body parts. | ||
|
Oops, something went wrong.