Skip to content

Fix #15276 (manual: improve the build) - #9079

Merged
danmar merged 4 commits into
cppcheck-opensource:mainfrom
cppchecksolutions:fix-15276
Nov 27, 2026
Merged

danmar merged 4 commits into
cppcheck-opensource:mainfrom
cppchecksolutions:fix-15276

Conversation

@danmar

@danmar danmar commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@danmar
danmar marked this pull request as ready for review November 27, 2026 12:02
danmar and others added 2 commits November 27, 2026 13:06
Lua filters, make-appendix.sh and the metadata files for the open source
and premium manuals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danmar danmar added the ai-assisted contains code which was written with the assistance of AI - please review extra carefully label Nov 27, 2026

@dmcppcheck dmcppcheck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review

This PR only changes the documentation build: shell scripts, Lua pandoc filters and the CI workflow. No C/C++ code is touched. I found one new issue, and I could not confirm it because pandoc is not installed here. Some checker docs that are now pulled into the manual have unescaped <...> in prose. Pandoc reads these as raw HTML, so they vanish from the PDF and are hidden in the HTML. For example, the checkLibraryUseIgnore message would read "Function f() should have / configuration". Merging manual-premium.md into manual.md loses no text: diffing the new manual.md against the old manual-premium.md shows only the expected conditional blocks and the moved title/author. I found no other problems.

Comments

# Comment By Where Status
1 Unescaped , , in included checker docs vanish from the manual AI review man/filters/manual.lua:150 🆕 New

@danmar, please fix, resolve or reply to the open and new comments: #1.

Testing

  • I didn't build cppcheck or run testrunner, because the PR changes no C/C++, GUI or test code.
  • pandoc, xelatex, lua and shellcheck are not installed, so I could not build the manuals or run the Lua filters. Everything below about filter behaviour comes from reading the code.
  • sh -n passes on build-pdf.sh, build-html.sh, buildman.sh and make-appendix.sh.
  • ./make-appendix.sh "Checkers" checkers/*.md produces 318 included-file Divs. All Div ids are unique, and no two checker file names differ only in case.
  • Every relative *.md link inside man/checkers points to a file that exists, so document() in manual.lua can resolve them all. None of these links has an anchor fragment.
  • I diffed pr/man/manual.md against base/man/manual-premium.md. Apart from the title/author front matter, which moved to the yaml files, the only differences are the content-visible wrappers: the opensource-only misra.py section and the premium-only block at the end. So no premium content was lost.
  • Nothing else in the repo (CMake, release scripts, other workflows) refers to manual-premium.md or builds manual.md.
  • I scanned the checker docs for <tag> text outside code blocks and inline code, ignoring <br/>:
    checkers/checkLibraryUseIgnore.md:3: **Message**: --check-library: Function f() should have <use>/<leak-ignore> configuration<br/>
    checkers/leakUnsafeArgAlloc.md:3: **Message**: Unsafe allocation. If shared_ptr() throws, memory could be leaked. Use make_shared<T>() instead.<br/>
    checkers/unreadVariable.md:44:   #include <mutex>
    
    I could not render these, because pandoc is missing.

Automated review of b2deedc by Claude. The pull request was built and tested locally.

Comment thread man/filters/manual.lua Resolved
Pandoc treats <use>, <leak-ignore> and <T> as raw html and drops them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@dmcppcheck dmcppcheck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review

This PR only changes the documentation build: shell scripts, Lua pandoc filters, the buildman workflow and some checker docs. No C/C++ code is touched. I found no new problems. The earlier comment about <use>, <leak-ignore> and <T> in checker messages is fixed: both messages are now in backticks. The third example in that comment, #include <mutex> in unreadVariable.md, was already inside a fenced code block within a list item, so it was never affected. I could not render the manuals, because pandoc, LaTeX and Lua are not available in the container. Everything about the filters' behaviour below comes from reading the code.

Comments

# Comment By Where Status
1 Unescaped , , in included checker docs are dropped as raw HTML AI review man/filters/manual.lua:150 ✅ Fixed

Testing

  • I didn't build cppcheck or testrunner, because the PR changes no C/C++, GUI or test code.
  • pandoc, xelatex, lua and shellcheck are not installed, so the manuals could not be built and the Lua filters could not be run.
  • I scanned man/checkers/*.md for <tag> text in prose, skipping fenced code, indented code and inline code. The only hit is #include <mutex> in unreadVariable.md:44, and that line is inside a fenced code block within a list item, so pandoc treats it as code. The two messages from the earlier comment are now in backticks.
  • Every checker doc starts with a # heading except premium-misra-config.md, which now starts with the content-visible Div. Its heading is still the first heading inside the Div, so the "first heading is numbered" logic in included_file still works.
  • All relative links in the checker docs point to *.md files with no anchors. After include-files.lua prefixes them with checkers/, file_id() in manual.lua ([^%w] → -) gives the same ids as the sed 's/[^A-Za-z0-9]/-/g' in make-appendix.sh, so the links resolve to the included-file Divs.
  • No doc links to premium-misra-config.md, so in the open source manual no link points to its now-empty Div.
  • manual.md has only one internal anchor link (#the-error-element), and it is not inside the profile-conditional blocks.

Automated review of 853d338 by Claude. The pull request was built and tested locally.

@danmar
danmar merged commit 95fea78 into cppcheck-opensource:main Nov 27, 2026
74 checks passed
@danmar
danmar deleted the fix-15276 branch November 27, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted contains code which was written with the assistance of AI - please review extra carefully

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants