Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
c48f1dc3d0 | |||
9a25cd9178 | |||
e74828c19e | |||
7255df01e0 | |||
7de644d841 | |||
52a849870f | |||
aabcb46602 | |||
cca3a4a239 | |||
5ec7a119dc | |||
cf4302248f |
23
.clang-tidy
23
.clang-tidy
|
@ -1,5 +1,5 @@
|
|||
# -*- mode: conf; fill-column: 100; -*-
|
||||
# Written for clang-tidy 9.
|
||||
# Written for clang-tidy 11.
|
||||
|
||||
---
|
||||
Checks: '*,
|
||||
|
@ -26,19 +26,20 @@ Checks: '*,
|
|||
-fuchsia-statically-constructed-objects,
|
||||
-google-readability-todo,
|
||||
-modernize-use-trailing-return-type,
|
||||
-fuchsia-multiple-inheritance'
|
||||
CheckOptions: - { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||
# Clashes with constant private member prefix. (const int _var;)
|
||||
# - { key: readability-identifier-naming.ConstantCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.EnumCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
|
||||
-fuchsia-multiple-inheritance,
|
||||
-llvmlibc*'
|
||||
FormatStyle: file # Use .clang-format.
|
||||
CheckOptions: # ↓ Clashes with static private member prefix. (static int _var;) ↓
|
||||
- { key: readability-identifier-naming.VariableCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.MemberCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.PrivateMemberPrefix, value: _ }
|
||||
- { key: readability-identifier-naming.ProtextedMemberCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.ProtectedMemberPrefix, value: _ }
|
||||
|
||||
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||
- { key: readability-identifier-naming.StructCase, value: lower_case }
|
||||
# Clashes with static private member prefix. (static int _var;)
|
||||
# - { key: readability-identifier-naming.VariableCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.EnumCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
|
||||
...
|
||||
|
|
|
@ -141,7 +141,7 @@ steps:
|
|||
- apt-get install -qq build-essential cmake lsb-release
|
||||
- apt-get install -qq libcurl4-openssl-dev
|
||||
- rm -rf build && mkdir -p build && cd build
|
||||
- cmake -G "Unix Makefiles" -SCMAKE_INSTALL_PREFIX=/usr -DWITH_DEB=YES ..
|
||||
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DWITH_DEB=YES ..
|
||||
- make
|
||||
- make install DESTDIR=install
|
||||
- make package
|
||||
|
|
22
README.adoc
22
README.adoc
|
@ -22,6 +22,10 @@
|
|||
link:{uri-pleroma}[Pleroma] APIs. It replaces
|
||||
link:{uri-mastodon-cpp}[mastodon-cpp].
|
||||
|
||||
[IMPORTANT]
|
||||
mastodonpp is in maintenance mode. I will continue to fix bugs, but won't add
|
||||
new features. If you'd like to adopt this project, please get in touch.
|
||||
|
||||
We aim to create a library that is comfortable, yet minimal. All API endpoints
|
||||
from Mastodon and Pleroma are stored in ``enum class``es, to counteract typos
|
||||
and make your life easier. The network-facing code is built on
|
||||
|
@ -79,16 +83,24 @@ link:{uri-reference}/examples.html[More examples] are included in the reference.
|
|||
|
||||
== Install
|
||||
|
||||
[alt="Packaging status" link=https://repology.org/project/mastodonpp/versions]
|
||||
image::https://repology.org/badge/vertical-allrepos/mastodonpp.svg[]
|
||||
|
||||
=== Gentoo
|
||||
|
||||
[source,shell]
|
||||
--------------------------------------------------------------------------------
|
||||
eselect repository enable tastytea
|
||||
eselect repository enable guru
|
||||
echo 'dev-cpp/mastodonpp' >> /etc/portage/package.accept_keywords/mastodonpp
|
||||
emaint sync -r tastytea
|
||||
emaint sync -r guru
|
||||
emerge -a dev-cpp/mastodonpp
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
=== Arch
|
||||
|
||||
The git-version is available via the AUR:
|
||||
<https://aur.archlinux.org/packages/mastodonpp-git/>.
|
||||
|
||||
=== Debian and Ubuntu
|
||||
|
||||
We automatically generate packages for Debian buster (10) and Ubuntu bionic
|
||||
|
@ -160,4 +172,10 @@ cmake --build . -- -j$(nproc --ignore=1)
|
|||
|
||||
To create a deb or rpm package, run `make package` after compiling.
|
||||
|
||||
===== Windows
|
||||
|
||||
mastodonpp has been reported to compile with MinGW GCC, but
|
||||
`http_method::DELETE` has to be renamed, because Windows headers define a
|
||||
`DELETE` macro.
|
||||
|
||||
include::{uri-base}/raw/branch/main/CONTRIBUTING.adoc[]
|
||||
|
|
|
@ -22,7 +22,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"
|
|||
"-Wdouble-promotion"
|
||||
"-Wformat=2"
|
||||
"-ftrapv"
|
||||
"-fsanitize=undefined"
|
||||
"-Og"
|
||||
"-fno-omit-frame-pointer")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
|
@ -40,8 +39,13 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"
|
|||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT MINGW)
|
||||
list(APPEND DEBUG_CXXFLAGS
|
||||
"-fsanitize=undefined")
|
||||
endif()
|
||||
add_compile_options("$<$<CONFIG:Debug>:${DEBUG_CXXFLAGS}>")
|
||||
|
||||
if(NOT MINGW)
|
||||
set(DEBUG_LDFLAGS
|
||||
"-fsanitize=undefined")
|
||||
# add_link_options was introduced in version 3.13.
|
||||
|
@ -50,6 +54,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"
|
|||
else()
|
||||
add_link_options("$<$<CONFIG:Debug>:${DEBUG_LDFLAGS}>")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(STATUS
|
||||
"No additional compiler flags were set, "
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This file is part of mastodonpp.
|
||||
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
||||
* Copyright © 2020, 2021 tastytea <tastytea@tastytea.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
@ -71,7 +71,7 @@ parametermap answer_type::parse_pagination(const bool next) const
|
|||
return {};
|
||||
}
|
||||
|
||||
const auto direction{next ? R"(rel="next")" : R"(rel="prev")"};
|
||||
const string_view direction{next ? R"(rel="next")" : R"(rel="prev")"};
|
||||
auto endpos{link.find(direction)};
|
||||
endpos = link.rfind('>', endpos);
|
||||
auto startpos{link.rfind('?', endpos) + 1};
|
||||
|
|
|
@ -3,11 +3,16 @@ include(CTest)
|
|||
file(GLOB sources_tests test_*.cpp)
|
||||
|
||||
find_package(Catch2 CONFIG)
|
||||
if(Catch2_FOUND) # Catch 2.x
|
||||
if(Catch2_FOUND) # Catch 2.x / 3.x
|
||||
include(Catch)
|
||||
add_executable(all_tests main.cpp ${sources_tests})
|
||||
if(TARGET Catch2::Catch2WithMain) # Catch 3.x
|
||||
target_link_libraries(all_tests
|
||||
PRIVATE Catch2::Catch2WithMain ${PROJECT_NAME})
|
||||
else() # Catch 2.x
|
||||
target_link_libraries(all_tests
|
||||
PRIVATE Catch2::Catch2 ${PROJECT_NAME})
|
||||
endif()
|
||||
target_include_directories(all_tests PRIVATE "/usr/include/catch2")
|
||||
catch_discover_tests(all_tests EXTRA_ARGS "${EXTRA_TEST_ARGS}")
|
||||
else() # Catch 1.x
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This file is part of mastodonpp.
|
||||
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
||||
* Copyright © 2020, 2022 tastytea <tastytea@tastytea.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
@ -16,4 +16,9 @@
|
|||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
|
||||
// catch 3 does not have catch.hpp anymore
|
||||
#if __has_include(<catch.hpp>)
|
||||
# include <catch.hpp>
|
||||
#else
|
||||
# include <catch_all.hpp>
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This file is part of mastodonpp.
|
||||
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
||||
* Copyright © 2020, 2022 tastytea <tastytea@tastytea.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
@ -17,7 +17,12 @@
|
|||
#include "connection.hpp"
|
||||
#include "instance.hpp"
|
||||
|
||||
// catch 3 does not have catch.hpp anymore
|
||||
#if __has_include(<catch.hpp>)
|
||||
# include <catch.hpp>
|
||||
#else
|
||||
# include <catch_all.hpp>
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This file is part of mastodonpp.
|
||||
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
||||
* Copyright © 2020, 2022 tastytea <tastytea@tastytea.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
@ -16,7 +16,12 @@
|
|||
|
||||
#include "helpers.hpp"
|
||||
|
||||
// catch 3 does not have catch.hpp anymore
|
||||
#if __has_include(<catch.hpp>)
|
||||
# include <catch.hpp>
|
||||
#else
|
||||
# include <catch_all.hpp>
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This file is part of mastodonpp.
|
||||
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
||||
* Copyright © 2020, 2022 tastytea <tastytea@tastytea.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
@ -16,7 +16,12 @@
|
|||
|
||||
#include "instance.hpp"
|
||||
|
||||
// catch 3 does not have catch.hpp anymore
|
||||
#if __has_include(<catch.hpp>)
|
||||
# include <catch.hpp>
|
||||
#else
|
||||
# include <catch_all.hpp>
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
|
Loading…
Reference in New Issue
Block a user