clang-tidy-14

remotes/origin/release/22.08
Albert Astals Cid 4 years ago
parent 3efcce3344
commit 0a571b84df
  1. 4
      .gitlab-ci.yml
  2. 2
      generators/chm/lib/helper_search_index.cpp
  3. 2
      generators/epub/epubdocument.cpp
  4. 4
      generators/xps/generator_xps.cpp

@ -42,13 +42,13 @@ build_clazy_clang_tidy:
script:
- srcdir=`pwd` && mkdir -p /tmp/okular_build && cd /tmp/okular_build && CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja $srcdir && cat compile_commands.json | jq '[.[] | select(.file | contains("'"$srcdir"'"))]' > compile_commands.aux.json && cat compile_commands.aux.json | jq '[.[] | select(.file | contains("/synctex/")| not)]' > compile_commands.json && cp "$srcdir/.clang-tidy" .
- CLAZY_IGNORE_DIRS="settings_core.[cpp|h]|settings.[cpp.h]|pdfsettings.h|gssettings.h" CLAZY_CHECKS="level0,level1,level2,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch" ninja
- run-clang-tidy-13
- run-clang-tidy-14
- rm -rf *
- echo "Now compiling the mobile UI"
- cd "$CI_PROJECT_DIR"
- srcdir=`pwd` && mkdir -p /tmp/okular_build && cd /tmp/okular_build && CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -DOKULAR_UI=mobile -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja $srcdir && cat compile_commands.json | jq '[.[] | select(.file | contains("'"$srcdir"'"))]' > compile_commands.aux.json && cat compile_commands.aux.json | jq '[.[] | select(.file | contains("/synctex/")| not)]' > compile_commands.json && cp "$srcdir/.clang-tidy" .
- CLAZY_IGNORE_DIRS="settings_mobile.[cpp|h]|settings.[cpp.h]|pdfsettings.h|gssettings.h" CLAZY_CHECKS="level0,level1,level2,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch" ninja
- run-clang-tidy-13
- run-clang-tidy-14
clang_format:
stage: build

@ -96,7 +96,7 @@ bool Index::makeIndex(const QList<QUrl> &docs, EBook *chmFile)
return false;
}
QUrl filename = *it;
const QUrl &filename = *it;
QStringList terms;
if (parseDocumentToStringlist(chmFile, filename, terms)) {

@ -79,7 +79,7 @@ QString EpubDocument::checkCSS(const QString &c)
std::size_t i = 0;
const QRegularExpression re(QStringLiteral("(([0-9]+)(\\.[0-9]+)?)r?em(.*)"));
while (i < cssArrayCount) {
auto item = cssArray[i];
const auto &item = cssArray[i];
QRegularExpressionMatch match = re.match(item);
if (match.hasMatch()) {
double em = match.captured(1).toDouble();

@ -1434,13 +1434,13 @@ QFont XpsFile::getFontByName(const QString &absoluteFileName, float size)
qCWarning(OkularXpsDebug) << "The unexpected has happened. No font family for a known font:" << absoluteFileName << index;
return QFont();
}
const QString fontFamily = fontFamilies[0];
const QString &fontFamily = fontFamilies[0];
const QStringList fontStyles = m_fontDatabase.styles(fontFamily);
if (fontStyles.isEmpty()) {
qCWarning(OkularXpsDebug) << "The unexpected has happened. No font style for a known font family:" << absoluteFileName << index << fontFamily;
return QFont();
}
const QString fontStyle = fontStyles[0];
const QString &fontStyle = fontStyles[0];
return m_fontDatabase.font(fontFamily, fontStyle, qRound(size));
}

Loading…
Cancel
Save