diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24ad1162ac..4d36ca077a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1157,21 +1157,6 @@ jobs: path: demos-diff retention-days: 30 - # Generate a static roadmap page from the git-tracked issue index. - # - # Output location: - # - Writes `build/website/roadmap/index.html`. - # - The generator may copy `styles.css` into `build/website/` if it's missing, - # so the report can reference `../styles.css`. - # - Since the website is published from `build/website`, this becomes - # `/roadmap/` on the deployed site. - - name: Generate Roadmap Report - if: env.PUBLISH_WEBSITE == 'true' - run: | - set -euvx - cd ${{ github.workspace }} - python -m util.roadmap report -o build/website/roadmap - - name: Publish Website to GitHub Pages if: env.PUBLISH_WEBSITE == 'true' uses: peaceiris/actions-gh-pages@v3 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..3502c3f477 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,61 @@ +# +# Licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# Copyright (c) 2025 Alan de Freitas (alandefreitas@gmail.com) +# +# Official repository: https://github.com/cppalliance/mrdocs +# + +# Codecov Configuration +# https://docs.codecov.com/docs/codecovyml-reference +# +# Patch Coverage Threshold Rationale +# ================================== +# +# We allow a small threshold for patch coverage NOT because reduced coverage +# is acceptable, but because some lines are inherently uncoverable and +# produce false positives: +# +# - Class declarations (e.g., `class Foo : public Bar`) +# - Struct declarations (e.g., `struct MyTest`) +# - Access specifiers (`public:`, `private:`) +# - Pure virtual method declarations +# - Opening/closing braces on their own lines +# +# These are not executable code - they don't generate machine instructions - +# yet coverage tools (gcov) report them as "uncovered lines." +# +# Preferred Solutions (in order) +# ------------------------------ +# +# 1st best: Configure gcov/lcov to exclude declarations from coverage +# tracking entirely, so they never appear as uncovered lines. +# This would eliminate false positives at the source. +# Status: Not currently available/configured. +# +# 2nd best: Use an absolute threshold (e.g., "allow up to 5 uncovered lines") +# rather than a percentage. This would be precise and predictable. +# Status: Codecov only supports percentage-based thresholds. +# +# 3rd best: Use a percentage-based threshold (what we implement below). +# The threshold is set small enough that any real logic +# (conditionals, loops, function bodies, error paths) that isn't +# covered will still trigger a failure. Only trivial declaration +# noise should pass through. +# +# With typical PR sizes, a 90% patch target achieves a similar effect to +# allowing ~5 uncovered lines in a 50-line change. + +coverage: + status: + # Project-wide coverage should not decrease + project: + default: + threshold: 1% + + # Patch coverage: only applies to new/modified lines in the PR + patch: + default: + target: 90% diff --git a/include/mrdocs/Generator.hpp b/include/mrdocs/Generator.hpp index 7c7c27f4ee..ffc2dd7b7e 100644 --- a/include/mrdocs/Generator.hpp +++ b/include/mrdocs/Generator.hpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) +// Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) // // Official repository: https://github.com/cppalliance/mrdocs // @@ -19,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -201,11 +203,50 @@ class MRDOCS_VISIBLE @param outputPath The specified output path, which can be a directory or file. @param extension The file extension to use for single-page output. */ +MRDOCS_DECL Expected getSinglePageFullPath( std::string_view outputPath, std::string_view extension); +/** Install a custom generator. + + This function registers a generator with the global + generator registry, making it available for use. + + Plugins can use this function to register custom + generators. + + @par Thread Safety + This function is thread-safe and may be called + concurrently from multiple threads. + + @return An error if a generator with the same id + already exists. + + @param G The generator to install. Ownership is + transferred to the registry. +*/ +MRDOCS_DECL +Expected +installGenerator(std::unique_ptr G); + +/** Find a generator by its id. + + @par Thread Safety + This function is thread-safe and may be called + concurrently from multiple threads. + + @return A pointer to the generator, or `nullptr` + if no generator with the given id exists. + + @param id The symbolic name of the generator. + The name must be an exact match, including case. +*/ +MRDOCS_DECL +Generator const* +findGenerator(std::string_view id) noexcept; + } // mrdocs diff --git a/share/mrdocs/addons/generator/html/layouts/wrapper.html.hbs b/share/mrdocs/addons/generator/html/layouts/wrapper.html.hbs index 0a78a0c2f5..71855f5c5c 100644 --- a/share/mrdocs/addons/generator/html/layouts/wrapper.html.hbs +++ b/share/mrdocs/addons/generator/html/layouts/wrapper.html.hbs @@ -49,6 +49,11 @@ {{#if page.hasDefaultStyles}}