stamd

Static Markdown Page Generator
git clone git://git.dimitrijedobrota.com/stamd.git
Log | Files | Refs | README | LICENSE

commit 9fa65259932392378f0c05e045f95c009db79b79
parent f665400eb79cc3a3d141b757226852153d07b9b7
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Fri,  3 Jan 2025 20:14:40 +0100

Cleanup headers using misc-include-cleaner

Diffstat:
M.clang-tidy | 2++
MCMakeLists.txt | 2+-
Msource/article.cpp | 4+++-
Msource/article.hpp | 1-
Msource/indexer.cpp | 33++++++++++++++++++++-------------
Msource/indexer.hpp | 1+
Msource/main.cpp | 4++++
7 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/.clang-tidy b/.clang-tidy @@ -24,6 +24,8 @@ Checks: "*,\ " WarningsAsErrors: '' CheckOptions: + - key: 'misc-include-cleaner.IgnoreHeaders' + value: 'poafloc.*;md4c.*' - key: 'bugprone-argument-comment.StrictMode' value: 'true' # Prefer using enum classes with 2 values for parameters instead of bools diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -4,7 +4,7 @@ include(cmake/prelude.cmake) project( stamd - VERSION 0.2.9 + VERSION 1.2.10 DESCRIPTION "Static Markdown Page Generator" HOMEPAGE_URL "https://git.dimitrijedobrota.com/stamd.git" LANGUAGES CXX diff --git a/source/article.cpp b/source/article.cpp @@ -1,6 +1,8 @@ #include <format> #include <iostream> -#include <numeric> +#include <iterator> +#include <optional> +#include <string> #include "article.hpp" diff --git a/source/article.hpp b/source/article.hpp @@ -4,7 +4,6 @@ #include <set> #include <string> #include <unordered_map> -#include <vector> namespace stamd { diff --git a/source/indexer.cpp b/source/indexer.cpp @@ -1,15 +1,19 @@ #include <algorithm> #include <chrono> +#include <ctime> #include <format> -#include <fstream> -#include <numeric> -#include <sstream> +#include <iterator> +#include <memory> +#include <ostream> +#include <string> #include "indexer.hpp" #include <hemplate/attribute.hpp> #include <hemplate/classes.hpp> +#include "article.hpp" + namespace stamd { indexer::article_s& indexer::add(const article_s& article) @@ -32,16 +36,19 @@ std::tm get_time(const std::string& date) int month = 0; int day = 0; - std::sscanf(date.c_str(), "%d-%d-%d", &year, &month, &day); + std::sscanf(date.c_str(), "%d-%d-%d", &year, &month, &day); // NOLINT - tm time = { - .tm_sec = 0, - .tm_min = 0, - .tm_hour = 0, - .tm_mday = day, - .tm_mon = month - 1, - .tm_year = year - 1900, - }; + tm time = {.tm_sec = 0, + .tm_min = 0, + .tm_hour = 0, + .tm_mday = day, + .tm_mon = month - 1, + .tm_year = year - 1900, + .tm_wday = 0, + .tm_yday = 0, + .tm_isdst = 0, + .tm_gmtoff = 0, + .tm_zone = nullptr}; return time; } @@ -89,7 +96,7 @@ void indexer::create_index(std::ostream& ost, for (const auto& article : m_articles) { if (article->is_hidden()) continue; - if (name != "blog" && !article->get_categories().count(name)) continue; + if (name != "blog" && !article->get_categories().contains(name)) continue; const auto& filename = article->get_filename(); const auto& title = article->get_title(); diff --git a/source/indexer.hpp b/source/indexer.hpp @@ -2,6 +2,7 @@ #include <memory> #include <string> +#include <vector> #include "article.hpp" diff --git a/source/main.cpp b/source/main.cpp @@ -1,7 +1,11 @@ #include <filesystem> #include <fstream> #include <iostream> +#include <memory> #include <sstream> +#include <string> +#include <unordered_map> +#include <vector> #include <md4c-html.h> #include <poafloc/poafloc.hpp>