Skip to content

Commit

Permalink
Get clazy working again (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 authored Nov 10, 2024
1 parent c199dd4 commit 036988c
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/build_and_test_cmake.sh'
TOOLS: 'clang'
- IMAGE: 'jammy'
- IMAGE: 'noble'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/build_extra_tests.sh'
container:
Expand Down
2 changes: 1 addition & 1 deletion geo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <QByteArray> // for QByteArray
#include <QIODevice> // for QIODevice
#include <QString> // for QString, operator==, QStringView::to...
#include <QStringLiteral> // for qMakeStringPrivate, QStringLiteral
#include <QStringView> // for QStringView
#include <QXmlStreamAttributes> // for QXmlStreamAttributes
#include <QtCore> // for qPrintable, QIODeviceBase::ReadOnly

#include "defs.h"
#include "geocache.h" // for Geocache, Geocache::container_t, Geo...
Expand Down
1 change: 1 addition & 0 deletions geo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef GEO_H_INCLUDED_
#define GEO_H_INCLUDED_

#include <QList> // for QList
#include <QString> // for QString
#include <QVector> // for QVector
#include <QXmlStreamReader> // for QXmlStreamReader
Expand Down
4 changes: 1 addition & 3 deletions googletakeout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@
#include <QDebug> // for QDebug
#include <QDir> // for QDir
#include <QFileInfo> // for QFileInfo
#include <QFileInfoList> // for QFileInfoList
#include <QIODevice> // for operator|, QIODevice
#include <QJsonArray> // for QJsonArray, QJsonArray::const_iterator
#include <QJsonDocument> // for QJsonDocument
#include <QJsonObject> // for QJsonObject, QJsonObject::const_iterator
#include <QJsonParseError> // for QJsonParseError, QJsonParseError::NoError
#include <QJsonValueRef> // for QJsonValueRef
#include <QtCore> // for ISODate, QIODeviceBase::ReadOnly, QIODeviceBase::Text
#include <Qt>

#include "src/core/datetime.h" // for DateTime
#include "src/core/file.h" // for File
Expand Down
43 changes: 22 additions & 21 deletions mtk_logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,34 @@

#include "mtk_logger.h"

#include <algorithm> // for clamp
#include <cctype> // for isdigit
#include <cstdarg> // for va_end, va_start
#include <cstring> // for memcmp, memset, strncmp, strlen, memmove, strchr, strcpy, strerror, strstr
#include <algorithm> // for clamp
#include <cctype> // for isdigit
#include <cerrno> // for errno
#include <cmath> // for fabs
#include <cstdarg> // for va_end, va_start
#include <cstring> // for memcmp, memset, strncmp, strlen, memmove, strchr, strcpy, strerror, strstr
#include <cstdlib> // for strtoul
#if __WIN32__
#include <io.h> // for _chsize
#include <io.h> // for _chsize
#else
#include <unistd.h> // for ftruncate
#include <unistd.h> // for ftruncate
#endif

#include <QByteArray> // for QByteArray
#include <QChar> // for QChar
#include <QDateTime> // for QDateTime
#include <QDir> // for QDir
#include <QFile> // for QFile
#include <QLatin1Char> // for QLatin1Char
#include <QStringLiteral> // for qMakeStringPrivate, QStringLiteral
#include <QThread> // for QThread
#include <QtCore> // for qPrintable, UTC
#include <cerrno> // for errno
#include <cmath> // for fabs
#include <cstdlib> // for strtoul
#include <QByteArray> // for QByteArray
#include <QChar> // for QChar
#include <QDateTime> // for QDateTime
#include <QDir> // for QDir
#include <QFile> // for QFile
#include <QLatin1Char> // for QLatin1Char
#include <QMessageLogContext> // for QtMsgType
#include <QStringLiteral> // for qMakeStringPrivate, QStringLiteral
#include <QThread> // for QThread
#include <QtGlobal> // for qPrintable

#include "defs.h"
#include "gbfile.h" // for gbfprintf, gbfputc, gbfputs, gbfclose, gbfopen, gbfile
#include "gbser.h" // for gbser_read_line, gbser_set_port, gbser_OK, gbser_deinit, gbser_init, gbser_print, gbser_TIMEOUT
#include "src/core/datetime.h" // for DateTime
#include "gbfile.h" // for gbfprintf, gbfputc, gbfputs, gbfclose, gbfopen, gbfile
#include "gbser.h" // for gbser_read_line, gbser_set_port, gbser_OK, gbser_deinit, gbser_init, gbser_print, gbser_TIMEOUT
#include "src/core/datetime.h" // for DateTime


#define MTK_EVT_BITMASK (1<<0x02)
Expand Down
1 change: 1 addition & 0 deletions mtk_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <cstdio> // for FILE
#include <ctime> // for time_t

#include <QList> // for QList
#include <QString> // for QString
#include <QVector> // for QVector

Expand Down
6 changes: 6 additions & 0 deletions tools/Dockerfile_noble
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ LABEL maintainer="https://github.com/tsteven4"
WORKDIR /app

# update environment.
# software-properties-common, gpg-agent and ppa:tsteven4/clazy-backports
# are needed to get a backported version of clazy (1.12-2~noble12) that works
# with Qt6.
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
software-properties-common \
gpg-agent \
&& add-apt-repository ppa:tsteven4/clazy-backports \
&& apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*

Expand Down
4 changes: 3 additions & 1 deletion tools/make_docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ TMPDIR=$(mktemp -d)

cp Dockerfile${versuffix} $TMPDIR

docker build --pull --file Dockerfile${versuffix} \
docker buildx build \
--pull --file Dockerfile${versuffix} \
--tag tsteven4/gpsbabel_build_environment${versuffix}:latest \
--tag tsteven4/gpsbabel_build_environment${versuffix}:$tag \
--progress=plain \
$TMPDIR
/bin/rm -fr $TMPDIR
docker push tsteven4/gpsbabel_build_environment${versuffix}:$tag
Expand Down
2 changes: 1 addition & 1 deletion unicsv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ UnicsvFormat::unicsv_fondle_header(QString header)
}
}

