Skip to content

Commit e211fdc

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent bb32ddb commit e211fdc

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

libs/linglong/src/linglong/package/layer_packager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include "linglong/utils/finally/finally.h"
1515
#include "linglong/utils/log/log.h"
1616

17+
#include <nlohmann/json.hpp>
18+
1719
#include <QDataStream>
1820
#include <QSysInfo>
1921

@@ -25,8 +27,6 @@
2527
#include <fcntl.h>
2628
#include <unistd.h>
2729

28-
#include <nlohmann/json.hpp>
29-
3030
namespace linglong::package {
3131

3232
LayerPackager::LayerPackager()
@@ -289,8 +289,8 @@ utils::error::Result<bool> LayerPackager::checkErofsFuseExists() const
289289
return utils::Cmd("erofsfuse").exists();
290290
}
291291

292-
utils::error::Result<void>
293-
LayerPackager::extractSignData(LayerFile &file, const std::filesystem::path &signDir)
292+
utils::error::Result<void> LayerPackager::extractSignData(LayerFile &file,
293+
const std::filesystem::path &signDir)
294294
{
295295
LINGLONG_TRACE("extract sign data from layer");
296296

libs/linglong/src/linglong/package/layer_packager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class LayerPackager : public QObject
3939
const std::filesystem::path &getWorkDir() const;
4040

4141
utils::error::Result<void> extractSignData(LayerFile &file,
42-
const std::filesystem::path &signDir);
42+
const std::filesystem::path &signDir);
4343

4444
private:
4545
std::filesystem::path workDir;

libs/linglong/tests/ll-tests/src/linglong/package/layer_packager_test.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "linglong/utils/cmd.h"
1313
#include "linglong/utils/error/error.h"
1414

15+
#include <nlohmann/json.hpp>
16+
1517
#include <QDir>
1618
#include <QFile>
1719
#include <QSharedPointer>
@@ -22,8 +24,6 @@
2224
#include <sstream>
2325
#include <string>
2426

25-
#include <nlohmann/json.hpp>
26-
2727
using namespace linglong;
2828

2929
namespace linglong::package {
@@ -198,8 +198,8 @@ TEST_F(LayerPackagerTest, ExtractSignData)
198198
signFile.close();
199199

200200
auto signTarPath = signTempDir.path() / "sign.tar";
201-
auto tarRet = utils::Cmd("tar").exec(
202-
{ "-cvf", signTarPath.c_str(), "-C", signContentDir.c_str(), "." });
201+
auto tarRet =
202+
utils::Cmd("tar").exec({ "-cvf", signTarPath.c_str(), "-C", signContentDir.c_str(), "." });
203203
ASSERT_TRUE(tarRet.has_value()) << "Failed to create sign.tar";
204204

205205
QFile originalLayer(layerFilePath.c_str());
@@ -256,8 +256,7 @@ TEST_F(LayerPackagerTest, ExtractSignData)
256256
auto extractRet = packager.extractSignData(*signedLayerFile, signTempDir.path());
257257
ASSERT_TRUE(extractRet.has_value()) << "Failed to extract sign data";
258258

259-
auto signDataDir =
260-
signTempDir.path() / "entries" / "share" / "deepin-elf-verify" / ".elfsign";
259+
auto signDataDir = signTempDir.path() / "entries" / "share" / "deepin-elf-verify" / ".elfsign";
261260
ASSERT_TRUE(std::filesystem::exists(signDataDir / "sign_test_file"))
262261
<< "sign_test_file not found in " << signDataDir;
263262

0 commit comments

Comments
 (0)