1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 12:36:01 +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,9 @@
namespace nix {
std::string_view SourcePath::baseName() const
{ return path.baseName().value_or("source"); }
{
return path.baseName().value_or("source");
}
SourcePath SourcePath::parent() const
{
@ -13,39 +15,59 @@ SourcePath SourcePath::parent() const
}
std::string SourcePath::readFile() const
{ return accessor->readFile(path); }
{
return accessor->readFile(path);
}
bool SourcePath::pathExists() const
{ return accessor->pathExists(path); }
{
return accessor->pathExists(path);
}
SourceAccessor::Stat SourcePath::lstat() const
{ return accessor->lstat(path); }
{
return accessor->lstat(path);
}
std::optional<SourceAccessor::Stat> SourcePath::maybeLstat() const
{ return accessor->maybeLstat(path); }
{
return accessor->maybeLstat(path);
}
SourceAccessor::DirEntries SourcePath::readDirectory() const
{ return accessor->readDirectory(path); }
{
return accessor->readDirectory(path);
}
std::string SourcePath::readLink() const
{ return accessor->readLink(path); }
{
return accessor->readLink(path);
}
void SourcePath::dumpPath(
Sink & sink,
PathFilter & filter) const
{ return accessor->dumpPath(path, sink, filter); }
void SourcePath::dumpPath(Sink & sink, PathFilter & filter) const
{
return accessor->dumpPath(path, sink, filter);
}
std::optional<std::filesystem::path> SourcePath::getPhysicalPath() const
{ return accessor->getPhysicalPath(path); }
{
return accessor->getPhysicalPath(path);
}
std::string SourcePath::to_string() const
{ return accessor->showPath(path); }
{
return accessor->showPath(path);
}
SourcePath SourcePath::operator / (const CanonPath & x) const
{ return {accessor, path / x}; }
SourcePath SourcePath::operator/(const CanonPath & x) const
{
return {accessor, path / x};
}
SourcePath SourcePath::operator / (std::string_view c) const
{ return {accessor, path / c}; }
SourcePath SourcePath::operator/(std::string_view c) const
{
return {accessor, path / c};
}
bool SourcePath::operator==(const SourcePath & x) const noexcept
{
@ -63,4 +85,4 @@ std::ostream & operator<<(std::ostream & str, const SourcePath & path)
return str;
}
}
} // namespace nix