mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
Merge pull request #14251 from fzakaria/fzakaria/iwyu-libflake
Clean-up libflake headers
This commit is contained in:
commit
e07754d888
15 changed files with 217 additions and 34 deletions
|
|
@ -124,6 +124,7 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
|
|||
(pkgs.writeScriptBin "pre-commit-hooks-install" modular.pre-commit.settings.installationScript)
|
||||
pkgs.buildPackages.nixfmt-rfc-style
|
||||
pkgs.buildPackages.shellcheck
|
||||
pkgs.buildPackages.include-what-you-use
|
||||
pkgs.buildPackages.gdb
|
||||
]
|
||||
++ lib.optional (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) (
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "nix/fetchers/fetch-settings.hh"
|
||||
#include "nix/flake/flakeref.hh"
|
||||
#include "nix/fetchers/attrs.hh"
|
||||
#include "nix/fetchers/fetchers.hh"
|
||||
#include "nix/util/configuration.hh"
|
||||
#include "nix/util/error.hh"
|
||||
#include "nix/util/experimental-features.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
#include "nix/util/file-system.hh"
|
||||
#include "nix_api_store.h"
|
||||
#include "nix_api_util.h"
|
||||
#include "nix_api_expr.h"
|
||||
#include "nix_api_value.h"
|
||||
#include "nix_api_flake.h"
|
||||
|
||||
#include "nix/expr/tests/nix_api_expr.hh"
|
||||
#include "nix/util/tests/string_callback.hh"
|
||||
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include "nix/store/tests/nix_api_store.hh"
|
||||
#include "nix/util/tests/nix_api_util.hh"
|
||||
#include "nix_api_fetchers.h"
|
||||
|
||||
namespace nixC {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#include "nix/flake/url-name.hh"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "nix/flake/url-name.hh"
|
||||
#include "nix/util/url.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
/* ----------- tests for url-name.hh --------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -1,9 +1,30 @@
|
|||
#include <nlohmann/json.hpp>
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <nlohmann/json_fwd.hpp>
|
||||
#include <cctype>
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
#include <format>
|
||||
|
||||
#include "nix/util/users.hh"
|
||||
#include "nix/util/config-global.hh"
|
||||
#include "nix/flake/settings.hh"
|
||||
#include "nix/flake/flake.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "nix/util/ansicolor.hh"
|
||||
#include "nix/util/configuration.hh"
|
||||
#include "nix/util/file-system.hh"
|
||||
#include "nix/util/fmt.hh"
|
||||
#include "nix/util/logging.hh"
|
||||
#include "nix/util/strings.hh"
|
||||
#include "nix/util/types.hh"
|
||||
#include "nix/util/util.hh"
|
||||
|
||||
namespace nix::flake {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,34 @@
|
|||
#include <stdint.h>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "nix/flake/flake-primops.hh"
|
||||
#include "nix/expr/eval.hh"
|
||||
#include "nix/flake/flake.hh"
|
||||
#include "nix/flake/flakeref.hh"
|
||||
#include "nix/flake/settings.hh"
|
||||
#include "nix/expr/attr-set.hh"
|
||||
#include "nix/expr/eval-error.hh"
|
||||
#include "nix/expr/eval-inline.hh"
|
||||
#include "nix/expr/eval-settings.hh"
|
||||
#include "nix/expr/symbol-table.hh"
|
||||
#include "nix/expr/value.hh"
|
||||
#include "nix/fetchers/attrs.hh"
|
||||
#include "nix/fetchers/fetchers.hh"
|
||||
#include "nix/util/configuration.hh"
|
||||
#include "nix/util/error.hh"
|
||||
#include "nix/util/experimental-features.hh"
|
||||
#include "nix/util/pos-idx.hh"
|
||||
#include "nix/util/pos-table.hh"
|
||||
#include "nix/util/source-path.hh"
|
||||
#include "nix/util/types.hh"
|
||||
#include "nix/util/util.hh"
|
||||
|
||||
namespace nix::flake::primops {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,24 @@
|
|||
#include <nlohmann/json.hpp>
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <boost/container/detail/std_fwd.hpp>
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
#include <boost/unordered/detail/foa/table.hpp>
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
#include <format>
|
||||
|
||||
#include "nix/util/terminal.hh"
|
||||
#include "nix/util/ref.hh"
|
||||
#include "nix/util/environment-variables.hh"
|
||||
|
|
@ -6,7 +27,6 @@
|
|||
#include "nix/expr/eval-cache.hh"
|
||||
#include "nix/expr/eval-settings.hh"
|
||||
#include "nix/flake/lockfile.hh"
|
||||
#include "nix/expr/primops.hh"
|
||||
#include "nix/expr/eval-inline.hh"
|
||||
#include "nix/store/store-api.hh"
|
||||
#include "nix/fetchers/fetchers.hh"
|
||||
|
|
@ -14,14 +34,36 @@
|
|||
#include "nix/fetchers/fetch-settings.hh"
|
||||
#include "nix/flake/settings.hh"
|
||||
#include "nix/expr/value-to-json.hh"
|
||||
#include "nix/store/local-fs-store.hh"
|
||||
#include "nix/fetchers/fetch-to-store.hh"
|
||||
#include "nix/util/memory-source-accessor.hh"
|
||||
#include "nix/fetchers/input-cache.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "nix/expr/attr-set.hh"
|
||||
#include "nix/expr/eval-error.hh"
|
||||
#include "nix/expr/nixexpr.hh"
|
||||
#include "nix/expr/symbol-table.hh"
|
||||
#include "nix/expr/value.hh"
|
||||
#include "nix/expr/value/context.hh"
|
||||
#include "nix/fetchers/attrs.hh"
|
||||
#include "nix/fetchers/registry.hh"
|
||||
#include "nix/flake/flakeref.hh"
|
||||
#include "nix/store/path.hh"
|
||||
#include "nix/util/canon-path.hh"
|
||||
#include "nix/util/configuration.hh"
|
||||
#include "nix/util/error.hh"
|
||||
#include "nix/util/experimental-features.hh"
|
||||
#include "nix/util/file-system.hh"
|
||||
#include "nix/util/fmt.hh"
|
||||
#include "nix/util/hash.hh"
|
||||
#include "nix/util/logging.hh"
|
||||
#include "nix/util/pos-idx.hh"
|
||||
#include "nix/util/pos-table.hh"
|
||||
#include "nix/util/position.hh"
|
||||
#include "nix/util/source-path.hh"
|
||||
#include "nix/util/types.hh"
|
||||
#include "nix/util/util.hh"
|
||||
|
||||
namespace nix {
|
||||
struct SourceAccessor;
|
||||
|
||||
using namespace flake;
|
||||
|
||||
|
|
@ -865,7 +907,7 @@ static ref<SourceAccessor> makeInternalFS()
|
|||
internalFS->setPathDisplay("«flakes-internal»", "");
|
||||
internalFS->addFile(
|
||||
CanonPath("call-flake.nix"),
|
||||
#include "call-flake.nix.gen.hh"
|
||||
#include "call-flake.nix.gen.hh" // IWYU pragma: keep
|
||||
);
|
||||
return internalFS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,39 @@
|
|||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <filesystem>
|
||||
#include <ostream>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "nix/flake/flakeref.hh"
|
||||
#include "nix/store/store-api.hh"
|
||||
#include "nix/util/url.hh"
|
||||
#include "nix/util/url-parts.hh"
|
||||
#include "nix/fetchers/fetchers.hh"
|
||||
#include "nix/util/error.hh"
|
||||
#include "nix/util/file-system.hh"
|
||||
#include "nix/util/fmt.hh"
|
||||
#include "nix/util/logging.hh"
|
||||
#include "nix/util/strings.hh"
|
||||
#include "nix/util/util.hh"
|
||||
#include "nix/fetchers/attrs.hh"
|
||||
#include "nix/fetchers/registry.hh"
|
||||
#include "nix/store/outputs-spec.hh"
|
||||
#include "nix/util/ref.hh"
|
||||
#include "nix/util/types.hh"
|
||||
|
||||
namespace nix {
|
||||
class Store;
|
||||
struct SourceAccessor;
|
||||
|
||||
namespace fetchers {
|
||||
struct Settings;
|
||||
} // namespace fetchers
|
||||
|
||||
#if 0
|
||||
// 'dir' path elements cannot start with a '.'. We also reject
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include "nix/expr/eval.hh"
|
||||
#include "nix/flake/settings.hh"
|
||||
|
||||
namespace nix {
|
||||
namespace flake {
|
||||
struct Settings;
|
||||
} // namespace flake
|
||||
} // namespace nix
|
||||
|
||||
namespace nix::flake::primops {
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
///@file
|
||||
|
||||
#include <regex>
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "nix/util/types.hh"
|
||||
#include "nix/fetchers/fetchers.hh"
|
||||
#include "nix/store/outputs-spec.hh"
|
||||
#include "nix/fetchers/registry.hh"
|
||||
|
||||
|
|
@ -12,6 +14,10 @@ namespace nix {
|
|||
|
||||
class Store;
|
||||
|
||||
namespace fetchers {
|
||||
struct Settings;
|
||||
} // namespace fetchers
|
||||
|
||||
typedef std::string FlakeId;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "nix/util/configuration.hh"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <string>
|
||||
|
||||
#include "nix/util/configuration.hh"
|
||||
|
||||
namespace nix {
|
||||
// Forward declarations
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#include "nix/util/url.hh"
|
||||
#include "nix/util/url-parts.hh"
|
||||
#include "nix/util/util.hh"
|
||||
#include "nix/util/split.hh"
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace nix {
|
||||
struct ParsedURL;
|
||||
|
||||
/**
|
||||
* Try to extract a reasonably unique and meaningful, human-readable
|
||||
|
|
|
|||
|
|
@ -1,15 +1,49 @@
|
|||
#include "nix/fetchers/fetch-settings.hh"
|
||||
#include "nix/flake/settings.hh"
|
||||
#include "nix/flake/lockfile.hh"
|
||||
#include "nix/store/store-api.hh"
|
||||
#include "nix/util/strings.hh"
|
||||
|
||||
#include <boost/unordered/unordered_flat_set.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <assert.h>
|
||||
#include <boost/unordered/unordered_flat_set_fwd.hpp>
|
||||
#include <nlohmann/detail/iterators/iter_impl.hpp>
|
||||
#include <nlohmann/detail/iterators/iteration_proxy.hpp>
|
||||
#include <nlohmann/json_fwd.hpp>
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
|
||||
#include <boost/unordered/unordered_flat_set.hpp>
|
||||
#include <iterator>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <compare>
|
||||
#include <ctime>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <regex>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "nix/fetchers/fetch-settings.hh"
|
||||
#include "nix/flake/lockfile.hh"
|
||||
#include "nix/util/strings.hh"
|
||||
#include "nix/fetchers/attrs.hh"
|
||||
#include "nix/fetchers/fetchers.hh"
|
||||
#include "nix/flake/flakeref.hh"
|
||||
#include "nix/store/path.hh"
|
||||
#include "nix/util/ansicolor.hh"
|
||||
#include "nix/util/configuration.hh"
|
||||
#include "nix/util/error.hh"
|
||||
#include "nix/util/fmt.hh"
|
||||
#include "nix/util/hash.hh"
|
||||
#include "nix/util/logging.hh"
|
||||
#include "nix/util/ref.hh"
|
||||
#include "nix/util/types.hh"
|
||||
#include "nix/util/util.hh"
|
||||
|
||||
namespace nix {
|
||||
class Store;
|
||||
} // namespace nix
|
||||
|
||||
namespace nix::flake {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
#include <vector>
|
||||
|
||||
#include "nix/flake/settings.hh"
|
||||
#include "nix/flake/flake-primops.hh"
|
||||
#include "nix/expr/eval-settings.hh"
|
||||
#include "nix/expr/eval.hh"
|
||||
|
||||
namespace nix::flake {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
#include "nix/flake/url-name.hh"
|
||||
#include <regex>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "nix/flake/url-name.hh"
|
||||
#include "nix/util/strings.hh"
|
||||
#include "nix/util/url.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue