Skip to content

Commit

Permalink
fix: Document and fix IWYU (#2765)
Browse files Browse the repository at this point in the history
adding some documentation and fix the params
  • Loading branch information
andiwand authored Dec 5, 2023
1 parent 07e829d commit 707800c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
-DACTS_BUILD_EXAMPLES_EDM4HEP=ON
- name: Run IWYU
run: python3 iwyu-install/bin/iwyu_tool.py -p acts-build/ -j2 -- --mapping_file=acts/CI/iwyu/mapping.imp | tee iwyu-output.txt
run: python3 iwyu-install/bin/iwyu_tool.py -p acts-build/ -j2 -- -Xiwyu --mapping_file=acts/CI/iwyu/mapping.imp | tee iwyu-output.txt
- name: Filter IWYU output
run: python3 acts/CI/iwyu/filter.py acts/CI/iwyu/filter.yaml iwyu-output.txt iwyu-filtered.txt
- name: Apply IWYU
Expand Down
16 changes: 16 additions & 0 deletions CI/iwyu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# IWYU = Include what you use

This tool finds unused includes and suggestes additional includes and declarations.

It is not very stable at the moment and takes a few hours to complete within ACTS therefor it only runs once a week and can be triggered manually.

There is also not sufficient filtering offered by IWYU at the moment. For that reason there is a specific filtering script for now which tries to get rid of unwanted changes.

offline resources
- [GitHub Actions Workflow](../../.github/workflows/iwyu.yml)
- [Custom filter script](./filter.py)

online resources

- https://include-what-you-use.org/
- https://github.com/include-what-you-use/include-what-you-use
6 changes: 3 additions & 3 deletions CI/iwyu/filter.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
remove_lines:
# ignore unexiting std
# ignore if not existing in std
- "^#include <new>"
- "^#include <bits/"
- "^#include <ext/"
Expand All @@ -8,7 +8,7 @@ remove_lines:
- "namespace Eigen {"
# ignore boost
- "^(- )?#include <boost/"
# don remove ipp
# don't remove ipp
- "^- #include [<\"].*\\.ipp"
# ignore pybind11
- "^(- )?#include <pybind11/"
Expand All @@ -21,7 +21,7 @@ replace_lines:
- "^#include <unistd\\.h>": "#include <cunistd>"
- "^#include <stdint\\.h>": "#include <cstdint>"
- "^#include <stdlib.h>": "#include <cstdlib>"
# don use ipp
# don't use ipp
- "^#include ([<\"].*)\\.ipp": "#include \\1.hpp"

ignore_files:
Expand Down

0 comments on commit 707800c

Please sign in to comment.