Skip to content

Commit

Permalink
style: fix spelling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Dec 28, 2021
1 parent 02baead commit 002c6f0
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ repos:
hooks:
- id: check-manifest
stages: [manual]

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
2 changes: 1 addition & 1 deletion conda.recipe/README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Change to the `conda.recipies` directory. Run
```bash
$ conda install conda-build
```
to aquire the conda build tools. Then you can build with
to acquire the conda build tools. Then you can build with
```bash
conda build --python 3.5 .
```
Expand Down
4 changes: 2 additions & 2 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,10 @@ Another common task of a cli application is provided by a configuration parser,
If no configuration file is present, this will create one and each call to ``.get`` will set the value with the given default.
The file is created when the context manager exits.
If the file is present, it is read and the values from the file are selected, and nothing is changed.
You can also use ``[]`` syntax to forcably set a value, or to get a value with a standard ``ValueError`` if not present.
You can also use ``[]`` syntax to forcibly set a value, or to get a value with a standard ``ValueError`` if not present.
If you want to avoid the context manager, you can use ``.read`` and ``.write`` as well.

The ini parser will default to using the ``[DEFAULT]`` section for values, just like Python's ConfigParser on which it is based. If you want to use a different section, simply seperate section and heading with a ``.`` in the key. ``conf['section.item']`` would place ``item`` under ``[section]``. All items stored in an ``ConfigINI`` are converted to ``str``, and ``str`` is always returned.
The ini parser will default to using the ``[DEFAULT]`` section for values, just like Python's ConfigParser on which it is based. If you want to use a different section, simply separate section and heading with a ``.`` in the key. ``conf['section.item']`` would place ``item`` under ``[section]``. All items stored in an ``ConfigINI`` are converted to ``str``, and ``str`` is always returned.

Terminal Utilities
------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/colorlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ An example of the usage of unsafe ``colors`` manipulations inside a context mana
colors.green.now()
print('This is green ' + colors.underline + 'and now also underlined!')
print('Underlined' + colors.underline.reset + ' and not underlined but still red')
print('This is completly restored, even if an exception is thrown!')
print('This is completely restored, even if an exception is thrown!')

Output:

Expand All @@ -128,7 +128,7 @@ Output:
<p><font color="#800000">This is in red</font><br/>
<font color="#008000">This is in green <span style="text-decoration: underline;">and now also underlined!</span></font><br/>
<font color="#008000"><span style="text-decoration: underline;">Underlined</span> and not underlined but still green.</font><br/>
This is completly restored, even if an exception is thrown! </p>
This is completely restored, even if an exception is thrown! </p>

We can use ``colors`` instead of ``colors.fg`` for foreground colors. If we had used ``colors.fg``
as the context manager, then non-foreground properties, such as ``colors.underline`` or
Expand Down
9 changes: 5 additions & 4 deletions docs/colors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ An example of the usage of unsafe ``colors`` manipulations inside a context mana
<p><font color="#800000">This is in red</font><br/>
<font color="#008000">This is in green <span style="text-decoration: underline;">and now also underlined!</span></font><br/>
<font color="#008000"><span style="text-decoration: underline;">Underlined</span> and not underlined but still green.</font><br/>
This is completly restored, even if an exception is thrown! </p>
This is completely restored, even if an exception is thrown! </p>

colors.green.now()
print('This is green ' + colors.underline + 'and now also underlined!')
print('Underlined' + colors.underline.reset + ' and not underlined but still red')
print('This is completly restored, even if an exception is thrown!')
print('This is completely restored, even if an exception is thrown!')

Output:

Expand All @@ -211,7 +211,7 @@ Output:
<p><font color="#800000">This is in red</font><br/>
<font color="#008000">This is in green <span style="text-decoration: underline;">and now also underlined!</span></font><br/>
<font color="#008000"><span style="text-decoration: underline;">Underlined</span> and not underlined but still green.</font><br/>
This is completly restored, even if an exception is thrown! </p>
This is completely restored, even if an exception is thrown! </p>

