Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 16a4d19

Browse files
committed
docstrings
1 parent acf013a commit 16a4d19

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

hooks/post_gen_project.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,24 @@
2727

2828

2929
def generate_license(directory: Path, licence: str) -> None:
30-
"""Generate license file for the project."""
30+
"""Generate license file for the project.
31+
32+
Args:
33+
directory: path to the project directory
34+
licence: chosen licence
35+
"""
3136
move(str(directory / "_licences" / f"{licence}.txt"), str(directory / "LICENSE"))
3237
rmtree(str(directory / "_licences"))
3338

3439

3540
def remove_unused_files(directory: Path, module_name: str, need_to_remove_cli: bool) -> None:
36-
"""Remove unused files."""
41+
"""Remove unused files.
42+
43+
Args:
44+
directory: path to the project directory
45+
module_name: project module name
46+
need_to_remove_cli: flag for removing CLI related files
47+
"""
3748
files_to_delete: List[Path] = []
3849

3950
def _cli_specific_files() -> List[Path]:
@@ -47,7 +58,12 @@ def _cli_specific_files() -> List[Path]:
4758

4859

4960
def print_futher_instuctions(project_name: str, github: str) -> None:
50-
"""Show user what to do next after project creation."""
61+
"""Show user what to do next after project creation.
62+
63+
Args:
64+
project_name: current project name
65+
github: GitHub username
66+
"""
5167
message = f"""
5268
Your project {project_name} is created.
5369

hooks/pre_gen_project.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def validate_project_name(project_name: str) -> None:
3737
Valid inputs starts with the lowercase letter.
3838
Followed by any lowercase letters, numbers or underscores.
3939
40+
Args:
41+
project_name: current project name
42+
4043
Raises:
4144
ValueError: If project_name is not a valid Python module name
4245
"""
@@ -48,6 +51,9 @@ def validate_project_name(project_name: str) -> None:
4851
def validate_semver(version: str) -> None:
4952
"""Ensure version in semver notation.
5053
54+
Args:
55+
version: string version. For example 0.1.2 or 1.2.4
56+
5157
Raises:
5258
ValueError: If version is not in semver notation
5359
"""
@@ -59,6 +65,9 @@ def validate_semver(version: str) -> None:
5965
def validate_line_length(line_length: int) -> None:
6066
"""Validate line_length parameter. Length should be between 50 and 300.
6167
68+
Args:
69+
line_length: integer paramenter for isort and black formatters
70+
6271
Raises:
6372
ValueError: If line_length isn't between 50 and 300
6473
"""

0 commit comments

Comments
 (0)