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

Add codespell (config, precommit, workflow) and make it fix typos #670

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
level of experience, education, socioeconomic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within pyproject.toml
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ repos:
language: python
types: [python]
entry: flake8

- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The versions coincide with releases on pip. Only major versions will be released
- split documentation into user and developer guide
- added automated spell checking with crate-ci/typos
- support for container features
- shpc get -e to show path to an envrironment file
- shpc get -e to show path to an environment file
- added support for env section to render to bound environment file
- added support for container features like gpu
- allowing for a `container:tag` convention to be used for commands.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ There are other tools that you might be interested in!
## License

This code is licensed under the MPL 2.0 [LICENSE](LICENSE).
explicit typo to test detection on CI: expored
2 changes: 1 addition & 1 deletion docs/getting_started/developer-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ Templating for both wrapper script types
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Note that you are free to use "snippets" and "bases" either as an inclusion or "extends" meaning you can
easily re-use code. For example, if we have the following registered directories under ``shpc/main/wrappers/templates``
easily reuse code. For example, if we have the following registered directories under ``shpc/main/wrappers/templates``
for definition of bases and templates:

.. code-block:: console
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Installation
============

Singularity Registry HPC (shpc) can be installed from pypi, or from source.
In all cases, a module technology is required such as `lmod (install intstructions) <https://lmod.readthedocs.io/en/latest/030_installing.html>`_
In all cases, a module technology is required such as `lmod (install instructions) <https://lmod.readthedocs.io/en/latest/030_installing.html>`_
or `environment modules (install instructions) <https://modules.readthedocs.io/en/latest/INSTALL.html>`_.
Having module software installed means that the ``module`` command should be on your path.
Once you are ready to install shpc along your module software, it's recommended that you create a virtual environment, if you have not already
Expand Down
6 changes: 3 additions & 3 deletions docs/getting_started/user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ variable replacement. A summary table of variables is included below, and then f
- Format string for module commands exec,shell,run (not aliases) can include ``{{ registry }}``, ``{{ repository }}``, ``{{ tool }}`` and ``{{ version }}``
- ``'{{ tool }}'``
* - bindpaths
- string with comma separated list of paths to binds. If set, expored to SINGULARITY_BINDPATH
- string with comma separated list of paths to binds. If set, exported to SINGULARITY_BINDPATH
- null
* - singularity_shell
- exported to SINGULARITY_SHELL
Expand Down Expand Up @@ -415,7 +415,7 @@ any changes.

It could be the case that you want to start with a remote registry, but keep it locally
with your own changes or secrets. This is essentially turning a remote registry into a filesystem
(local) one. The easiest thing to do here is to clone it to your filesyste, and then add to shpc as a filesystem
(local) one. The easiest thing to do here is to clone it to your filesystem, and then add to shpc as a filesystem
registry.

.. code-block:: console
Expand Down Expand Up @@ -1234,7 +1234,7 @@ This feature is supported for shpc versions 0.1.15 and up.
Namespace
---------

Let's say that you are exclusively using continers in the namespace ghcr.io/autamus.
Let's say that you are exclusively using containers in the namespace ghcr.io/autamus.

.. code-block:: console

Expand Down
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This set of examples includes the following:

The intention of this script is to instantiate a client, and then match
containers you have in some root from [Galaxy Project Depot](https://depot.galaxyproject.org/singularity/)
on your local filesytem to install to an shpc registry (as modules). The script
on your local filesystem to install to an shpc registry (as modules). The script
tries to be efficient and instantiate one remote registry that has all the containers.
See the script header for usage examples.

Expand Down
2 changes: 1 addition & 1 deletion paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ authors:
affiliations:
- name: Lawrence Livermore National Lab, Livermore, CA, USA
index: 1
- name: University of Arizona Research Computing, Tuscon, AZ, USA
- name: University of Arizona Research Computing, Tucson, AZ, USA
index: 2
date: 17 April 2021
bibliography: paper.bib
Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
[tool.black]
profile = "black"
exclude = ["^env/"]
exclude = "^env/"

[tool.isort]
profile = "black" # needed for black/isort compatibility
skip = []

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git,*.svg,*.css'
check-hidden = true
# ignore-regex = ''
# ignore-words-list = ''
2 changes: 1 addition & 1 deletion shpc/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_parser():
action="store_true",
)

# Add a container direcly
# Add a container directly
add = subparsers.add_parser(
"add",
formatter_class=argparse.RawTextHelpFormatter,
Expand Down
2 changes: 1 addition & 1 deletion shpc/client/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
> client
Out[1]: [shpc-client]

# Shell into a client with a different interpeter
# Shell into a client with a different interpreter
$ shpc shell -i python
$ shpc shell -i ipython
$ shpc shell -i bpython"""
Expand Down
2 changes: 1 addition & 1 deletion shpc/client/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main(args, parser, extra, subparser):
except ImportError:
pass

# Otherwise present order of liklihood to have on system
# Otherwise present order of likelihood to have on system
for shell in shells:
try:
return lookup[shell](args)
Expand Down
2 changes: 1 addition & 1 deletion shpc/main/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_client(quiet=False, **kwargs):

Client.container = DockerContainer()

# The containe should have access to settings too
# The container should have access to settings too
if hasattr(Client, "container"):
Client.container.settings = settings

Expand Down
2 changes: 1 addition & 1 deletion shpc/main/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def add(self, image, module_name=None, **kwargs):
if image.startswith("docker"):
module_name = image.replace("docker://", "")

# If we still dont' have a module name and not docker, no go
# If we still don't have a module name and not docker, no go
if not module_name:
logger.exit("A module name is required to add an image.")
module_name = self.add_namespace(module_name)
Expand Down
2 changes: 1 addition & 1 deletion shpc/main/modules/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def remove_module(self, module_dir, has_version=False):
updated = []
change = False
for module in self._config["view"]["modules"]:
# This will match an entire dirname (if all delted) or a specific version
# This will match an entire dirname (if all deleted) or a specific version
if module_uid not in module:
updated.append(module)
else:
Expand Down
2 changes: 1 addition & 1 deletion shpc/main/registry/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class FilesystemResult(Result):
"""
A filesystem result provides courtesy functions for interacting with
a container yaml recipe on the filesytem.
a container yaml recipe on the filesystem.
"""

def __init__(self, module, container_yaml):
Expand Down
2 changes: 1 addition & 1 deletion shpc/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def load(self, settings_file=None):
"""
Load the settings file into the settings object
"""
# Get the preferred settings flie
# Get the preferred settings file
self.settings_file = self.get_settings_file(settings_file)

# Exit quickly if the settings file does not exist
Expand Down
2 changes: 1 addition & 1 deletion shpc/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ default_view:
singularity_module:
podman_module:

# string with comma separated list of paths to binds. If set, expored to SINGULARITY_BINDPATH
# string with comma separated list of paths to binds. If set, exported to SINGULARITY_BINDPATH
bindpaths:

# for container technologies that can specify a tty input (e.g., -t)
Expand Down
Loading