Skip to content

Commit

Permalink
Add RST spellcheck (#524)
Browse files Browse the repository at this point in the history
* Add docs spelling check
* Add codespell config to noxfile and ci
* Update README with details on spelling checks

Co-authored-by: Maxwell G <[email protected]>
  • Loading branch information
oraNod and gotmax23 authored Oct 16, 2023
1 parent b9323fb commit 2f8810b
Show file tree
Hide file tree
Showing 28 changed files with 121 additions and 47 deletions.
15 changes: 15 additions & 0 deletions .codespellignorelines
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file contains exact lines ignored by the spelling check.
$ ssh-add ~/.ssh/keypair.pem
shell: echo "disable server myapplb/{{ inventory_hostname }}" | socat stdio /var/lib/haproxy/stats
shell: echo "enable server myapplb/{{ inventory_hostname }}" | socat stdio /var/lib/haproxy/stats
"ro": true,
"options": "ro,relatime,mode=0700",
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
IAM policies for AWS
for managing IAM roles, users and groups.
see the `Active Directory Certificate Services documentation <https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc732625(v=ws.11)>`_.
`Act as part of the operating system <https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn221957(v=ws.11)>`_.
`Accounts: Limit local account use of blank passwords to console logon only <https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/jj852174(v=ws.11)>`_
role_type: ANS
# => "$6$43927$lQxPKz2M2X.NWO.gK.t7phLwOKQMcSq72XxDZQ0XzYV6DlL1OD72h417aj16OnHTGxNzhftXJQBcjbunLEepM0"
table#network-platform-table thead tr th.head {
4 changes: 4 additions & 0 deletions .codespellignorewords
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file contains words ignored by the spelling check.
aci
falsy
doas
8 changes: 8 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[codespell]
skip = _build,collections,*.po,_static,porting_guide*,style_guide
count =
check-filenames = true
quiet-level = 3
ignore-words = .codespellignorewords
exclude-file = .codespellignorelines
builtin = clear,code,en-GB_to_en-US,informal,names,rare
1 change: 1 addition & 0 deletions .github/workflows/pip-compile-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ jobs:
-e 'pip-compile-3.10(formatters)'
'pip-compile-3.10(typing)'
'pip-compile-3.10(static)'
'pip-compile-3.10(spelling)'
reset-branch: "${{ inputs.reset-branch || false }}"
2 changes: 2 additions & 0 deletions .github/workflows/reusable-nox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
python-versions: "3.11"
- session: typing
python-versions: "3.11"
- session: spelling
python-versions: "3.11"
name: "Run nox ${{ matrix.session }} session"
steps:
- name: Check out repo
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ This repository holds the ReStructuredText (RST) source, and other files, for us

Follow the documentation to [set up your environment](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#setting-up-your-environment-to-build-documentation-locally) and then [build Ansible community documentation locally](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#building-the-documentation-locally)

## Using nox

This project includes a `nox` configuration to automate checks and other functions.
You should use `nox` to run checks locally before you submit a pull request.

Install `nox` using `python3 -m pip install nox` or your distribution's package manager.

Run `nox --list` from the repository root to view available sessions.

Run `nox` with no arguments to execute the default sessions.

## Running the spelling check

This repository uses [`codespell`](https://github.com/codespell-project/codespell) to check for common spelling mistakes in the documentation source.

Run `nox -s spelling` to check spelling.

Run `nox -s spelling -- -w` to correct spelling errors.

When `codespell` suggests more than one word as a correction, run `nox -s spelling -- -w -i 3` to select an option.

## Updating the dependencies

To update dependencies, you can use `nox -e pip-compile`. Since this requires Python 3.10, this might not work in your environment if you do not have Python 3.10 installed. In that case, you can use root-less podman with a Python 3.10 image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ When users report bugs, verify the behavior reported. Remember always to be kind
* Did the user assume an unexpected behavior? Ensure that the related documentation is clear. If not, the issue is useful to help us improve documentation.
* Is there a minimal reproducer? If not, ask the reporter to reduce the complexity to help pinpoint the issue.
* Is the issue a consequence of a misconfigured environment?
* If it seems to be a real bug, does the behaviour still exist in the most recent release or the development branch?
* If it seems to be a real bug, does the behavior still exist in the most recent release or the development branch?
* Reproduce the bug, or if you do not have a suitable infrastructure, ask other contributors to reproduce the bug.


Expand Down
6 changes: 3 additions & 3 deletions docs/docsite/rst/community/committer_guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ As a committer, you may already know this, but our workflow forms a lot of our t
Addendum to workflow for committers:
------------------------------------

The Core Team is aware that this can be a difficult process at times. Sometimes, the team breaks the rules by making direct commits or merging their own pull requests. This section is a set of guidelines. If you are changing a comma in documentation, or making a very minor change, you can use your best judgement. This is another trust thing. The process is critical for any major change, but for little things or getting something done quickly, use your best judgement and make sure people on the team are aware of your work.
The Core Team is aware that this can be a difficult process at times. Sometimes, the team breaks the rules by making direct commits or merging their own pull requests. This section is a set of guidelines. If you are changing a comma in documentation, or making a very minor change, you can use your best judgment. This is another trust thing. The process is critical for any major change, but for little things or getting something done quickly, use your best judgment and make sure people on the team are aware of your work.

Roles on Core
=============
* Core committers: Fine to do pull requests for most things, but we should have a timebox. Hanging pull requests may merge on the judgement of these developers.
* Core committers: Fine to do pull requests for most things, but we should have a timebox. Hanging pull requests may merge on the judgment of these developers.
* :ref:`Module maintainers <maintainers>`: Module maintainers own specific modules and have indirect commit access through the current module pull request mechanisms.
* :ref:`Collection maintainers <maintainers>`: Collection maintainers own specific collections and have commit access to them. Each collection can set its own rules for contributions.

.. _committer_general_rules:

General rules
=============
Individuals with direct commit access are entrusted with powers that allow them to do a broad variety of things--probably more than we can write down. Rather than rules, treat these as general *guidelines*, individuals with this power are expected to use their best judgement.
Individuals with direct commit access are entrusted with powers that allow them to do a broad variety of things--probably more than we can write down. Rather than rules, treat these as general *guidelines*, individuals with this power are expected to use their best judgment.

* Do NOT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ Publishing a collection from the website
To publish your collection directly on the Galaxy website:

#. Go to the `My Content <https://galaxy.ansible.com/my-content/namespaces>`_ page, and click the **Add Content** button on one of your namespaces.
#. From the **Add Content** dialogue, click **Upload New Collection**, and select the collection archive file from your local filesystem.
#. From the **Add Content** dialog, click **Upload New Collection**, and select the collection archive file from your local filesystem.

When you upload a collection, Ansible always uploads the tarball to the namespace specified in the collection metadata in the ``galaxy.yml`` file, no matter which namespace you select on the website. If you are not an owner of the namespace specified in your collection metadata, the upload request fails.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ options set:
- ``default``: The default value for the module option if not set
- ``deprecated_aliases``: A list of hashtables that define aliases that are deprecated and the versions they will be removed in. Each entry must contain the keys ``name`` and ``collection_name`` with either ``version`` or ``date``
- ``elements``: When ``type=list``, this sets the type of each list value, the values are the same as ``type``
- ``no_log``: Will sanitise the input value before being returned in the ``module_invocation`` return value
- ``no_log``: Will sanitize the input value before being returned in the ``module_invocation`` return value
- ``removed_in_version``: States when a deprecated module option is to be removed, a warning is displayed to the end user if set
- ``removed_at_date``: States the date (YYYY-MM-DD) when a deprecated module option will be removed, a warning is displayed to the end user if set
- ``removed_from_collection``: States from which collection the deprecated module option will be removed; must be specified if one of ``removed_in_version`` and ``removed_at_date`` is specified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Ansible has a thriving and knowledgeable community of module developers that is
In the :ref:`ansible_community_guide` you can find how to:

* Subscribe to the Mailing Lists - We suggest "Ansible Development List" and "Ansible Announce list"
* ``#ansible-devel`` - We have found that communicating on the ``#ansible-devel`` chat channel (using Matrix at ansible.im or using IRC at `irc.libera.chat <https://libera.chat/>`_) works best for developers so we can have an interactive dialogue.
* ``#ansible-devel`` - We have found that communicating on the ``#ansible-devel`` chat channel (using Matrix at ansible.im or using IRC at `irc.libera.chat <https://libera.chat/>`_) works best for developers so we can have an interactive dialog.
* Working group and other chat channel meetings - Join the various weekly meetings `meeting schedule and agenda page <https://github.com/ansible/community/blob/main/meetings/README.md>`_

Required files
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/dev_guide/developing_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Here's a simple lookup plugin implementation --- this lookup returns the content
required: True
option1:
description:
- Sample option that could modify plugin behaviour.
- Sample option that could modify plugin behavior.
- This one can be set directly ``option1='x'`` or in ansible.cfg, but can also use vars or environment.
type: string
ini:
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/dev_guide/migrating_roles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Migrating Roles to Roles in Collections on Galaxy
*************************************************

You can migrate any existing standalone role into a collection and host the collection on Galaxy. With Ansible collections, you can distribute many roles in a single cohesive unit of re-usable automation. Inside a collection, you can share custom plugins across all roles in the collection instead of duplicating them in each role's :file:`library/`` directory.
You can migrate any existing standalone role into a collection and host the collection on Galaxy. With Ansible collections, you can distribute many roles in a single cohesive unit of reusable automation. Inside a collection, you can share custom plugins across all roles in the collection instead of duplicating them in each role's :file:`library/`` directory.

You must migrate roles to collections if you want to distribute them as certified Ansible content.

Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/playbook_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This guide introduces you to playbooks and then covers different use cases for t
* Running conditional tasks and evaluating conditions with playbook tests.
* Using blocks to group sets of tasks.

You can also learn how to use Ansible playbooks more effectively by using collections, creating re-usable files and roles, including and importing playbooks, and running selected parts of a playbook with tags.
You can also learn how to use Ansible playbooks more effectively by using collections, creating reusable files and roles, including and importing playbooks, and running selected parts of a playbook with tags.

.. toctree::
:maxdepth: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ This is inefficient and, at scale, means more maintenance. To incorporate the ve
- "ToDo_App"
- *my_version
Now, you can re-use the value of ``app_version`` within the value of ``custom_name`` and use the output in a template:
Now, you can reuse the value of ``app_version`` within the value of ``custom_name`` and use the output in a template:

.. code-block:: yaml
Expand Down
6 changes: 3 additions & 3 deletions docs/docsite/rst/playbook_guide/playbooks_conditionals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ You can provide your own facts, as described in :ref:`developing_modules`. To r
.. _when_with_reuse:

Conditionals with re-use
Conditionals with reuse
------------------------

You can use conditionals with re-usable tasks files, playbooks, or roles. Ansible executes these conditional statements differently for dynamic re-use (includes) and for static re-use (imports). See :ref:`playbooks_reuse` for more information on re-use in Ansible.
You can use conditionals with reusable tasks files, playbooks, or roles. Ansible executes these conditional statements differently for dynamic reuse (includes) and for static reuse (imports). See :ref:`playbooks_reuse` for more information on reuse in Ansible.

.. _conditional_imports:

Expand Down Expand Up @@ -359,7 +359,7 @@ When you use a conditional on an ``include_*`` statement, the condition is appli

.. code-block:: yaml
# Includes let you re-use a file to define a variable when it is not already defined
# Includes let you reuse a file to define a variable when it is not already defined
# main.yml
- include_tasks: other_tasks.yml
Expand Down
4 changes: 2 additions & 2 deletions docs/docsite/rst/playbook_guide/playbooks_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can set the environment directly at the task level.
environment:
http_proxy: http://proxy.example.com:8080
You can re-use environment settings by defining them as variables in your play and accessing them in a task as you would access any stored Ansible variable.
You can reuse environment settings by defining them as variables in your play and accessing them in a task as you would access any stored Ansible variable.

.. code-block:: yaml
Expand All @@ -51,7 +51,7 @@ You can re-use environment settings by defining them as variables in your play a
state: present
environment: "{{ proxy_env }}"
You can store environment settings for re-use in multiple playbooks by defining them in a group_vars file.
You can store environment settings for reuse in multiple playbooks by defining them in a group_vars file.

.. code-block:: yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/playbook_guide/playbooks_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ recursive

list_merge
Is a string, its possible values are ``replace`` (default), ``keep``, ``append``, ``prepend``, ``append_rp`` or ``prepend_rp``.
It modifies the behaviour of :ansplugin:`ansible.builtin.combine#filter` when the hashes to merge contain arrays/lists.
It modifies the behavior of :ansplugin:`ansible.builtin.combine#filter` when the hashes to merge contain arrays/lists.

.. code-block:: yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/playbook_guide/playbooks_intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Ansible playbooks
*****************

Ansible Playbooks offer a repeatable, re-usable, simple configuration management and multi-machine deployment system, one that is well suited to deploying complex applications. If you need to execute a task with Ansible more than once, write a playbook and put it under source control. Then you can use the playbook to push out new configuration or confirm the configuration of remote systems. The playbooks in the `ansible-examples repository <https://github.com/ansible/ansible-examples>`_ illustrate many useful techniques. You may want to look at these in another tab as you read the documentation.
Ansible Playbooks offer a repeatable, reusable, simple configuration management and multi-machine deployment system, one that is well suited to deploying complex applications. If you need to execute a task with Ansible more than once, write a playbook and put it under source control. Then you can use the playbook to push out new configuration or confirm the configuration of remote systems. The playbooks in the `ansible-examples repository <https://github.com/ansible/ansible-examples>`_ illustrate many useful techniques. You may want to look at these in another tab as you read the documentation.

Playbooks can:

Expand Down
Loading

0 comments on commit 2f8810b

Please sign in to comment.