Commit graph

8 commits

Author SHA1 Message Date
hakre
1668a1602a
Improve php-src docs sphinx build, also on *nix (GH-16743)
* Document .rst file maximum line length of 100

In 19d2b84788 ("Create book for docs", 2024-01-30) the build of the
php-src documentation has been introduced.

It is based on reStructuredText (rst) [Docutils] for its source files,
this stems from the sphinx-build utility in use to build the static HTML
pages of the php-src documentation.

The maximum line length of these text files has been set to 100
characters in 19d2b84788 ("Create book for docs", 2024-01-30), the
rationale is unknown to the documenting author at time of writing this
message.

This formatting constraint is applied with the rstfmt utility [rstfmt]
via its invocation (documented in CI build instructions and README.md:)

    rstfmt -w 100 source

The `-w, --width` option takes a WIDTH argument that is "the
target line length in characters" (cf. `rstfmt --help`.)

There is also an `--ext EXT` argument option, that is "the extension of
files to look at when passed a directory" ("source" is the name of
a directory in the invocation above) and defaults to "rst".

Henceforth, the editor configuration [EditorConfig] can benefit from
documenting this expectation in the repositories .editorconfig file,
which has been introduced already earlier in 5c38fbe543 ("Added
editorconfig file", 2016-06-26).

[Docutils]: https://docutils.sourceforge.io/index.html "Docutils: Documentation Utilities — Written in Python, for General- and Special-Purpose Use"
[rstfmt]: https://github.com/dzhu/rstfmt "A formatter for reStructuredText"
[EditorConfig]: https://editorconfig.org/ "EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs"

* Makefile for php-src docs build

In 19d2b84788 ("Create book for docs", 2024-01-30) the php-src
documentation (php-src docs) build has been introduced, yet the build
instructions, namely `make html`, did not yield the expected results
within the parenting setup of the php-src project on *nix systems.

The reason is that the `make html` build instruction does not execute
the make.bat file which contains the recipe to build the static HTML
pages.

It is an unused leftover file from initializing the project with
sphinx-quickstart. [1]

Removing it in and adding a Makefile suffices to recover the build of
php-src ./docs on a *nix system.

Formatting constraints checked in the docs workflow in CI update
use the make file to make sure the commands stay consistent and the
build is managed by the build manager.

[1]: https://www.sphinx-doc.org/en/master/man/sphinx-quickstart.html "sphinx-quickstart is an interactive tool that asks some questions about your project and then generates a complete documentation directory and sample Makefile to be used with sphinx-build(1)."

* Bind requirements.txt for php-src docs build

Define the required packages to install for the php-src docs build in
the docs/requirements.txt file:

1) Sphinx
2) sphinx-design
3) sphinxawesome-theme
4) rstfmt

This should also later on ease the use of a requirements_frozen.txt
file to pin the build dependencies if needed/wanted.

Additionally, some formatting corrections in README.md (based on the
profile in .editorconfig) as well as adding the recommendation to use
a Python virtual environment. Python3 and Pip were already named, and
with Python3 there is the venv module (Python 3.3; Sep 2012) to manage
these so-called python virtual environments [venv], which are commonly
a preferred way to install dependencies within development projects
and build systems.

[venv]: https://docs.python.org/3/library/venv.html "venv — Creation of virtual environments — Python documentation"

* Remove deprecated theme configuration

For the configured Awesome Sphinx Theme [1] highlighting extension, the
sphinx-build currently yields the following diagnostics:

     WARNING: while setting up extension sphinxawesome_theme.highlighting: \
     You no longer have to include the `sphinxawsome_theme.highlighting` \
     extension. This extension will be removed in the next major release.

(via `make html`, the configuration file is `source/conf.py`.)

The diagnostic message was introduced by sphinxawesome-theme 5.2.0,
  released May 31, 2024. [2], [3]

Removing the extension from the list of extensions in the configuration
file levitates.

No changes to requirements.txt, the extension was transitive as bundled
by the Awesome Sphinx Theme [1], and 5.2.0 deprecates it with the new
feature to "Support `pygments_style_dark` option that allows you to set
a different syntax highlighting scheme in light and dark modes." [3]

[1]: https://sphinxawesome.xyz/ "Awesome Sphinx Theme — Create functional and beautiful websites for your documentation with Sphinx."
[2]: https://pypi.org/project/sphinxawesome-theme/5.2.0/#history
[3]: https://github.com/kai687/sphinxawesome-theme/releases/tag/5.2.0
2024-11-29 19:29:00 +01:00
Arnaud Le Blanc
f2381ae4ba
Fix JIT crash with large number of match/switch arms (#8961)
Switch statements may generate a large number of exit points. Once the max
number of exit points is reached, get_exit_addr() returns NULL. This was not
checked, and this resulted in a jump table with some 0 addresses.
2022-07-18 12:34:20 +02:00
Peter Kokot
ef165b4422 Remove build.mk usage
First step when creating the `configure` script is currently using
make. This is helpful when developing buildsystem to only rebuild
`configure` and `main/php_config.h.in` files when one of the *.m4
or configure.ac file changes and saves the developer time a little.

Realistically however, it is not needed that much considering the
times of several seconds to fully rebuild the configure script and
configuration header. The next step when running the `configure`
script is much more time consuming so performance on buildconf
level is a bit questionable and won't be noticed on today's
systems.

Additionally:
- buildconf now removes cache and all targets and uses -f option on
  the first step i.e. autoconf. The autoheader does not need the -f
  option in this case.

Closes GH-4437
2019-07-21 11:40:23 +02:00
Peter Kokot
65ada39360 Extend wildcard files section in EditorConfig [ci skip]
Changes:
- Trim trailing whitespace for all files except patches. There isn't
  really any practical reason to not trim the trailing whitespace in all
  other files. Binary files or phpt files that include trailing
  whitespace as part of the test should be manually set in editors/IDEs
  or by disabling the editorconfig for particular editing.
- Add *.ac, *.d, *.l, *.skl, *.re, *.wsdl, *.dtd, *.html, *.rng, *.xml,
  *.xsd, *.xsl, buildconf, and Makefile* files settings.

Closes #4156
2019-06-09 22:53:58 +02:00
Peter Kokot
488544b336 Update editorconfig
Changes:
- New property max_line_length
- COMMIT_EDITMSG file added when writing commit messages
- Markdown files can have trimmed trailing whitespace also to simplify
  settings.
- https link used to EditorConfig page.
- Added also *.y, *.cpp, and *.inc files
- The tab_width moved to a new all files section
2019-03-07 01:03:56 +01:00
Peter Kokot
aa143515d6
Update .editorconfig with some more configs
Added support for .awk, .w32, .bat, .mk, .frag, .m4, .sh, .php, .phpt,
and Markdown files based on the current most used coding style in the
php-src repository.
2017-10-19 11:53:37 +01:00
Nikita Popov
b92cb6b238 Limit editorconfig to C code
PHPT files do not follow this.

[ci skip]
2016-09-05 14:22:13 +02:00
Richard Fussenegger
5c38fbe543 Added editorconfig file 2016-09-05 00:40:58 -07:00