Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First attempt to add Doctor-RST #341

Open
wants to merge 25 commits into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f358f8d
First attempt to add Doctor-RST
RCheesley Nov 3, 2024
bcaf477
Merge branch '5.x' into add-rst-linter
RCheesley Nov 3, 2024
f0b86e2
add config file
RCheesley Nov 3, 2024
826ee22
Merge branch 'add-rst-linter' of https://github.com/RCheesley/user-do…
RCheesley Nov 3, 2024
984e026
restrict doctor-rst to the changed files only
RCheesley Nov 3, 2024
2884a09
Remove caching for the moment
RCheesley Nov 3, 2024
6b624c9
Some fixes for using environment variables
RCheesley Nov 3, 2024
92fc838
Add back accidentally removed blocks
RCheesley Nov 3, 2024
98bf74a
Apply suggested change to take into account deprecated set-output com…
RCheesley Nov 3, 2024
29c9e7c
Purposely make an error to have a file to flag up
RCheesley Nov 3, 2024
4939f9a
Add extra step to address failure in GH Action
RCheesley Nov 3, 2024
348e4a0
Try different format for getting changed files
RCheesley Nov 3, 2024
cd195fb
Trying to address issues with command args
RCheesley Nov 3, 2024
7e73d8b
Address missing docs directory
RCheesley Nov 3, 2024
04a12c4
Try to restrict only to the files changed in this PR
RCheesley Nov 3, 2024
f6a6286
Fix incorrect path found for yaml file
RCheesley Nov 3, 2024
021416c
Can't use the config argument
RCheesley Nov 3, 2024
510ae2e
Address working directory
RCheesley Nov 3, 2024
cadb547
More tweaks
RCheesley Nov 3, 2024
4313081
Let's try simplifying this a bit
RCheesley Nov 3, 2024
7658e44
Add back the directory
RCheesley Nov 3, 2024
756b3c3
See if this works better
RCheesley Nov 3, 2024
6188079
🤔
RCheesley Nov 3, 2024
f1b7e42
😵‍💫
RCheesley Nov 3, 2024
35208e1
🤔
RCheesley Nov 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 77 additions & 34 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,89 @@ on:
jobs:
prose:
runs-on: ubuntu-22.04 # See https://github.com/errata-ai/vale-action/issues/128 before upgrading
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'

- name: Install Python dependencies
run: pip3 install -r docs/requirements.txt

- name: Vale
uses: errata-ai/vale-action@reviewdog
with:
# Please keep version in sync with the version in .gitpod.Dockerfile for a consistent experience
version: 3.7.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'

- name: Install Python dependencies
run: pip3 install -r docs/requirements.txt

- name: Vale
uses: errata-ai/vale-action@reviewdog
with:
# Please keep version in sync with the version in .gitpod.Dockerfile for a consistent experience
version: 3.7.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'

- name: Install Python dependencies
run: pip3 install -r docs/requirements.txt
- name: Install Python dependencies
run: pip3 install -r docs/requirements.txt

- name: Build docs
working-directory: docs
run: make html
- name: Build docs
working-directory: docs
run: make html

- name: Check links
working-directory: docs
run: make checklinks

doctor_rst:
runs-on: ubuntu-latest
steps:
- name: Checkout Current Branch
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensures full history is fetched

- name: Extract base branch name
id: extract_base_branch
run: echo "branch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" >> $GITHUB_ENV

- name: Get changed files
id: changed_files
run: |
git fetch origin ${{ env.branch }}:refs/remotes/origin/${{ env.branch }}
git diff --name-only origin/${{ env.branch }}...HEAD > changed_files.txt

- name: "Create cache dir"
run: mkdir .cache

- name: "Cache DOCtor-RST"
uses: actions/cache@v3
with:
path: .cache
key: ${{ runner.os }}-doctor-rst-${{ env.branch }}

- name: Check links
working-directory: docs
run: make checklinks
- name: "Run DOCtor-RST"
env:
DOCS_DIR: 'docs/'
run: |
if [ -s changed_files.txt ]; then
xargs -a changed_files.txt docker run --rm -v $(pwd):/github/workspace oskarstark/doctor-rst:1.61.1 --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache
else
echo "No changed files to analyze."
fi

69 changes: 69 additions & 0 deletions docs/.doctor-rst.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
rules:
american_english: ~
avoid_repetetive_words: ~
be_kind_to_newcomers: ~
blank_line_after_anchor: ~
blank_line_after_colon: ~
blank_line_after_directive: ~
blank_line_before_directive: ~
blank_line_after_filepath_in_code_block: ~
blank_line_after_filepath_in_php_code_block: ~
blank_line_after_filepath_in_twig_code_block: ~
composer_dev_option_not_at_the_end: ~
correct_code_block_directive_based_on_the_content: ~
deprecated_directive_should_have_version: ~
ensure_bash_prompt_before_composer_command: ~
ensure_correct_format_for_phpfunction: ~
ensure_exactly_one_space_before_directive_type: ~
ensure_exactly_one_space_between_link_definition_and_link: ~
ensure_explicit_nullable_types: ~
ensure_github_directive_start_with_prefix:
prefix: 'Mautic'
ensure_link_bottom: ~
ensure_link_definition_contains_valid_url: ~
ensure_order_of_code_blocks_in_configuration_block: ~
ensure_php_reference_syntax: ~
extend_abstract_controller: ~
filename_uses_underscores_only: ~
indention: ~
lowercase_as_in_use_statements: ~
max_blank_lines:
max: 2
max_colons: ~
no_app_console: ~
no_attribute_redundant_parenthesis: ~
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_duplicate_use_statements: ~
no_footnotes: ~
no_inheritdoc: ~
no_merge_conflict: ~
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: ~
remove_trailing_whitespace: ~
replace_code_block_types: ~
replacement: ~
short_array_syntax: ~
space_between_label_and_link_in_doc: ~
space_between_label_and_link_in_ref: ~
string_replacement: ~
title_underline_length_must_match_title_length: ~
typo: ~
unused_links: ~
use_deprecated_directive_instead_of_versionadded: ~
use_named_constructor_without_new_keyword_rule: ~
use_https_xsd_urls: ~
valid_inline_highlighted_namespaces: ~
valid_use_statements: ~
versionadded_directive_should_have_version: ~
yaml_instead_of_yml_suffix: ~
2 changes: 1 addition & 1 deletion docs/companies/companies_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Companies are a way to group Contacts based on association with organizations.
:alt: Mautic Company Overview

Engagements/Points chart
*************************
***********************

Engagements shown on the chart include any tracked action the Contacts made. Some examples might include page hits, Form submissions, Email opens and so on. The engagements line chart displays how active the Contacts of the Company were in the past 6 months. The chart displays also the sum of Points the Contacts received.

Expand Down
Loading