From 823a45d7c1afc9f38e8ba6c5e52ec0a6e5048daa Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 17 Sep 2024 23:27:12 +0200 Subject: [PATCH] tools: ditch iwyu --- .pre-commit-config.yaml | 6 ++++++ CONTRIBUTING.md | 6 ++---- src/game/clock.c | 1 - src/game/game_string.c | 2 -- src/specific/s_fmv.c | 2 -- subprojects/libtrx | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8023ff509..52a3f03a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,3 +19,9 @@ repos: entry: tools/additional_lint language: python stages: [commit] + + - id: imports + name: imports + entry: tools/sort_imports + language: system + files: \.[ch](pp)?$ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 707f3bd4c..d01a4122b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -71,9 +71,7 @@ will be always considered supplementary. This project uses [pre-commit](https://pre-commit.com/) to make sure the code is formatted the right way. This tool has additional external dependencies: -`clang-format` for automatic code formatting and `include-what-you-use` to -remove unused `#include`s. -To install pre-commit: +`clang-format` for automatic code formatting. To install pre-commit: ``` python3 -m pip install --user pre-commit @@ -83,7 +81,7 @@ pre-commit install To install required external dependencies on Ubuntu: ``` -apt-get install -y iwyu clang-format-18 +apt-get install -y clang-format-18 ``` After this, each time you make a commit a hook should trigger to automatically diff --git a/src/game/clock.c b/src/game/clock.c index ad51882e6..c29027496 100644 --- a/src/game/clock.c +++ b/src/game/clock.c @@ -1,4 +1,3 @@ -// IWYU pragma: no_include #include "game/clock.h" #include "config.h" diff --git a/src/game/game_string.c b/src/game/game_string.c index 264a97ff3..aff8bd572 100644 --- a/src/game/game_string.c +++ b/src/game/game_string.c @@ -4,9 +4,7 @@ void GameString_Init(void) { - // IWYU pragma: begin_keep #include "game_string.def" - // IWYU pragma: end_keep } void GameString_Shutdown(void) diff --git a/src/specific/s_fmv.c b/src/specific/s_fmv.c index 5cbc7d536..5d081ba33 100644 --- a/src/specific/s_fmv.c +++ b/src/specific/s_fmv.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -// IWYU pragma: no_include - #include "specific/s_fmv.h" #include "config.h" diff --git a/subprojects/libtrx b/subprojects/libtrx index 0d395b79e..c1f3ab51a 160000 --- a/subprojects/libtrx +++ b/subprojects/libtrx @@ -1 +1 @@ -Subproject commit 0d395b79ec7cea7afd40fe241a535b3bb48602a6 +Subproject commit c1f3ab51a07bd8ff93f975b3112830f838147a21