oskarstark / doctor-rst
Fund package maintenance!
Requires
- php: ^8.5
- ext-ctype: *
- ext-iconv: *
- ext-mbstring: *
- composer/semver: ^3.4.4
- ondram/ci-detector: ^4.2.0
- symfony/config: ^7.4.4
- symfony/console: ^7.4.4
- symfony/dependency-injection: ^7.4.5
- symfony/finder: ^7.4.5
- symfony/options-resolver: ^7.4.0
- symfony/service-contracts: ^3.6.1
- symfony/string: ^7.4.4
- symfony/yaml: ^7.4.1
- webmozart/assert: ^2.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.49.0
- ergebnis/data-provider: ^3.6
- ergebnis/php-cs-fixer-config: ^6.59.0
- friendsofphp/php-cs-fixer: ^3.93.1
- icanhazstring/composer-unused: ^0.9.6
- maglnet/composer-require-checker: ^4.20.0
- mikey179/vfsstream: ^1.6.12
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.1.38
- phpstan/phpstan-phpunit: ^2.0.12
- phpstan/phpstan-webmozart-assert: ^2.0.0
- phpunit/phpunit: ^12.5.9
- rector/rector: ^2.3.5
- symfony/var-dumper: ^7.4.4
Replaces
- paragonie/random_compat: ^2.0
- symfony/polyfill-ctype: *
- symfony/polyfill-iconv: *
- symfony/polyfill-php56: *
- symfony/polyfill-php70: *
- symfony/polyfill-php71: *
- symfony/polyfill-php72: *
- symfony/polyfill-php73: *
- symfony/polyfill-php74: *
- symfony/polyfill-php80: *
- symfony/polyfill-php81: *
- symfony/polyfill-php82: *
- symfony/polyfill-php83: *
- symfony/polyfill-php84: *
- symfony/polyfill-php85: *
This package is auto-updated.
Last update: 2026-06-10 10:25:42 UTC
README
Lint your documentation against given rules.
Available rules
You can find the available rules here.
Usage
You can use it as a Github Action like this:
# .github/workflows/lint.yaml name: Lint on: push: pull_request: jobs: doctor-rst: name: DOCtor-RST runs-on: ubuntu-latest steps: - name: "Checkout code" uses: actions/checkout@v4 - name: DOCtor-RST uses: docker://oskarstark/doctor-rst with: args: --short --error-format=github
If your *.rst files are not located in root:
uses: docker://oskarstark/doctor-rst
with:
args: --short --error-format=github
+ env:
+ DOCS_DIR: 'docs/'
Error Formatter
-
detect (default) If running inside GithubActions CI environment,
githubis used, otherwiseconsole. -
github Used to annotate your pull requests.
-
console Used to generate a human readable output.
To force the usage of a specific formatter, use the --error-format option.
Use Caching to Speedup your GithubActions builds
steps:
- name: "Checkout"
uses: actions/checkout@v4
+ - name: "Create cache dir"
+ run: mkdir .cache
+
+ - name: "Extract base branch name"
+ run: echo "##[set-output name=branch;]$(echo ${GITHUB_BASE_REF:=${GITHUB_REF##*/}})"
+ id: extract_base_branch
+
+ - name: "Cache DOCtor-RST"
+ uses: actions/cache@v2
+ with:
+ path: .cache
+ key: doctor-rst-${{ runner.os }}-${{ steps.extract_base_branch.outputs.branch }}
+ restore-keys: |
+ doctor-rst-${{ runner.os }}-
+ doctor-rst-
+
- name: "Run DOCtor-RST"
uses: docker://oskarstark/doctor-rst
with:
- args: --short --error-format=github
+ args: --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache
Docker
A Docker-Image is built automatically and located here: https://cloud.docker.com/u/oskarstark/repository/docker/oskarstark/doctor-rst
You can run it in any given directory like this:
docker run --rm -it -e DOCS_DIR='/docs' -v ${PWD}:/docs oskarstark/doctor-rst:latest
Local usage
bin/doctor-rst analyze dummy --group=@Symfony
or
bin/doctor-rst analyze dummy --group=@Sonata
Todos
- Allow to register custom Rules
- Move logic from Command to Services