From 581b653227d2e56ce2d795c51c32ad81f2a47ae8 Mon Sep 17 00:00:00 2001 From: Dan Lapid Date: Tue, 13 Aug 2024 17:01:27 +0000 Subject: [PATCH] Fix some incorrect include statements. Replacing without reordering quote includes to angle bracket includes where appropriate. The following logic is used to find the incorrect includes: find #include "kj/ find #include "capnp/ find #include "workerd/ find #include "v8- // AND the header is in the v8 include directory find #include "openssl/ find #include ".*?/.* // Not all of these are wrong find #include c system headers // replace with --- src/workerd/api/crypto/x509.c++ | 6 +++--- src/workerd/api/gpu/gpu-adapter.c++ | 2 +- src/workerd/api/gpu/gpu-async-runner.c++ | 2 +- src/workerd/api/gpu/gpu-buffer.c++ | 4 ++-- src/workerd/api/gpu/gpu-device.c++ | 4 ++-- src/workerd/api/gpu/gpu-device.h | 2 +- src/workerd/api/gpu/gpu-query-set.c++ | 2 +- src/workerd/api/gpu/gpu-queue.c++ | 3 ++- src/workerd/api/gpu/gpu-texture-view.h | 2 +- src/workerd/api/gpu/gpu-texture.c++ | 8 ++++---- src/workerd/api/gpu/gpu-texture.h | 2 +- src/workerd/api/gpu/gpu.c++ | 2 +- src/workerd/api/html-rewriter.h | 2 +- src/workerd/api/node/i18n.h | 2 +- src/workerd/api/node/zlib-util.h | 2 +- src/workerd/api/pyodide/pyodide.c++ | 6 +++--- src/workerd/api/pyodide/pyodide.h | 6 +++--- src/workerd/api/r2-bucket.c++ | 2 +- src/workerd/api/r2-multipart.c++ | 2 +- src/workerd/api/sql.c++ | 2 +- src/workerd/api/url-standard.c++ | 2 +- src/workerd/api/web-socket.h | 2 +- src/workerd/io/compatibility-date.c++ | 2 +- src/workerd/io/worker.c++ | 2 +- src/workerd/io/worker.h | 2 +- src/workerd/jsg/jsg.c++ | 2 +- src/workerd/jsg/rtti-test.c++ | 2 +- src/workerd/jsg/setup.h | 2 +- src/workerd/jsg/util.c++ | 2 +- src/workerd/server/server-test.c++ | 2 +- src/workerd/server/server.c++ | 8 ++++---- src/workerd/server/v8-platform-impl.c++ | 2 +- src/workerd/tests/bench-json.c++ | 2 +- src/workerd/util/autogate.c++ | 2 +- src/workerd/util/autogate.h | 2 +- src/workerd/util/color-util.h | 4 ++-- src/workerd/util/sentry.h | 2 +- src/workerd/util/sqlite-test.c++ | 4 ++-- src/workerd/util/string-buffer-test.c++ | 2 +- src/workerd/util/symbolizer.c++ | 6 +++--- src/workerd/util/thread-scopes.h | 2 +- 41 files changed, 60 insertions(+), 59 deletions(-) diff --git a/src/workerd/api/crypto/x509.c++ b/src/workerd/api/crypto/x509.c++ index 226e65be0d6..94c41d0891e 100644 --- a/src/workerd/api/crypto/x509.c++ +++ b/src/workerd/api/crypto/x509.c++ @@ -1,8 +1,8 @@ #include "impl.h" #include "x509.h" -#include "openssl/bio.h" -#include "openssl/pem.h" -#include "openssl/x509v3.h" +#include +#include +#include KJ_DECLARE_NON_POLYMORPHIC(STACK_OF(ASN1_OBJECT)); diff --git a/src/workerd/api/gpu/gpu-adapter.c++ b/src/workerd/api/gpu/gpu-adapter.c++ index c4a86d0b7bd..a8d648a9e70 100644 --- a/src/workerd/api/gpu/gpu-adapter.c++ +++ b/src/workerd/api/gpu/gpu-adapter.c++ @@ -7,7 +7,7 @@ #include "gpu-device.h" #include "gpu-supported-features.h" #include "gpu-supported-limits.h" -#include "workerd/jsg/exception.h" +#include #define WGPU_FOR_EACH_LIMIT(X) \ X(maxTextureDimension1D) \ diff --git a/src/workerd/api/gpu/gpu-async-runner.c++ b/src/workerd/api/gpu/gpu-async-runner.c++ index 81ad90d1695..492da03a7a7 100644 --- a/src/workerd/api/gpu/gpu-async-runner.c++ +++ b/src/workerd/api/gpu/gpu-async-runner.c++ @@ -3,7 +3,7 @@ // https://opensource.org/licenses/Apache-2.0 #include "gpu-async-runner.h" -#include "workerd/io/io-context.h" +#include #include #include diff --git a/src/workerd/api/gpu/gpu-buffer.c++ b/src/workerd/api/gpu/gpu-buffer.c++ index 14982bb768e..265e527880c 100644 --- a/src/workerd/api/gpu/gpu-buffer.c++ +++ b/src/workerd/api/gpu/gpu-buffer.c++ @@ -3,8 +3,8 @@ // https://opensource.org/licenses/Apache-2.0 #include "gpu-buffer.h" -#include "workerd/jsg/exception.h" -#include "workerd/jsg/jsg.h" +#include +#include namespace workerd::api::gpu { diff --git a/src/workerd/api/gpu/gpu-device.c++ b/src/workerd/api/gpu/gpu-device.c++ index cc735957879..4c23b148529 100644 --- a/src/workerd/api/gpu/gpu-device.c++ +++ b/src/workerd/api/gpu/gpu-device.c++ @@ -14,8 +14,8 @@ #include "gpu-sampler.h" #include "gpu-texture.h" #include "gpu-utils.h" -#include "workerd/jsg/exception.h" -#include "workerd/jsg/jsg.h" +#include +#include namespace workerd::api::gpu { diff --git a/src/workerd/api/gpu/gpu-device.h b/src/workerd/api/gpu/gpu-device.h index fef7cf96c62..6d6af2e2fc2 100644 --- a/src/workerd/api/gpu/gpu-device.h +++ b/src/workerd/api/gpu/gpu-device.h @@ -20,7 +20,7 @@ #include "gpu-supported-features.h" #include "gpu-supported-limits.h" #include "gpu-texture.h" -#include "workerd/jsg/promise.h" +#include #include #include #include diff --git a/src/workerd/api/gpu/gpu-query-set.c++ b/src/workerd/api/gpu/gpu-query-set.c++ index d43b7610938..4423559576b 100644 --- a/src/workerd/api/gpu/gpu-query-set.c++ +++ b/src/workerd/api/gpu/gpu-query-set.c++ @@ -3,7 +3,7 @@ // https://opensource.org/licenses/Apache-2.0 #include "gpu-query-set.h" -#include "workerd/jsg/exception.h" +#include namespace workerd::api::gpu { diff --git a/src/workerd/api/gpu/gpu-queue.c++ b/src/workerd/api/gpu/gpu-queue.c++ index bde7cb4f12f..2bbee007256 100644 --- a/src/workerd/api/gpu/gpu-queue.c++ +++ b/src/workerd/api/gpu/gpu-queue.c++ @@ -3,7 +3,8 @@ // https://opensource.org/licenses/Apache-2.0 #include "gpu-queue.h" -#include "workerd/jsg/exception.h" +#include + namespace workerd::api::gpu { diff --git a/src/workerd/api/gpu/gpu-texture-view.h b/src/workerd/api/gpu/gpu-texture-view.h index 836250fb379..65120885777 100644 --- a/src/workerd/api/gpu/gpu-texture-view.h +++ b/src/workerd/api/gpu/gpu-texture-view.h @@ -5,7 +5,7 @@ #pragma once #include "gpu-utils.h" -#include "workerd/jsg/iterator.h" +#include #include #include #include diff --git a/src/workerd/api/gpu/gpu-texture.c++ b/src/workerd/api/gpu/gpu-texture.c++ index f54b7f131ed..b69c46517d6 100644 --- a/src/workerd/api/gpu/gpu-texture.c++ +++ b/src/workerd/api/gpu/gpu-texture.c++ @@ -3,10 +3,10 @@ // https://opensource.org/licenses/Apache-2.0 #include "gpu-texture.h" -#include "workerd/api/gpu/gpu-texture-view.h" -#include "workerd/api/gpu/gpu-utils.h" -#include "workerd/jsg/exception.h" -#include "workerd/jsg/jsg.h" +#include +#include +#include +#include namespace workerd::api::gpu { diff --git a/src/workerd/api/gpu/gpu-texture.h b/src/workerd/api/gpu/gpu-texture.h index 8e3c0a71158..827359adf23 100644 --- a/src/workerd/api/gpu/gpu-texture.h +++ b/src/workerd/api/gpu/gpu-texture.h @@ -6,7 +6,7 @@ #include "gpu-texture-view.h" #include "gpu-utils.h" -#include "workerd/jsg/iterator.h" +#include #include #include #include diff --git a/src/workerd/api/gpu/gpu.c++ b/src/workerd/api/gpu/gpu.c++ index b657d239b58..94bc6561be4 100644 --- a/src/workerd/api/gpu/gpu.c++ +++ b/src/workerd/api/gpu/gpu.c++ @@ -3,7 +3,7 @@ // https://opensource.org/licenses/Apache-2.0 #include "gpu.h" -#include "workerd/jsg/exception.h" +#include #include namespace workerd::api::gpu { diff --git a/src/workerd/api/html-rewriter.h b/src/workerd/api/html-rewriter.h index 669d99d2ac6..485051a0256 100644 --- a/src/workerd/api/html-rewriter.h +++ b/src/workerd/api/html-rewriter.h @@ -4,7 +4,7 @@ #pragma once -#include "workerd/api/http.h" +#include #include #include diff --git a/src/workerd/api/node/i18n.h b/src/workerd/api/node/i18n.h index 84939c24577..604cda5497a 100644 --- a/src/workerd/api/node/i18n.h +++ b/src/workerd/api/node/i18n.h @@ -8,7 +8,7 @@ #include #include -#include +#include struct UConverter; diff --git a/src/workerd/api/node/zlib-util.h b/src/workerd/api/node/zlib-util.h index 522deddf560..c5ec664e291 100644 --- a/src/workerd/api/node/zlib-util.h +++ b/src/workerd/api/node/zlib-util.h @@ -9,7 +9,7 @@ #include "zlib.h" #include -#include +#include namespace workerd::api::node { diff --git a/src/workerd/api/pyodide/pyodide.c++ b/src/workerd/api/pyodide/pyodide.c++ index 844fb8456a3..ad8eafc5151 100644 --- a/src/workerd/api/pyodide/pyodide.c++ +++ b/src/workerd/api/pyodide/pyodide.c++ @@ -1,9 +1,9 @@ #include "pyodide.h" #include #include -#include "kj/array.h" -#include "kj/common.h" -#include "kj/debug.h" +#include +#include +#include namespace workerd::api::pyodide { diff --git a/src/workerd/api/pyodide/pyodide.h b/src/workerd/api/pyodide/pyodide.h index 10c8635494b..f7c26493f8b 100644 --- a/src/workerd/api/pyodide/pyodide.h +++ b/src/workerd/api/pyodide/pyodide.h @@ -1,7 +1,7 @@ #pragma once -#include "kj/array.h" -#include "kj/debug.h" +#include +#include #include #include #include @@ -12,7 +12,7 @@ #include #include #include -#include "capnp/serialize.h" +#include namespace workerd::api::pyodide { diff --git a/src/workerd/api/r2-bucket.c++ b/src/workerd/api/r2-bucket.c++ index 2bb38e76f6c..2b7982fe796 100644 --- a/src/workerd/api/r2-bucket.c++ +++ b/src/workerd/api/r2-bucket.c++ @@ -7,7 +7,7 @@ #include "r2-rpc.h" #include "util.h" #include -#include +#include #include #include #include diff --git a/src/workerd/api/r2-multipart.c++ b/src/workerd/api/r2-multipart.c++ index 9d8adbb6c08..6e6d9f175e9 100644 --- a/src/workerd/api/r2-multipart.c++ +++ b/src/workerd/api/r2-multipart.c++ @@ -6,7 +6,7 @@ #include "r2-bucket.h" #include "r2-rpc.h" #include -#include +#include #include #include #include diff --git a/src/workerd/api/sql.c++ b/src/workerd/api/sql.c++ index 44f6824f56c..a744247044e 100644 --- a/src/workerd/api/sql.c++ +++ b/src/workerd/api/sql.c++ @@ -4,7 +4,7 @@ #include "sql.h" #include "actor-state.h" -#include "workerd/io/io-context.h" +#include namespace workerd::api { diff --git a/src/workerd/api/url-standard.c++ b/src/workerd/api/url-standard.c++ index 700119ebd67..648fa0da9b6 100644 --- a/src/workerd/api/url-standard.c++ +++ b/src/workerd/api/url-standard.c++ @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/workerd/api/web-socket.h b/src/workerd/api/web-socket.h index 8677397b385..5016723cbdd 100644 --- a/src/workerd/api/web-socket.h +++ b/src/workerd/api/web-socket.h @@ -9,7 +9,7 @@ #include "basics.h" #include #include -#include +#include namespace workerd { class ActorObserver; diff --git a/src/workerd/io/compatibility-date.c++ b/src/workerd/io/compatibility-date.c++ index c3eae0f4b27..bccab83df38 100644 --- a/src/workerd/io/compatibility-date.c++ +++ b/src/workerd/io/compatibility-date.c++ @@ -2,7 +2,7 @@ // Licensed under the Apache 2.0 license found in the LICENSE file or at: // https://opensource.org/licenses/Apache-2.0 -#include +#include #include "compatibility-date.h" #include "time.h" #include diff --git a/src/workerd/io/worker.c++ b/src/workerd/io/worker.c++ index c81eba23006..6ab66f56db9 100644 --- a/src/workerd/io/worker.c++ +++ b/src/workerd/io/worker.c++ @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #if _WIN32 diff --git a/src/workerd/io/worker.h b/src/workerd/io/worker.h index 618829606d4..b5ace13dda1 100644 --- a/src/workerd/io/worker.h +++ b/src/workerd/io/worker.h @@ -5,7 +5,7 @@ #pragma once // Classes to manage lifetime of workers, scripts, and isolates. -#include "workerd/util/xthreadnotifier.h" +#include #include #include #include diff --git a/src/workerd/jsg/jsg.c++ b/src/workerd/jsg/jsg.c++ index e131150eb33..fe6c39c0161 100644 --- a/src/workerd/jsg/jsg.c++ +++ b/src/workerd/jsg/jsg.c++ @@ -4,7 +4,7 @@ #include "jsg.h" #include "setup.h" -#include "workerd/jsg/util.h" +#include #include namespace workerd::jsg { diff --git a/src/workerd/jsg/rtti-test.c++ b/src/workerd/jsg/rtti-test.c++ index e9030b5d875..ef468010382 100644 --- a/src/workerd/jsg/rtti-test.c++ +++ b/src/workerd/jsg/rtti-test.c++ @@ -2,7 +2,7 @@ // Licensed under the Apache 2.0 license found in the LICENSE file or at: // https://opensource.org/licenses/Apache-2.0 -#include "workerd/jsg/jsg.h" +#include #include #include #include diff --git a/src/workerd/jsg/setup.h b/src/workerd/jsg/setup.h index 27533f7cb67..271142f2620 100644 --- a/src/workerd/jsg/setup.h +++ b/src/workerd/jsg/setup.h @@ -9,7 +9,7 @@ #include "async-context.h" #include "type-wrapper.h" #include "v8-platform-wrapper.h" -#include "v8-profiler.h" +#include #include #include #include diff --git a/src/workerd/jsg/util.c++ b/src/workerd/jsg/util.c++ index 60f7971d110..6057cc1b9f1 100644 --- a/src/workerd/jsg/util.c++ +++ b/src/workerd/jsg/util.c++ @@ -6,7 +6,7 @@ #include "setup.h" #include "ser.h" #include -#include +#include #if !_WIN32 #include diff --git a/src/workerd/server/server-test.c++ b/src/workerd/server/server-test.c++ index df4323bd786..d48221b961c 100644 --- a/src/workerd/server/server-test.c++ +++ b/src/workerd/server/server-test.c++ @@ -9,7 +9,7 @@ #include #include #include -#include +#include namespace workerd::server { namespace { diff --git a/src/workerd/server/server.c++ b/src/workerd/server/server.c++ index e158d285cc7..25c29136c57 100644 --- a/src/workerd/server/server.c++ +++ b/src/workerd/server/server.c++ @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -33,9 +33,9 @@ #include #include #include "workerd-api.h" -#include "workerd/api/pyodide/pyodide.h" -#include "workerd/io/hibernation-manager.h" -#include +#include +#include +#include namespace workerd::server { diff --git a/src/workerd/server/v8-platform-impl.c++ b/src/workerd/server/v8-platform-impl.c++ index fb185f88587..ef33657ba46 100644 --- a/src/workerd/server/v8-platform-impl.c++ +++ b/src/workerd/server/v8-platform-impl.c++ @@ -3,7 +3,7 @@ // https://opensource.org/licenses/Apache-2.0 #include "v8-platform-impl.h" -#include "kj/time.h" +#include namespace workerd::server { diff --git a/src/workerd/tests/bench-json.c++ b/src/workerd/tests/bench-json.c++ index bc538248f2c..68e2bd04080 100644 --- a/src/workerd/tests/bench-json.c++ +++ b/src/workerd/tests/bench-json.c++ @@ -6,7 +6,7 @@ #include #include #include -#include "capnp/compat/json.h" +#include #include #include diff --git a/src/workerd/util/autogate.c++ b/src/workerd/util/autogate.c++ index e21b5d916f6..20fa6ad93ce 100644 --- a/src/workerd/util/autogate.c++ +++ b/src/workerd/util/autogate.c++ @@ -5,7 +5,7 @@ #include #include #include -#include "kj/debug.h" +#include namespace workerd::util { diff --git a/src/workerd/util/autogate.h b/src/workerd/util/autogate.h index 0a7598c0d0b..d582be0e900 100644 --- a/src/workerd/util/autogate.h +++ b/src/workerd/util/autogate.h @@ -3,7 +3,7 @@ // https://opensource.org/licenses/Apache-2.0 #pragma once -#include "kj/string.h" +#include #include #include #include diff --git a/src/workerd/util/color-util.h b/src/workerd/util/color-util.h index 3d38a3029e0..2a65a04bc91 100644 --- a/src/workerd/util/color-util.h +++ b/src/workerd/util/color-util.h @@ -4,7 +4,7 @@ #pragma once -#include +#include #include namespace workerd { @@ -34,4 +34,4 @@ static ColorMode permitsColor() { } } -} +} // namespace workerd diff --git a/src/workerd/util/sentry.h b/src/workerd/util/sentry.h index 7d875a0a6e8..2b0b2790313 100644 --- a/src/workerd/util/sentry.h +++ b/src/workerd/util/sentry.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace workerd { diff --git a/src/workerd/util/sqlite-test.c++ b/src/workerd/util/sqlite-test.c++ index 5494954450b..b607c8bfdfe 100644 --- a/src/workerd/util/sqlite-test.c++ +++ b/src/workerd/util/sqlite-test.c++ @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/src/workerd/util/string-buffer-test.c++ b/src/workerd/util/string-buffer-test.c++ index 60378331457..282d8b24d17 100644 --- a/src/workerd/util/string-buffer-test.c++ +++ b/src/workerd/util/string-buffer-test.c++ @@ -2,7 +2,7 @@ // Licensed under the Apache 2.0 license found in the LICENSE file or at: // https://opensource.org/licenses/Apache-2.0 -#include "workerd/util/string-buffer.h" +#include "string-buffer.h" #include namespace workerd { diff --git a/src/workerd/util/symbolizer.c++ b/src/workerd/util/symbolizer.c++ index 2563e54b18c..ad046763375 100644 --- a/src/workerd/util/symbolizer.c++ +++ b/src/workerd/util/symbolizer.c++ @@ -3,9 +3,9 @@ // https://opensource.org/licenses/Apache-2.0 #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/workerd/util/thread-scopes.h b/src/workerd/util/thread-scopes.h index 344b6c69718..6c26e2d1604 100644 --- a/src/workerd/util/thread-scopes.h +++ b/src/workerd/util/thread-scopes.h @@ -13,7 +13,7 @@ // done for the time being. #include -#include +#include namespace workerd {