From 82ba18c84bc1d8ec60eb9dfd556d7829eac0db17 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 23 Mar 2021 10:05:05 +0000 Subject: [PATCH] Enable codespell (#3080) Also includes a bunch of typo fixes. --- .pre-commit-config.yaml | 4 ++++ docs/examples.rst | 2 +- docs/index.rst | 2 +- docs/installation.rst | 2 +- src/molecule/command/base.py | 2 +- src/molecule/command/prepare.py | 2 +- src/molecule/driver/base.py | 2 +- src/molecule/provisioner/ansible.py | 8 ++++---- src/molecule/test/unit/command/test_converge.py | 4 ++-- src/molecule/test/unit/model/v2/conftest.py | 2 +- src/molecule/verifier/base.py | 4 ++-- 11 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5e026e524d..f9e3e897ef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,10 @@ exclude: | ^docs/conf.py$ ) repos: + - repo: https://github.com/codespell-project/codespell + rev: v2.0.0 + hooks: + - id: codespell - repo: https://github.com/PyCQA/isort rev: 5.6.4 hooks: diff --git a/docs/examples.rst b/docs/examples.rst index f93ba02363..eed71b4bc1 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -266,7 +266,7 @@ test roles from a monolith repo. └── README.md The role initialized with Molecule (baz in this case) would simply reference -the dependant roles via it's ``converge.yml`` or meta dependencies. +the dependent roles via it's ``converge.yml`` or meta dependencies. Molecule can test complex scenarios leveraging this technique. diff --git a/docs/index.rst b/docs/index.rst index 34faa8e645..7b981e0c27 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -55,5 +55,5 @@ being listed first: - `How to test Ansible and don’t go nuts `_ `@ultral` .. When updating the list remember to remove broken links or outdated content - that is no longer appliable to current versions. If older articles are + that is no longer applicable to current versions. If older articles are updated to match latest versions move them up. diff --git a/docs/installation.rst b/docs/installation.rst index aa23d6bd76..c25c4e51a0 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -93,7 +93,7 @@ Install Molecule: $ python3 -m pip install --user "molecule[lint]" Molecule uses the "delegated" driver by default. Other drivers can -be installed seperately from PyPI, such as the molecule-docker driver. +be installed separately from PyPI, such as the molecule-docker driver. If you would like to use docker as the molecule driver, the installation command would look like this: diff --git a/src/molecule/command/base.py b/src/molecule/command/base.py index 02ea3885d1..8ba23f52b2 100644 --- a/src/molecule/command/base.py +++ b/src/molecule/command/base.py @@ -137,7 +137,7 @@ def execute_subcommand(config, subcommand): command = getattr(command_module, text.camelize(subcommand)) # knowledge of the current action is used by some provisioners # to ensure they behave correctly during certain sequence steps, - # particulary the setting of ansible options in create/destroy, + # particularly the setting of ansible options in create/destroy, # and is also used for reporting in execute_cmdline_scenarios config.action = subcommand diff --git a/src/molecule/command/prepare.py b/src/molecule/command/prepare.py index ba824e8748..d8d214a387 100644 --- a/src/molecule/command/prepare.py +++ b/src/molecule/command/prepare.py @@ -61,7 +61,7 @@ class Prepare(base.Base): .. option:: molecule prepare --force - Force the execution fo the prepare playbook. + Force the execution for the prepare playbook. .. program:: molecule --debug prepare diff --git a/src/molecule/driver/base.py b/src/molecule/driver/base.py index ff53e61722..357b08803e 100644 --- a/src/molecule/driver/base.py +++ b/src/molecule/driver/base.py @@ -226,7 +226,7 @@ def _converged(self): return str(self._config.state.converged).lower() def __eq__(self, other): - """Implement equality comparision.""" + """Implement equality comparison.""" # trick that allows us to test if a driver is loaded via: # if 'driver-name' in drivers() return str(self) == str(other) diff --git a/src/molecule/provisioner/ansible.py b/src/molecule/provisioner/ansible.py index e3ffb5cd0b..c6e026d648 100644 --- a/src/molecule/provisioner/ansible.py +++ b/src/molecule/provisioner/ansible.py @@ -53,7 +53,7 @@ class Ansible(base.Base): between Ansible and Molecule, it is best to perform these tasks in the prepare or converge playbooks. - It is the developers responsiblity to properly map the modules's fact + It is the developers responsibility to properly map the modules' fact data into the instance_conf_dict fact in the create playbook. This allows Molecule to properly configure Ansible inventory. @@ -209,7 +209,7 @@ class Ansible(base.Base): $ephemeral_directory/plugins/filter/:$project_directory/filter/plugins/:~/.ansible/plugins/filter:/usr/share/ansible/plugins/modules Environment variables can be passed to the provisioner. Variables in this - section which match the names above will be appened to the above defaults, + section which match the names above will be appended to the above defaults, and converted to absolute paths, where the relative parent is the $scenario_directory. @@ -301,7 +301,7 @@ class Ansible(base.Base): The extra hosts added to the inventory using this key won't be created/destroyed by Molecule. It is the developers responsibility to target the proper hosts in the playbook. Only the hosts defined - under `Platforms`_ should be targetted instead of ``all``. + under `Platforms`_ should be targeted instead of ``all``. An alternative to the above is symlinking. Molecule creates symlinks to @@ -319,7 +319,7 @@ class Ansible(base.Base): Again, it is the developers responsibility to target the proper hosts in the playbook. Only the hosts defined under - `Platforms`_ should be targetted instead of ``all``. + `Platforms`_ should be targeted instead of ``all``. .. note:: diff --git a/src/molecule/test/unit/command/test_converge.py b/src/molecule/test/unit/command/test_converge.py index fb5fea69e1..c9b873af46 100644 --- a/src/molecule/test/unit/command/test_converge.py +++ b/src/molecule/test/unit/command/test_converge.py @@ -49,7 +49,7 @@ def test_execute( def test_ansible_args_passed_to_scenarios_get_configs(mocker): # Scenarios patch is needed to safely invoke CliRunner - # in the test environment and block scenario exectution + # in the test environment and block scenario execution mocker.patch("molecule.scenarios.Scenarios") patched_get_configs = mocker.patch("molecule.command.base.get_configs") @@ -58,6 +58,6 @@ def test_ansible_args_passed_to_scenarios_get_configs(mocker): ansible_args = args[2:] runner.invoke(main, args, obj={}) - # call index [0][2] is the 3rd positional arguement to get_configs, + # call index [0][2] is the 3rd positional argument to get_configs, # which should be the tuple of parsed ansible_args from the CLI assert patched_get_configs.call_args[0][2] == ansible_args diff --git a/src/molecule/test/unit/model/v2/conftest.py b/src/molecule/test/unit/model/v2/conftest.py index 3ee084a1f7..f6f2f5e0ed 100644 --- a/src/molecule/test/unit/model/v2/conftest.py +++ b/src/molecule/test/unit/model/v2/conftest.py @@ -17,7 +17,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -"""Unittest for v2 condig format.""" +"""Unittest for v2 config format.""" import os diff --git a/src/molecule/verifier/base.py b/src/molecule/verifier/base.py index 1e1d768bb6..fac1f60806 100644 --- a/src/molecule/verifier/base.py +++ b/src/molecule/verifier/base.py @@ -104,11 +104,11 @@ def env(self): ) def __eq__(self, other): - """Implement equality comparision.""" + """Implement equality comparison.""" return str(self) == str(other) def __lt__(self, other): - """Implement lower than comparision.""" + """Implement lower than comparison.""" return str.__lt__(str(self), str(other)) def __hash__(self):