Skip to content

Commit

Permalink
Easy PR! Fix typos and add minor doc updates (cookiecutter#1741)
Browse files Browse the repository at this point in the history
Fix typos and add minor doc updates
  • Loading branch information
Alex0Blackwell committed Jun 19, 2022
1 parent 449f877 commit f574208
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cookiecutter/exceptions.py
Expand Up @@ -132,7 +132,7 @@ def __str__(self):

class UnknownExtension(CookiecutterException):
"""
Exception for un-importable extention.
Exception for un-importable extension.
Raised when an environment is unable to import a required extension.
"""
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter/prompt.py
Expand Up @@ -222,7 +222,7 @@ def prompt_for_config(context, no_input=False):

# Second pass; handle the dictionaries.
for key, raw in context['cookiecutter'].items():
# Skip private type dicts not ot be rendered.
# Skip private type dicts not to be rendered.
if key.startswith('_') and not key.startswith('__'):
continue

Expand Down
2 changes: 1 addition & 1 deletion cookiecutter/repository.py
Expand Up @@ -87,7 +87,7 @@ def determine_repo_dir(
:param password: The password to use when extracting the repository.
:param directory: Directory within repo where cookiecutter.json lives.
:return: A tuple containing the cookiecutter template directory, and
a boolean descriving whether that directory should be cleaned up
a boolean describing whether that directory should be cleaned up
after the template has been instantiated.
:raises: `RepositoryNotFound` if a repository directory could not be found.
"""
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial2.rst
Expand Up @@ -89,7 +89,7 @@ You can expect similar output:
project_slug [test_web]:
author [Anonymous]: Cookiecutter Developer
Resulting directory should be inside your work directory with a name that matches `project_slug` you defined. Inside that direcory there should be `index.html` with generated source:
Resulting directory should be inside your work directory with a name that matches `project_slug` you defined. Inside that directory there should be `index.html` with generated source:

.. code-block:: html

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -16,6 +16,6 @@ testpaths = tests
addopts = -vvv --cov-report term-missing --cov=cookiecutter

[doc8]
# TODO: Remove current max-line-lengh ignore in follow-up and adopt black limit.
# TODO: Remove current max-line-length ignore in follow-up and adopt black limit.
# max-line-length = 88
ignore = D001
11 changes: 2 additions & 9 deletions tests/conftest.py
Expand Up @@ -12,10 +12,6 @@
cookiecutters_dir: '{cookiecutters_dir}'
replay_dir: '{replay_dir}'
"""
# In YAML, double quotes mean to use escape sequences.
# Single quotes mean we will have unescaped backslahes.
# http://blogs.perl.org/users/tinita/2018/03/
# strings-in-yaml---to-quote-or-not-to-quote.html


@pytest.fixture(autouse=True)
Expand All @@ -38,7 +34,7 @@ def backup_dir(original_dir, backup_dir):
if not os.path.isdir(original_dir):
return False

# Remove existing backups before backing up. If they exist, they're stale.
# Remove existing stale backups before backing up.
if os.path.isdir(backup_dir):
utils.rmtree(backup_dir)

Expand All @@ -48,12 +44,9 @@ def backup_dir(original_dir, backup_dir):

def restore_backup_dir(original_dir, backup_dir, original_dir_found):
"""Restore default contents."""
# Carefully delete the created original_dir only in certain
# conditions.
original_dir_is_dir = os.path.isdir(original_dir)
if original_dir_found:
# Delete the created original_dir as long as a backup
# exists
# Delete original_dir if a backup exists
if original_dir_is_dir and os.path.isdir(backup_dir):
utils.rmtree(original_dir)
else:
Expand Down
5 changes: 1 addition & 4 deletions tests/test_cli.py
Expand Up @@ -543,10 +543,7 @@ def test_debug_list_installed_templates(cli_runner, debug_file, user_config_path
"""Verify --list-installed command correct invocation."""
fake_template_dir = os.path.dirname(os.path.abspath('fake-project'))
os.makedirs(os.path.dirname(user_config_path))
# In YAML, double quotes mean to use escape sequences.
# Single quotes mean we will have unescaped backslahes.
# http://blogs.perl.org/users/tinita/2018/03/
# strings-in-yaml---to-quote-or-not-to-quote.html
# Single quotes in YAML will not parse escape codes (\).
Path(user_config_path).write_text(f"cookiecutters_dir: '{fake_template_dir}'")
Path("fake-project", "cookiecutter.json").write_text('{}')

Expand Down

0 comments on commit f574208

Please sign in to comment.