diff options
-rw-r--r-- | Makefile | 9 | ||||
-rwxr-xr-x | src/clint.py | 20 | ||||
-rw-r--r-- | src/nvim/api/deprecated.h | 4 | ||||
-rw-r--r-- | src/nvim/api/private/converter.h | 4 | ||||
-rw-r--r-- | src/nvim/api/tabpage.h | 2 | ||||
-rw-r--r-- | src/nvim/lua/converter.h | 9 | ||||
-rw-r--r-- | src/nvim/marktree.h | 2 | ||||
-rw-r--r-- | src/nvim/os/process.h | 6 | ||||
-rw-r--r-- | src/nvim/spellsuggest.h | 2 | ||||
-rw-r--r-- | src/nvim/tui/terminfo.h | 4 | ||||
-rw-r--r-- | src/nvim/winfloat.h | 4 |
11 files changed, 25 insertions, 41 deletions
@@ -145,16 +145,12 @@ iwyu: build/.ran-cmake |src/nvim/api/autocmd.h\ |src/nvim/api/buffer.h\ |src/nvim/api/command.h\ - |src/nvim/api/deprecated.h\ |src/nvim/api/extmark.h\ - |src/nvim/api/keysets.h\ |src/nvim/api/options.h\ - |src/nvim/api/private/converter.h\ |src/nvim/api/private/defs.h\ |src/nvim/api/private/dispatch.h\ |src/nvim/api/private/helpers.h\ |src/nvim/api/private/validate.h\ - |src/nvim/api/tabpage.h\ |src/nvim/api/ui.h\ |src/nvim/api/vim.h\ |src/nvim/api/vimscript.h\ @@ -226,7 +222,6 @@ iwyu: build/.ran-cmake |src/nvim/fold_defs.h\ |src/nvim/garray.h\ |src/nvim/getchar.h\ - |src/nvim/getchar_defs.h\ |src/nvim/globals.h\ |src/nvim/grid.h\ |src/nvim/grid_defs.h\ @@ -244,7 +239,6 @@ iwyu: build/.ran-cmake |src/nvim/linematch.h\ |src/nvim/log.h\ |src/nvim/lua/base64.h\ - |src/nvim/lua/converter.h\ |src/nvim/lua/executor.h\ |src/nvim/lua/secure.h\ |src/nvim/lua/spell.h\ @@ -288,7 +282,6 @@ iwyu: build/.ran-cmake |src/nvim/os/input.h\ |src/nvim/os/lang.h\ |src/nvim/os/os.h\ - |src/nvim/os/process.h\ |src/nvim/os/pty_conpty_win.h\ |src/nvim/os/pty_process_unix.h\ |src/nvim/os/pty_process_win.h\ @@ -322,7 +315,6 @@ iwyu: build/.ran-cmake |src/nvim/textformat.h\ |src/nvim/textobject.h\ |src/nvim/tui/input.h\ - |src/nvim/tui/terminfo.h\ |src/nvim/tui/tui.h\ |src/nvim/ugrid.h\ |src/nvim/ui.h\ @@ -336,7 +328,6 @@ iwyu: build/.ran-cmake |src/nvim/viml/parser/expressions.h\ |src/nvim/viml/parser/parser.h\ |src/nvim/window.h\ - |src/nvim/winfloat.h\ )" --nosafe_headers < build/iwyu.log cmake -B build -U ENABLE_IWYU cmake --build build diff --git a/src/clint.py b/src/clint.py index 6676673afc..ee2f3cc00f 100755 --- a/src/clint.py +++ b/src/clint.py @@ -890,6 +890,7 @@ def CheckIncludes(filename, lines, error): """ if filename.endswith('.c.h') or filename.endswith('.in.h') or FileInfo(filename).RelativePath() in { 'func_attr.h', + 'os/pty_process.h', }: return @@ -899,16 +900,12 @@ def CheckIncludes(filename, lines, error): "src/nvim/api/autocmd.h", "src/nvim/api/buffer.h", "src/nvim/api/command.h", - "src/nvim/api/deprecated.h", "src/nvim/api/extmark.h", - "src/nvim/api/keysets.h", "src/nvim/api/options.h", - "src/nvim/api/private/converter.h", "src/nvim/api/private/defs.h", "src/nvim/api/private/dispatch.h", "src/nvim/api/private/helpers.h", "src/nvim/api/private/validate.h", - "src/nvim/api/tabpage.h", "src/nvim/api/ui.h", "src/nvim/api/vim.h", "src/nvim/api/vimscript.h", @@ -980,7 +977,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/fold_defs.h", "src/nvim/garray.h", "src/nvim/getchar.h", - "src/nvim/getchar_defs.h", "src/nvim/globals.h", "src/nvim/grid.h", "src/nvim/grid_defs.h", @@ -998,7 +994,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/linematch.h", "src/nvim/log.h", "src/nvim/lua/base64.h", - "src/nvim/lua/converter.h", "src/nvim/lua/executor.h", "src/nvim/lua/secure.h", "src/nvim/lua/spell.h", @@ -1042,7 +1037,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/os/input.h", "src/nvim/os/lang.h", "src/nvim/os/os.h", - "src/nvim/os/process.h", "src/nvim/os/pty_conpty_win.h", "src/nvim/os/pty_process_unix.h", "src/nvim/os/pty_process_win.h", @@ -1076,7 +1070,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/textformat.h", "src/nvim/textobject.h", "src/nvim/tui/input.h", - "src/nvim/tui/terminfo.h", "src/nvim/tui/tui.h", "src/nvim/ugrid.h", "src/nvim/ui.h", @@ -1090,7 +1083,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/viml/parser/expressions.h", "src/nvim/viml/parser/parser.h", "src/nvim/window.h", - "src/nvim/winfloat.h", ] for i in check_includes_ignore: @@ -1098,10 +1090,12 @@ def CheckIncludes(filename, lines, error): return for i, line in enumerate(lines): - if("#include" in line): - if("#include <" in line): - continue - if "_defs" not in line: + matched = Match(r'#\s*include\s*"([^"]*)"$', line) + if matched: + name = matched.group(1) + if (not name.endswith('.h.generated.h') and + not name.endswith('_defs.h') and + not name.endswith('/defs.h')): error(filename, i, 'build/include_defs', 5, 'Headers should not include non-"_defs" headers') diff --git a/src/nvim/api/deprecated.h b/src/nvim/api/deprecated.h index 5541a4dac3..e20d8304e0 100644 --- a/src/nvim/api/deprecated.h +++ b/src/nvim/api/deprecated.h @@ -1,8 +1,8 @@ #pragma once -#include <stdint.h> +#include <stdint.h> // IWYU pragma: keep -#include "nvim/api/private/defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/deprecated.h.generated.h" diff --git a/src/nvim/api/private/converter.h b/src/nvim/api/private/converter.h index 47e1d5a6bb..fc82abf332 100644 --- a/src/nvim/api/private/converter.h +++ b/src/nvim/api/private/converter.h @@ -1,7 +1,7 @@ #pragma once -#include "nvim/api/private/defs.h" -#include "nvim/eval/typval_defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep +#include "nvim/eval/typval_defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/converter.h.generated.h" diff --git a/src/nvim/api/tabpage.h b/src/nvim/api/tabpage.h index b9357df10a..2f19845bd9 100644 --- a/src/nvim/api/tabpage.h +++ b/src/nvim/api/tabpage.h @@ -1,6 +1,6 @@ #pragma once -#include "nvim/api/private/defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/tabpage.h.generated.h" diff --git a/src/nvim/lua/converter.h b/src/nvim/lua/converter.h index 501db36dbe..a502df80d9 100644 --- a/src/nvim/lua/converter.h +++ b/src/nvim/lua/converter.h @@ -1,12 +1,9 @@ #pragma once -#include <lua.h> -#include <stdbool.h> -#include <stdint.h> +#include <lua.h> // IWYU pragma: keep -#include "nvim/api/private/defs.h" -#include "nvim/eval/typval_defs.h" -#include "nvim/func_attr.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep +#include "nvim/eval/typval_defs.h" // IWYU pragma: keep #define nlua_pop_Buffer nlua_pop_handle #define nlua_pop_Window nlua_pop_handle diff --git a/src/nvim/marktree.h b/src/nvim/marktree.h index 3e714bc196..bf653ee564 100644 --- a/src/nvim/marktree.h +++ b/src/nvim/marktree.h @@ -13,7 +13,7 @@ #include "nvim/pos.h" #include "nvim/types.h" // only for debug functions: -#include "api/private/defs.h" +#include "nvim/api/private/defs.h" struct mtnode_s; diff --git a/src/nvim/os/process.h b/src/nvim/os/process.h index 61a5009fd8..3b116b4bad 100644 --- a/src/nvim/os/process.h +++ b/src/nvim/os/process.h @@ -1,8 +1,10 @@ #pragma once -#include <stddef.h> +#include <stddef.h> // IWYU pragma: keep -#include "nvim/api/private/defs.h" +#ifdef MSWIN +# include "nvim/api/private/defs.h" // IWYU pragma: keep +#endif #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/process.h.generated.h" diff --git a/src/nvim/spellsuggest.h b/src/nvim/spellsuggest.h index 0100e44b07..40e51a0f88 100644 --- a/src/nvim/spellsuggest.h +++ b/src/nvim/spellsuggest.h @@ -1,6 +1,6 @@ #pragma once -#include "nvim/garray_defs.h" // IWYU pragma: export +#include "nvim/garray_defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "spellsuggest.h.generated.h" diff --git a/src/nvim/tui/terminfo.h b/src/nvim/tui/terminfo.h index f435926dd7..039c722d25 100644 --- a/src/nvim/tui/terminfo.h +++ b/src/nvim/tui/terminfo.h @@ -1,8 +1,8 @@ #pragma once -#include <unibilium.h> +#include <unibilium.h> // IWYU pragma: keep -#include "nvim/api/private/defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tui/terminfo.h.generated.h" diff --git a/src/nvim/winfloat.h b/src/nvim/winfloat.h index c66f897ec0..876ea9ccea 100644 --- a/src/nvim/winfloat.h +++ b/src/nvim/winfloat.h @@ -1,7 +1,7 @@ #pragma once -#include "nvim/api/private/defs.h" -#include "nvim/buffer_defs.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep +#include "nvim/buffer_defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "winfloat.h.generated.h" |