for (auto value : values) {
for (auto value : std::as_const(values)) {
value = value.trimmed();

unicsv_fields_tab.append(fld_terminator); // default
Expand Down
20 changes: 10 additions & 10 deletions v900.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ for a little more info, see structures:

#include "v900.h"

#include <cassert> // for assert
#include <cstdarg> // for va_end, va_start
#include <cstdio> // for fclose, fgets, fread, va_list
#include <cstdlib> // for strtod
#include <cstring> // for strncmp, strcat, strcpy, strstr

#include <QByteArray> // for QByteArray
#include <QDate> // for QDate
#include <QTime> // for QTime
#include <QtCore> // for qPrintable, UTC
#include <cassert> // for assert
#include <cstdarg> // for va_end, va_start
#include <cstdio> // for fclose, fgets, fread, va_list
#include <cstdlib> // for strtod
#include <cstring> // for strncmp, strcat, strcpy, strstr

#include <QByteArray> // for QByteArray
#include <QDate> // for QDate
#include <QMessageLogContext> // for QtMsgType
#include <QTime> // for QTime

#include "defs.h"

Expand Down
1 change: 1 addition & 0 deletions v900.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <cstdio> // for FILE

#include <QDateTime> // for QDateTime
#include <QList> // for QList
#include <QString> // for QString
#include <QVector> // for QVector

Expand Down
2 changes: 1 addition & 1 deletion vecs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ QVector<Vecs::style_vec_t> Vecs::create_style_vec()
dir.setNameFilters(QStringList("*.style"));
dir.setFilter(QDir::Files);
dir.setSorting(QDir::Name);
QFileInfoList fileinfolist = dir.entryInfoList();
const QFileInfoList fileinfolist = dir.entryInfoList();
QVector<style_vec_t> slist;
for (const auto& fileinfo : fileinfolist) {
if (!fileinfo.isReadable()) {
Expand Down

0 comments on commit 036988c

Please sign in to comment.