We can use ``colors`` instead of ``colors.fg`` for foreground colors. If we had used ``colors.fg``
as the context manager, then non-foreground properties, such as ``colors.underline`` or
Expand Down Expand Up @@ -280,6 +280,7 @@ See Also
========

* `colored <https://pypi.python.org/pypi/colored>`_ Another library with 256 color support
* `colorful <https://github.com/timofurrer/colorful>`_ A fairly new libary with a similar feature set
* `colorful <https://github.com/timofurrer/colorful>`_ A fairly new library with a similar feature set
* `colorama <https://pypi.python.org/pypi/colorama>`_ A library that supports colored text on Windows,
can be combined with Plumbum.colors (if you force ``use_color``, doesn't support all extended colors)
* `rich <https://rich.readthedocs.io>`_ A very powerful modern library for all sorts of styling.
2 changes: 1 addition & 1 deletion docs/local_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ In fact, you can nest even command-chains (i.e., pipes and redirections), e.g.,
``sudo[ls | grep["\\.py"]]``; however, that would require that the top-level program be able
to handle these shell operators, and this is not the case for ``sudo``. ``sudo`` expects its
argument to be an executable program, and it would complain about ``|`` not being one.
So, there's a inherent differnce between between ``sudo[ls | grep["\\.py"]]``
So, there's a inherent difference between between ``sudo[ls | grep["\\.py"]]``
and ``sudo[ls] | grep["\\.py"]`` (where the pipe is unnested) -- the first would fail,
the latter would work as expected.

Expand Down
2 changes: 1 addition & 1 deletion docs/remote.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,4 @@ renaming paths, etc. ::
.. note::
See the :ref:`guide-utils` guide for copying, moving and deleting remote paths

For futher information, see the :ref:`api docs <api-remote-machines>`.
For further information, see the :ref:`api docs <api-remote-machines>`.
4 changes: 2 additions & 2 deletions examples/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
with colors.fg.red:
print("This is in red")

print("This is completly restored, even if an exception is thrown!")
print("This is completely restored, even if an exception is thrown!")

print("The library will restore color on exiting automatially.")
print("The library will restore color on exiting automatically.")
print(colors.bold["This is bold and exciting!"])
print(colors.bg.cyan | "This is on a cyan background.")
print(colors.fg[42] | "If your terminal supports 256 colors, this is colorful!")
Expand Down
2 changes: 1 addition & 1 deletion plumbum/cli/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def done(self):
class ProgressAuto(ProgressBase):
"""Automatically selects the best progress bar (IPython HTML or text). Does not work with qtconsole
(as that is correctly identified as identical to notebook, since the kernel is the same); it will still
iterate, but no graphical indication will be diplayed.
iterate, but no graphical indication will be displayed.
:param iterator: The iterator to wrap with a progress bar
:param length: The length of the iterator (will use ``__len__`` if None)
Expand Down
4 changes: 2 additions & 2 deletions plumbum/colorlib/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def __radd__(self, other):
return other + other.__class__(self)

def wrap(self, wrap_this):
"""Wrap a sting in this style and its inverse."""
"""Wrap a string in this style and its inverse."""
return self + wrap_this + ~self

def __and__(self, other):
Expand All @@ -484,7 +484,7 @@ def __and__(self, other):
return self.wrap(other)

def __rand__(self, other):
"""This class supports ``"String:" & color`` syntax, excpet in Python 2.6 due to bug with that Python."""
"""This class supports ``"String:" & color`` syntax."""
return self.wrap(other)

def __ror__(self, other):
Expand Down
6 changes: 3 additions & 3 deletions plumbum/commands/modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class _TF(ExecutionModifier):
This is useful for checking true/false bash commands.
If you wish to expect a different return code (other than the normal success indicate by 0),
use ``TF(retcode)``. If you want to run the process in the forground, then use
use ``TF(retcode)``. If you want to run the process in the foreground, then use
``TF(FG=True)``.
Example::
Expand Down Expand Up @@ -297,7 +297,7 @@ class _RETCODE(ExecutionModifier):
This is useful for working with bash commands that have important retcodes but not very
useful output.
If you want to run the process in the forground, then use ``RETCODE(FG=True)``.
If you want to run the process in the foreground, then use ``RETCODE(FG=True)``.
Example::
Expand Down Expand Up @@ -343,7 +343,7 @@ class _NOHUP(ExecutionModifier):
sleep[5] & NOHUP # Outputs to nohup.out
sleep[5] & NOHUP(stdout=os.devnull) # No output
The equivelent bash command would be
The equivalent bash command would be
.. code-block:: bash
Expand Down
4 changes: 2 additions & 2 deletions plumbum/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def _setdoc(super): # @ReservedAssignment
"""This inherits the docs on the current class. Not really needed for Python 3.5,
due to new behavoir of inspect.getdoc, but still doesn't hurt."""
due to new behavior of inspect.getdoc, but still doesn't hurt."""

def deco(func):
func.__doc__ = getattr(getattr(super, func.__name__, None), "__doc__", None)
Expand Down Expand Up @@ -75,7 +75,7 @@ def getdoc(object):

def read_fd_decode_safely(fd, size=4096):
"""
This reads a utf-8 file descriptor and returns a chunck, growing up to
This reads a utf-8 file descriptor and returns a chunk, growing up to
three bytes if needed to decode the character at the end.
Returns the data and the decoded text.
Expand Down
2 changes: 1 addition & 1 deletion plumbum/machines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get(self, cmd, *othercommands):
raise

def __contains__(self, cmd):
"""Tests for the existance of the command, e.g., ``"ls" in plumbum.local``.
"""Tests for the existence of the command, e.g., ``"ls" in plumbum.local``.
``cmd`` can be anything acceptable by ``__getitem__``.
"""
try:
Expand Down
2 changes: 1 addition & 1 deletion plumbum/machines/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def _path_listdir(self, fn):
return files

def _path_glob(self, fn, pattern):
# shquote does not work here due to the way bash loops use space as a seperator
# shquote does not work here due to the way bash loops use space as a separator
pattern = pattern.replace(" ", r"\ ")
fn = fn.replace(" ", r"\ ")
matches = self._session.run(fr"for fn in {fn}/{pattern}; do echo $fn; done")[
Expand Down
2 changes: 1 addition & 1 deletion plumbum/path/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def split(self, *dummy_args, **dummy_kargs):

@property
def parts(self):
"""Splits the directory into parts, including the base directroy, returns a tuple"""
"""Splits the directory into parts, including the base directory, returns a tuple"""
return tuple([self.drive + self.root] + self.split())

def relative_to(self, source):
Expand Down
2 changes: 1 addition & 1 deletion plumbum/typed_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __dir__(self):
if self._defined_keys:
# return only defined
return sorted(self._defined_keys)
# return whatever is in the environemnt (for convenience)
# return whatever is in the environment (for convenience)
members = set(self._env.keys())
members.update(dir(self.__class__))
return sorted(members)
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@ exclude_lines =
max-complexity = 50
extend-ignore = E203, E501, E722, B950, E731
select = C,E,F,W,B,B9

[codespell]
ignore-words-list = ans,switchs,hart,ot,twoo,fo
skip = *.po
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def pytest_configure(config):
# register all optional tests declared in ini file as markers
# https://docs.pytest.org/en/latest/writing_plugins.html#registering-custom-markers
ot_ini = config.inicfg.get("optional_tests").strip().splitlines()
for ot in ot_ini:
for ot_ in ot_ini:
# ot should be a line like "optmarker: this is an opt marker", as with markers section
config.addinivalue_line("markers", ot)
config.addinivalue_line("markers", ot_)
ot_markers = {marker_re.match(ln).group(1) for ln in ot_ini}

# collect requested optional tests
Expand Down

0 comments on commit 002c6f0

Please sign in to comment.