doxygen: rewrite set_canonical_doxygen.py in Perl #8736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue #8735
The Perl script ends up slightly longer than the Python version. Using
Tie::File
would add brevity, it however has issues withUTF-8
encoded files. Mostdoxygen
files areascii
encoded, but on my system (Ubuntu 18.04) there were someutf8
encoded as well.The Perl version also correctly appends the canonical link precisely once; the Python version would not do this, due to setting the
canonical_link_added
inside the loop toFalse
at every iteration.I wasn't sure on style guidelines for Perl scripts, and as far as I know
clang-format
only applies toC++
source files. As such, I tried following the style of the other Perl scripts in thedoc/doxygen/scripts
directory.This is a draft pull request since I'm still building and comparing all doxygen created files between
set_canonical_doxygen.py
andset_canonical_doxygen.pl
(and some remarks pointed out below).