Add ClangFormat exceptions

This commit is contained in:
Louis-Bertrand Varin 2018-02-21 21:27:55 -05:00
parent 0b6eb3b30e
commit 3eb917055e
10 changed files with 37 additions and 17 deletions

View File

@ -16,7 +16,7 @@
set(EXCLUDED_DIRS set(EXCLUDED_DIRS
# third-party directories # third-party directories
zxcvbn/ zxcvbn/
http/qhttp/ http/
streams/QtIOCompressor streams/QtIOCompressor
# objective-c directories # objective-c directories
autotype/mac autotype/mac
@ -28,6 +28,11 @@ set(EXCLUDED_FILES
streams/qtiocompressor.h streams/qtiocompressor.h
gui/KMessageWidget.h gui/KMessageWidget.h
gui/KMessageWidget.cpp gui/KMessageWidget.cpp
gui/MainWindowAdaptor.h
gui/MainWindowAdaptor.cpp
sshagent/bcrypt_pbkdf.cpp
sshagent/blf.h
sshagent/blowfish.c
tests/modeltest.cpp tests/modeltest.cpp
tests/modeltest.h tests/modeltest.h
# objective-c files # objective-c files

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de> * Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org> * Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
* *

View File

@ -173,6 +173,7 @@ void AutoTypePlatformWin::sendKey(Qt::Key key, bool isKeyDown)
::SendInput(1, &in, sizeof(INPUT)); ::SendInput(1, &in, sizeof(INPUT));
} }
// clang-format off
// //
// Translate qt key code to windows virtual key code // Translate qt key code to windows virtual key code
// see: https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx // see: https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx
@ -426,6 +427,7 @@ BOOL AutoTypePlatformWin::isExtendedKey(DWORD nativeKeyCode)
return FALSE; return FALSE;
} }
} }
// clang-format on
// //
// Translate qt key modifiers to windows modifiers // Translate qt key modifiers to windows modifiers

View File

@ -4,6 +4,7 @@
const int AutoTypePlatformX11::m_unicodeToKeysymLen = 632; const int AutoTypePlatformX11::m_unicodeToKeysymLen = 632;
// clang-format off
const uint AutoTypePlatformX11::m_unicodeToKeysymKeys[] = { const uint AutoTypePlatformX11::m_unicodeToKeysymKeys[] = {
0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107,
0x0108, 0x0109, 0x010a, 0x010b, 0x010c, 0x010d, 0x010e, 0x010f, 0x0108, 0x0109, 0x010a, 0x010b, 0x010c, 0x010d, 0x010e, 0x010f,
@ -167,3 +168,4 @@ const uint AutoTypePlatformX11::m_unicodeToKeysymValues[] = {
0x04ac, 0x04d4, 0x04ad, 0x04d5, 0x04ae, 0x04d6, 0x04d7, 0x04d8, 0x04ac, 0x04d4, 0x04ad, 0x04d5, 0x04ae, 0x04d6, 0x04d7, 0x04d8,
0x04d9, 0x04da, 0x04db, 0x04dc, 0x04a6, 0x04dd, 0x04a5, 0x04b0 0x04d9, 0x04da, 0x04db, 0x04dc, 0x04a6, 0x04dd, 0x04a5, 0x04b0
}; };
// clang-format on

View File

@ -22,6 +22,8 @@
DatabaseIcons* DatabaseIcons::m_instance(nullptr); DatabaseIcons* DatabaseIcons::m_instance(nullptr);
const int DatabaseIcons::IconCount(69); const int DatabaseIcons::IconCount(69);
const int DatabaseIcons::ExpiredIconIndex(45); const int DatabaseIcons::ExpiredIconIndex(45);
// clang-format off
const char* const DatabaseIcons::m_indexToName[] = { const char* const DatabaseIcons::m_indexToName[] = {
"C00_Password.png", "C00_Password.png",
"C01_Package_Network.png", "C01_Package_Network.png",
@ -93,6 +95,7 @@ const char* const DatabaseIcons::m_indexToName[] = {
"C67_Certificate.png", "C67_Certificate.png",
"C68_BlackBerry.png" "C68_BlackBerry.png"
}; };
// clang-format on
QImage DatabaseIcons::icon(int index) QImage DatabaseIcons::icon(int index)
{ {

View File

@ -23,7 +23,9 @@
#include <QCoreApplication> #include <QCoreApplication>
// clang-format off
#define CHECK_RETURN_FALSE(x) if (!(x)) return false; #define CHECK_RETURN_FALSE(x) if (!(x)) return false;
// clang-format on
class QIODevice; class QIODevice;
class Database; class Database;

View File

@ -1,19 +1,19 @@
/* /*
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de> * Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 or (at your option) * the Free Software Foundation, either version 2 or (at your option)
* version 3 of the License. * version 3 of the License.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef KEEPASSX_KEEPASS2_H #ifndef KEEPASSX_KEEPASS2_H
#define KEEPASSX_KEEPASS2_H #define KEEPASSX_KEEPASS2_H

View File

@ -182,6 +182,7 @@ void TestKdbx4::testFormat400Upgrade()
QCOMPARE(*targetDb->rootGroup()->customData(), *sourceDb->rootGroup()->customData()); QCOMPARE(*targetDb->rootGroup()->customData(), *sourceDb->rootGroup()->customData());
} }
// clang-format off
void TestKdbx4::testFormat400Upgrade_data() void TestKdbx4::testFormat400Upgrade_data()
{ {
QTest::addColumn<Uuid>("kdfUuid"); QTest::addColumn<Uuid>("kdfUuid");
@ -213,6 +214,7 @@ void TestKdbx4::testFormat400Upgrade_data()
QTest::newRow("AES-KDF + Twofish + CustomData") << KeePass2::KDF_AES_KDBX4 << KeePass2::CIPHER_TWOFISH << true << kdbx4; QTest::newRow("AES-KDF + Twofish + CustomData") << KeePass2::KDF_AES_KDBX4 << KeePass2::CIPHER_TWOFISH << true << kdbx4;
QTest::newRow("AES-KDF (legacy) + Twofish + CustomData") << KeePass2::KDF_AES_KDBX3 << KeePass2::CIPHER_TWOFISH << true << kdbx4; QTest::newRow("AES-KDF (legacy) + Twofish + CustomData") << KeePass2::KDF_AES_KDBX3 << KeePass2::CIPHER_TWOFISH << true << kdbx4;
} }
// clang-format on
void TestKdbx4::testUpgradeMasterKeyIntegrity() void TestKdbx4::testUpgradeMasterKeyIntegrity()
{ {

View File

@ -357,6 +357,7 @@ void TestKeePass2Format::testXmlBroken()
QCOMPARE(hasError, expectError); QCOMPARE(hasError, expectError);
} }
// clang-format off
void TestKeePass2Format::testXmlBroken_data() void TestKeePass2Format::testXmlBroken_data()
{ {
QTest::addColumn<QString>("baseName"); QTest::addColumn<QString>("baseName");
@ -381,6 +382,7 @@ void TestKeePass2Format::testXmlBroken_data()
QTest::newRow("BrokenDifferentEntryHistoryUuid (strict)") << "BrokenDifferentEntryHistoryUuid" << true << true; QTest::newRow("BrokenDifferentEntryHistoryUuid (strict)") << "BrokenDifferentEntryHistoryUuid" << true << true;
QTest::newRow("BrokenDifferentEntryHistoryUuid (not strict)") << "BrokenDifferentEntryHistoryUuid" << false << false; QTest::newRow("BrokenDifferentEntryHistoryUuid (not strict)") << "BrokenDifferentEntryHistoryUuid" << false << false;
} }
// clang-format on
void TestKeePass2Format::testXmlEmptyUuids() void TestKeePass2Format::testXmlEmptyUuids()
{ {

View File

@ -110,6 +110,7 @@ void TestKeys::testFileKey()
QCOMPARE(db->metadata()->name(), QString("%1 Database").arg(name)); QCOMPARE(db->metadata()->name(), QString("%1 Database").arg(name));
} }
// clang-format off
void TestKeys::testFileKey_data() void TestKeys::testFileKey_data()
{ {
QTest::addColumn<FileKey::Type>("type"); QTest::addColumn<FileKey::Type>("type");
@ -120,6 +121,7 @@ void TestKeys::testFileKey_data()
QTest::newRow("Hex") << FileKey::FixedBinaryHex << QString("Hex"); QTest::newRow("Hex") << FileKey::FixedBinaryHex << QString("Hex");
QTest::newRow("Hashed") << FileKey::Hashed << QString("Hashed"); QTest::newRow("Hashed") << FileKey::Hashed << QString("Hashed");
} }
// clang-format on
void TestKeys::testCreateFileKey() void TestKeys::testCreateFileKey()
{ {