1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-05 08:31:00 +01:00

Apply clang-format universally.

* It is tough to contribute to a project that doesn't use a formatter,
* It is extra hard to contribute to a project which has configured the formatter, but ignores it for some files
* Code formatting makes it harder to hide obscure / weird bugs by accident or on purpose,

Let's rip the bandaid off?

Note that PRs currently in flight should be able to be merged relatively easily by applying `clang-format` to their tip prior to merge.
This commit is contained in:
Graham Christensen 2025-07-18 12:47:27 -04:00
parent 41bf87ec70
commit e4f62e4608
587 changed files with 23258 additions and 23135 deletions

View file

@ -3,7 +3,8 @@
namespace nix {
struct DummyStoreConfig : public std::enable_shared_from_this<DummyStoreConfig>, virtual StoreConfig {
struct DummyStoreConfig : public std::enable_shared_from_this<DummyStoreConfig>, virtual StoreConfig
{
using StoreConfig::StoreConfig;
DummyStoreConfig(std::string_view scheme, std::string_view authority, const Params & params)
@ -13,16 +14,20 @@ struct DummyStoreConfig : public std::enable_shared_from_this<DummyStoreConfig>,
throw UsageError("`%s` store URIs must not contain an authority part %s", scheme, authority);
}
static const std::string name() { return "Dummy Store"; }
static const std::string name()
{
return "Dummy Store";
}
static std::string doc()
{
return
#include "dummy-store.md"
;
#include "dummy-store.md"
;
}
static StringSet uriSchemes() {
static StringSet uriSchemes()
{
return {"dummy"};
}
@ -38,15 +43,16 @@ struct DummyStore : virtual Store
DummyStore(ref<const Config> config)
: Store{*config}
, config(config)
{ }
{
}
std::string getUri() override
{
return *Config::uriSchemes().begin();
}
void queryPathInfoUncached(const StorePath & path,
Callback<std::shared_ptr<const ValidPathInfo>> callback) noexcept override
void queryPathInfoUncached(
const StorePath & path, Callback<std::shared_ptr<const ValidPathInfo>> callback) noexcept override
{
callback(nullptr);
}
@ -60,11 +66,14 @@ struct DummyStore : virtual Store
}
std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) override
{ unsupported("queryPathFromHashPart"); }
{
unsupported("queryPathFromHashPart");
}
void addToStore(const ValidPathInfo & info, Source & source,
RepairFlag repair, CheckSigsFlag checkSigs) override
{ unsupported("addToStore"); }
void addToStore(const ValidPathInfo & info, Source & source, RepairFlag repair, CheckSigsFlag checkSigs) override
{
unsupported("addToStore");
}
virtual StorePath addToStoreFromDump(
Source & dump,
@ -74,14 +83,20 @@ struct DummyStore : virtual Store
HashAlgorithm hashAlgo = HashAlgorithm::SHA256,
const StorePathSet & references = StorePathSet(),
RepairFlag repair = NoRepair) override
{ unsupported("addToStore"); }
{
unsupported("addToStore");
}
void narFromPath(const StorePath & path, Sink & sink) override
{ unsupported("narFromPath"); }
{
unsupported("narFromPath");
}
void queryRealisationUncached(const DrvOutput &,
Callback<std::shared_ptr<const Realisation>> callback) noexcept override
{ callback(nullptr); }
void
queryRealisationUncached(const DrvOutput &, Callback<std::shared_ptr<const Realisation>> callback) noexcept override
{
callback(nullptr);
}
virtual ref<SourceAccessor> getFSAccessor(bool requireValidPath) override
{
@ -96,4 +111,4 @@ ref<Store> DummyStore::Config::openStore() const
static RegisterStoreImplementation<DummyStore::Config> regDummyStore;
}
} // namespace nix