Add a Github Action to lint the docs

This commit is contained in:
Guilhem Niot 2022-05-12 23:33:53 +02:00
parent d27cc8fc3b
commit 5195058abb
2 changed files with 107 additions and 0 deletions

74
.doctor-rst.yaml Normal file
View File

@ -0,0 +1,74 @@
rules:
american_english: ~
avoid_repetetive_words: ~
blank_line_after_anchor: ~
blank_line_after_directive: ~
blank_line_before_directive: ~
composer_dev_option_not_at_the_end: ~
correct_code_block_directive_based_on_the_content: ~
deprecated_directive_should_have_version: ~
ensure_exactly_one_space_between_link_definition_and_link: ~
ensure_link_definition_contains_valid_url: ~
ensure_order_of_code_blocks_in_configuration_block: ~
extend_abstract_controller: ~
extension_xlf_instead_of_xliff: ~
indention: ~
lowercase_as_in_use_statements: ~
max_blank_lines:
max: 2
max_colons: ~
no_app_console: ~
no_blank_line_after_filepath_in_php_code_block: ~
no_blank_line_after_filepath_in_twig_code_block: ~
no_blank_line_after_filepath_in_xml_code_block: ~
no_blank_line_after_filepath_in_yaml_code_block: ~
no_brackets_in_method_directive: ~
no_composer_req: ~
no_directive_after_shorthand: ~
no_explicit_use_of_code_block_php: ~
no_inheritdoc: ~
no_namespace_after_use_statements: ~
no_php_open_tag_in_code_block_php_directive: ~
no_space_before_self_xml_closing_tag: ~
only_backslashes_in_namespace_in_php_code_block: ~
only_backslashes_in_use_statements_in_php_code_block: ~
ordered_use_statements: ~
php_prefix_before_bin_console: ~
replace_code_block_types: ~
replacement: ~
short_array_syntax: ~
space_between_label_and_link_in_doc: ~
space_between_label_and_link_in_ref: ~
string_replacement: ~
typo: ~
unused_links: ~
use_deprecated_directive_instead_of_versionadded: ~
use_https_xsd_urls: ~
valid_inline_highlighted_namespaces: ~
valid_use_statements: ~
versionadded_directive_should_have_version: ~
yaml_instead_of_yml_suffix: ~
yarn_dev_option_at_the_end: ~
# no_app_bundle: ~
# master
versionadded_directive_major_version:
major_version: 5
versionadded_directive_min_version:
min_version: '5.0'
deprecated_directive_major_version:
major_version: 5
deprecated_directive_min_version:
min_version: '5.0'
# do not report as violation
whitelist:
regex:
- '/``.yml``/'
lines:
- '.. code-block:: twig'
- '// bin/console'
- '.. code-block:: php'

33
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: CI
on:
push: ~
pull_request: ~
jobs:
doctor-rst:
name: Lint (DOCtor-RST)
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- 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: ${{ runner.os }}-doctor-rst-${{ steps.extract_base_branch.outputs.branch }}
- name: "Run DOCtor-RST"
uses: docker://oskarstark/doctor-rst
with:
args: --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache