Skip to content

Commit

Permalink
Fix typos (#1087)
Browse files Browse the repository at this point in the history
Found via `codespell -S ./cookietemple/create/templates/pub/thesis_latex,./cookietemple/create/templates/web/website_python/flask -L theses,ist`
  • Loading branch information
kianmeng authored Jul 4, 2023
1 parent b19b1d5 commit 26d1f82
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion cookietemple/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def sync(project_dir, set_token, pat, username, check_update) -> None:
syncer.new_template_version = ct_template_version
# check for user without actually syncing
if check_update:
log.debug("Running snyc to manually check whether a new template version is available.")
log.debug("Running sync to manually check whether a new template version is available.")
# a template update has been released by cookietemple
if any(change for change in (major_change, minor_change, patch_change)):
console.print(
Expand Down
2 changes: 1 addition & 1 deletion cookietemple/bump_version/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def can_run_bump_version(self, new_version: str) -> bool:
)
return False

# only allow bump from a SNAPSHOT version to its correspondance with -SNAPSHOT removed (like 1.0.0-SNAPSHOT to 1.0.0 but not 2.0.0)
# only allow bump from a SNAPSHOT version to its correspondence with -SNAPSHOT removed (like 1.0.0-SNAPSHOT to 1.0.0 but not 2.0.0)
elif self.CURRENT_VERSION.endswith("-SNAPSHOT") and not self.CURRENT_VERSION.split("-")[0] == new_version:
print(
f"[bold red]Cannot bump {self.CURRENT_VERSION} to {new_version}."
Expand Down
12 changes: 6 additions & 6 deletions cookietemple/create/github_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def prompt_github_repo(dot_cookietemple: Optional[dict]) -> Tuple[bool, bool, bo

def create_ct_topic(username: str, repo_name: str, token: Union[str, bool]) -> None:
"""
Create a cookietemple topic for a reposoitory, if wanted.
Create a cookietemple topic for a repository, if wanted.
:param project_dir: Project directory
:param username: The users github username
Expand All @@ -304,7 +304,7 @@ def create_ct_topic(username: str, repo_name: str, token: Union[str, bool]) -> N
log.debug("Setting Github repository topic.")
# the parameters required by the Github API
params = {"names": ["cookietemple"]}
# the authentification header
# the authentication header
headers = {"Authorization": f"token {token}"}
put_url = f"https://api.github.com/repos/{username}/{repo_name}/topics"
requests.put(put_url, headers=headers, data=json.dumps(params))
Expand All @@ -314,9 +314,9 @@ def create_sync_secret(username: str, repo_name: str, token: Union[str, bool]) -
"""
Create the secret cookietemple uses to sync repos. The secret contains the personal access token with the repo scope.
Following steps are required (PAT MUST have at least repo access):
1.) Get the repos public key (and its ID) which is needed for secret's value (PAT) encryption; for private repos especially we need an authentification
1.) Get the repos public key (and its ID) which is needed for secret's value (PAT) encryption; for private repos especially we need an authentication
header for a successful request.
2.) Encrypt the secret value using PyNacl (a Python binding for Javascripts LibSodium) and send the data with an authentification header (PAT) and the
2.) Encrypt the secret value using PyNacl (a Python binding for Javascripts LibSodium) and send the data with an authentication header (PAT) and the
public key's ID via PUT to the Github API.
:param username: The users github username
Expand Down Expand Up @@ -347,7 +347,7 @@ def create_secret(
username: str, repo_name: str, token: Union[str, bool], public_key_value: str, public_key_id: str
) -> None:
"""
Create the secret named CT_SYNC_TOKEN using a PUT request via the Github API. This request needs a PAT with the repo scope for authentification purposes.
Create the secret named CT_SYNC_TOKEN using a PUT request via the Github API. This request needs a PAT with the repo scope for authentication purposes.
Using PyNacl, a Python binding for Javascripts LibSodium, it encrypts the secret value, which is required by the Github API.
:param username: The user's github username
Expand All @@ -360,7 +360,7 @@ def create_secret(
encrypted_value = encrypt_sync_secret(public_key_value, token)
# the parameters required by the Github API
params = {"encrypted_value": encrypted_value, "key_id": public_key_id}
# the authentification header
# the authentication header
headers = {"Authorization": f"token {token}"}
# the url used for PUT
put_url = f"https://api.github.com/repos/{username}/{repo_name}/actions/secrets/CT_SYNC_TOKEN"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ install(
include
)

verbose_message("Install targets succesfully build. Install with `cmake --build <build_directory> --target install --config <build_config>`.")
verbose_message("Install targets successfully build. Install with `cmake --build <build_directory> --target install --config <build_config>`.")

#
# Quick `ConfigVersion.cmake` creation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# from here:
#
# https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Avai
# lable.md
# label.md
# Courtesy of Jason Turner

function(set_project_warnings project_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(${PROJECT_NAME}_ENABLE_CONAN)
file(DOWNLOAD "https://github.com/conan-io/cmake-conan/raw/v0.15/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
)
message(STATUS "Cmake-Conan downloaded succesfully.")
message(STATUS "Cmake-Conan downloaded successfully.")
endif()

include(${CMAKE_BINARY_DIR}/conan.cmake)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function(verbose_message content)
endfunction()

#
# Add a target for formating the project using `clang-format` (i.e: cmake --build build --target clang-format)
# Add a target for formatting the project using `clang-format` (i.e: cmake --build build --target clang-format)
#

function(add_clang_format_target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(${PROJECT_NAME}_ENABLE_VCPKG)
file(DOWNLOAD "https://github.com/microsoft/vcpkg/raw/master/scripts/buildsystems/vcpkg.cmake"
"${CMAKE_BINARY_DIR}/vcpkg.cmake"
)
message(STATUS "Vcpkg config downloaded succesfully.")
message(STATUS "Vcpkg config downloaded successfully.")
endif()

if(${PROJECT_NAME}_VERBOSE_OUTPUT)
Expand Down
6 changes: 3 additions & 3 deletions cookietemple/info/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def handle_domain_or_language_only(self, handle: str, available_templates: dict)
def output_table(templates_to_print: list, handle: str) -> None:
"""
Output a nice looking, rich rendered table.
:param templates_to_print: The templates tht should go into the table
:param templates_to_print: The templates that should go into the table
:param handle: The handle the user inputted
"""
for template in templates_to_print:
Expand Down Expand Up @@ -206,7 +206,7 @@ def non_existing_handle() -> None:
def flatten_nested_dict(self, template_info_, templates_to_print) -> None:
"""
Flatten an arbitrarily deep nested dict and creates a list of list containing all available
templates for the specified doamin/subdomain and/or language.
templates for the specified domain/subdomain and/or language.
:param template_info_: The dict containing the yaml parsed info for all available templates the user wants to gather some information
:param templates_to_print: A list of templates string representations, that will be printed to console
Expand Down Expand Up @@ -242,7 +242,7 @@ def set_linebreaks(desc: str) -> str:
"""
Sets newlines after max 45 characters (or the latest space to avoid non-sense separation)
:param desc: The parsed long description for the sepcific template
:param desc: The parsed long description for the specific template
:return: The formatted string with inserted newlines
"""
linebreak_limit = 50
Expand Down
4 changes: 2 additions & 2 deletions cookietemple/lint/template_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def check_version_match(self, path: str, version: str, section: str) -> None:
"""
with open(path, encoding="utf-8") as file:
for line in file:
# if a tag is found and (depending on wether it is a white or blacklisted file) check if the versions are matching
# if a tag is found and (depending on whether it is a white or blacklisted file) check if the versions are matching
if (
"<<COOKIETEMPLE_NO_BUMP>>" not in line and not section == "bumpversion_files_blacklisted"
) or "<<COOKIETEMPLE_FORCE_BUMP>>" in line:
Expand Down Expand Up @@ -498,7 +498,7 @@ def check_section(
:param error_code: The lint error code, in case of a failing lint function
:param is_sublinter_calling: Whether the function has been called from a sublinter or not
"""
# a set containig the section name as a key and its linting rules as values
# a set containing the section name as a key and its linting rules as values
# linting rules made of:
# 1.) a tuple with a variable_name and its value ('*' if value does not care for linting)
# => NOTE: if one variable can have multiple valid values, they are separated by '|'
Expand Down
2 changes: 1 addition & 1 deletion cookietemple/sync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def update_sync_token(project_name: str, gh_username: str = "") -> None:
gh_username = (
load_yaml_file(ConfigCommand.CONF_FILE_PATH)["github_username"] if not gh_username else gh_username
)
# get the personal access token for user authentification
# get the personal access token for user authentication
log.debug("Asking for updated sync token value.")
updated_sync_token = cookietemple_questionary_or_dot_cookietemple(
function="password", question="Please enter your updated sync token value"
Expand Down
2 changes: 1 addition & 1 deletion cookietemple/warp/warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run_unix_warp(warp_unix_path: str, arch: str, input_dir: str, exec: str, out
"""

# Set Warp to be executable if it not already is. May prompt the user for sudo permissions.
# Note: The installation should automatically set the permissions to 755, which should be sufficent for warp
# Note: The installation should automatically set the permissions to 755, which should be sufficient for warp
if stat.S_IXUSR & os.stat(warp_unix_path)[stat.ST_MODE]:
print(f"[bold blue]{warp_unix_path}\nis already executable! Will not attempt to change permissions.")
else:
Expand Down
2 changes: 1 addition & 1 deletion docs/adding_new_templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Our shiny new CliBrainfuckLinter is now ready for action!
brainfucky --file ExplodingSpringfield/hello.bf
We were pleasently surprised to see that someone already made a Github Action for brainfuck.
We were pleasantly surprised to see that someone already made a Github Action for brainfuck.

7. | Finally, we add some documentation to :code:`/docs/available_templates.rst` and explain the purpose, design and frameworks/libraries.

Expand Down
2 changes: 1 addition & 1 deletion docs/available_templates/web_website_python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can choose from two main options:
The basic setup
++++++++++++++++++++++++++++++++++
The basic theme is designed to provide only minimal code needed for getting started: Thus it comes
with only minimal HTML/CSS/JS code (but you can initalize it with a full featured frontend, if you want to) and basic Flask configuration.
with only minimal HTML/CSS/JS code (but you can initialize it with a full featured frontend, if you want to) and basic Flask configuration.
However, it contains all the code needed for automatic deployment on a Linux server and adheres to the cookietemple project structure standards.

.. code::
Expand Down
2 changes: 1 addition & 1 deletion docs/bump_version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ If files, like Maven pom.xml files, contain many version patterns matching ``X.X

Analogously to whitelisted files, which allow for specific lines to be ignored, blacklisted files allow for specific lines to be forcibly updated using the string :code:`<<COOKIETEMPLE_FORCE_BUMP>>`.

Note that those tags must be on the same line as the version (commonly placed in a comment), otherwise they wont work!
Note that those tags must be on the same line as the version (commonly placed in a comment), otherwise they won't work!
2 changes: 1 addition & 1 deletion docs/create.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Create a project
================

Creating projects from templates is the heart of cookietemple.
Our templates adhere to best practices and try to be as modern as possible. Furthermore, they try to automate tasks such as automatical dependency resolvement and installation, packaging, deployment and more.
Our templates adhere to best practices and try to be as modern as possible. Furthermore, they try to automate tasks such as automatically dependency resolvement and installation, packaging, deployment and more.
To learn more about our templates please visit :ref:`available_templates` and check out your template of interest.

Usage
Expand Down
4 changes: 2 additions & 2 deletions docs/github_support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ main_master_branch_protection workflow
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All templates feature ``main_master_branch_protection`` workflow.
This workflow runs everytime a PR to your projects master or main branch is created. It fails, if the PR to the ``master/main`` branch
This workflow runs every time a PR to your projects master or main branch is created. It fails, if the PR to the ``master/main`` branch
origins from a branch that does not contain ``patch`` or ``release`` in its branch name.
If development code is written on a branch called ``development``and a new release of the project is to be made,
one should create a ``release`` branch only for this purpose and then merge it into ``master/main`` branch.
Expand All @@ -69,7 +69,7 @@ release drafter workflow
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All templates feature ``release-drafter`` workflow.
This workflow consists of two parts: Everytime a new PR is made, the workflow runs and tries autolabeling the PR either as
This workflow consists of two parts: Every time a new PR is made, the workflow runs and tries autolabeling the PR either as
``feature`` or ``bug``. Feature PRs introduce new features if the branch name contains "feature". Bug PRs are PRs that either have a title containing
"fix" or the branch name contains "fix".
This Action then drafts a new release grouped by the different PR categories and include references and titles to all PRs inclduded in the new release.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Alternatively you can also install it using the Makefile:
Upgrading cookietemple
------------------------

Everytime cookietemple is run it will automatically check whether a newer version has been released on PyPI.
Every time cookietemple is run it will automatically check whether a newer version has been released on PyPI.
If a new version has been released you will be informed. To upgrade cookietemple either run::

$ pip install --upgrade cookietemple
Expand Down
2 changes: 1 addition & 1 deletion docs/lint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Linting codes
-----------------

The following error numbers correspond to errors found during linting.
If you are not sure why a specific linting error has occured you may find more information using the respective error code.
If you are not sure why a specific linting error has occurred you may find more information using the respective error code.

General
^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/info/test_info_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_commands_with_similar_command_cli_with_language():
return [
"cli-pyton",
"clipython",
"cli pyton",
"cli python",
"clipyton",
"clupython",
"CLI-PYTHON",
Expand Down Expand Up @@ -227,7 +227,7 @@ def test_valid_languages_only(get_valid_languages) -> None:
@pytest.mark.skip(reason="Check, how to test output of a rich Table")
def test_valid_handles_domain_and_subdomain(get_valid_handles_domain_subdomain, capfd) -> None:
"""
Test if a valid combination of domain and subdomain produces correct ouput
Test if a valid combination of domain and subdomain produces correct output
"""
for valid_domain_subdomain in get_valid_handles_domain_subdomain:
template_info = TemplateInfo()
Expand Down

0 comments on commit 26d1f82

Please sign in to comment.