Skip to content

Commit

Permalink
Merge pull request advancedtelematic#54 from cajun-rat/clang-format-11
Browse files Browse the repository at this point in the history
Upgrade to clang-format-11 (and friends)
  • Loading branch information
pattivacek authored Jan 24, 2022
2 parents 7e1c9aa + 6fc8e72 commit 68a3d3f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ if(TESTSUITE_VALGRIND)
endif()
add_custom_target(build_tests)

find_program(CLANG_FORMAT NAMES clang-format-10)
find_program(CLANG_TIDY NAMES clang-tidy-12 clang-tidy-11 clang-tidy-10)
find_program(CLANG_FORMAT NAMES clang-format-11)
find_program(CLANG_TIDY NAMES clang-tidy-12 clang-tidy-11)

if(CLANG_FORMAT)
function(aktualizr_clang_format)
Expand All @@ -242,7 +242,7 @@ if(CLANG_FORMAT)
endforeach()
endfunction()
else()
message(WARNING "clang-format-10 not found, skipping")
message(WARNING "clang-format-11 not found, skipping")
function(aktualizr_clang_format)
endfunction()
endif()
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The default versions packaged in recent Debian/Ubuntu releases are generally new
Additional packages are used for non-essential components:

* To build the test suite, you will need `net-tools python3-dev python3-openssl python3-venv sqlite3 valgrind`.
* To run the linting tools, you will need `clang clang-format-10 clang-tidy-10`.
* To run the linting tools, you will need `clang clang-format-11 clang-tidy-11`.
* To build additional documentation, you will need `doxygen graphviz`.
* To build with code coverage, you will need `lcov`.

Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile.ubuntu.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ RUN apt-get update && apt-get -y install --no-install-suggests --no-install-reco
awscli \
bison \
ccache \
clang-format-10 \
cmake \
curl \
e2fslibs-dev \
Expand Down
12 changes: 6 additions & 6 deletions docker/Dockerfile.ubuntu.focal
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ RUN apt-get update && apt-get -y install --no-install-suggests --no-install-reco
automake \
bison \
ccache \
clang-10 \
clang-format-10 \
clang-tidy-10 \
clang-tools-10 \
clang-11 \
clang-format-11 \
clang-tidy-11 \
clang-tools-11 \
cmake \
curl \
doxygen \
Expand Down Expand Up @@ -69,8 +69,8 @@ RUN apt-get update && apt-get -y install --no-install-suggests --no-install-reco
xsltproc \
zip

RUN ln -s clang-10 /usr/bin/clang && \
ln -s clang++-10 /usr/bin/clang++
RUN ln -s clang-11 /usr/bin/clang && \
ln -s clang++-11 /usr/bin/clang++

RUN useradd testuser

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ If you're using another version of Ubuntu, or another Debian-based distribution
[subs="attributes"]
----
git clone --branch {aktualizr-version} --recursive https://github.com/advancedtelematic/aktualizr
sudo apt install asn1c build-essential clang clang-format-10 clang-tidy-10 cmake curl \
sudo apt install asn1c build-essential clang clang-format-11 clang-tidy-11 cmake curl \
doxygen graphviz lcov libarchive-dev libboost-dev libboost-filesystem-dev libboost-log-dev \
libboost-program-options-dev libcurl4-openssl-dev libostree-dev libp11-2 libp11-dev \
libpthread-stubs0-dev libsodium-dev libsqlite3-dev libssl-dev libsystemd-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Build from source::
Modify as needed for your distro. See https://github.com/advancedtelematic/aktualizr for further instructions
[source,sh,subs="attributes"]
----
sudo apt install asn1c build-essential clang clang-format-10 clang-tidy-10 \
sudo apt install asn1c build-essential clang clang-format-11 clang-tidy-11 \
cmake curl doxygen graphviz lcov libarchive-dev libboost-dev \
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
libcurl4-openssl-dev libostree-dev libp11-3 libp11-dev libpthread-stubs0-dev \
Expand Down
2 changes: 1 addition & 1 deletion src/libaktualizr/primary/sotauptaneclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class SotaUptaneClient {
boost::optional<Uptane::HardwareIdentifier> getEcuHwId(const Uptane::EcuSerial &serial);

template <class T, class... Args>
void sendEvent(Args &&... args) {
void sendEvent(Args &&...args) {
std::shared_ptr<event::BaseEvent> event = std::make_shared<T>(std::forward<Args>(args)...);
if (events_channel) {
(*events_channel)(std::move(event));
Expand Down
4 changes: 2 additions & 2 deletions src/libaktualizr/utilities/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class CurlEasyWrapper {
};

template <typename... T>
static void curlEasySetoptWrapper(CURL *curl_handle, CURLoption option, T &&... args) {
static void curlEasySetoptWrapper(CURL *curl_handle, CURLoption option, T &&...args) {
const CURLcode retval = curl_easy_setopt(curl_handle, option, std::forward<T>(args)...);
if (retval != 0U) {
throw std::runtime_error(std::string("curl_easy_setopt error: ") + curl_easy_strerror(retval));
Expand Down Expand Up @@ -193,7 +193,7 @@ struct _Unique_if<T[N]> {
};

template <class T, class... Args>
typename _Unique_if<T>::_Single_object make_unique(Args &&... args) {
typename _Unique_if<T>::_Single_object make_unique(Args &&...args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}

Expand Down

0 comments on commit 68a3d3f

Please sign in to comment.