Hello everyone,
After the release of 10.48 I feel that I’d like to make a few slightly disruptive changes, while everything is peaceful.
I have three things which I have been putting off, because it didn’t feel like the right moment.
Firstly, I am going to delete the old Windows RunTest.bat, RunGrepTest.bat files. These have been a real pain to maintain, because the Windows bat quoting rules keep causing trouble; the syntax is hard to test; and newline issues make it quite brittle and hard to keep in sync with the Unix shell scripts.
As a replacement, I have created RunTest.py and RunGrepTest.py. These are cross-platform and identical in behaviour to the shell scripts. They must be used on Windows, and can optionally be used on other platforms. I am not proposing (at this time) to remove the shell scripts and force all Unix/Mac/Linux clients to use Python.
The main downside is that Windows clients now need to have Python installed – unless of course they turn off the tests (with PCRE2_BUILD_TESTS=OFF in CMake). This does not seem like a very difficult requirement to impose on consumers. (In fact - requiring Python for the Unix test suite would be quite normal in many projects.)
In the future, having a Python test harness could allow us to do more flexible testing, with a wider choice of test suites, and libraries such as fuzzers or other pieces of test tooling.
Secondly, I plan to reformat the codebase. I know it’s silly! However, the last time we discussed it, I think we agreed that a slightly more contemporary style could be more welcoming for new contributors. I will do this in two passes. I have a short Clang-format config for ‘regularising’ the current formatting. It affects fewer than 10% of the lines of code, but leaves the current bracing style intact. Because the changes don’t affect all the lines, I can read the diff and ensure that it’s not too ugly.
The second pass will then be a mass re-indentation of braces. I have a small and stupid Python script for that, which mechanically adjusts lines that start with whitespace followed by brace, and also recognises ‘case…:’ and ‘default:’ at line start.
The end result will match my (our) Clang-format style exactly.
I hope to maintain the character and overall style of the code. The bulk change is simply moving the braces around.
Thirdly, I intend to reformat the manpage documentation as Asciidoc source. This is a format which is simpler than Sphinx/reStructuredText, and richer than Markdown. I will start by taking each manpage, and turning it into an Asciidoc file (one file to one file). The words and content will not change.
Asciidoc will then be the primary source, and we will use its CLI tool to derive the HTML and manpage output. The actual files we ship should be nearly identical to the current ones. Hopefully, some of the formatting may be a little prettier (and certainly not uglier).
Asciidoc is used to generate the ‘man git’ manpages, and the Git official website, as well as other well-known OSS projects.
In the future, this should let us write new documentation much more easily, and reorganise the website with more content.
It is hard to write a modern website that’s well-formatted and easy to navigate, using the roff/man syntax.
In conclusion, all these changes are relatively mechanical, and tool-driven. It’s not an AI rewrite. However, it will generate some very large diffs.
Please do let me know any feedback you have, or preferences.
I am likely to do all three of these, unless someone has a strong preference or convinces me otherwise.
All the best,
Nick
--
You received this message because you are subscribed to the Google Groups "PCRE2 discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pcre2-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pcre2-dev/784dfae3-3f66-4fff-b6ae-097a416ccfc0n%40googlegroups.com.