Skip to content

Commit

Permalink
chore: lint and format
Browse files Browse the repository at this point in the history
  • Loading branch information
sujuka99 committed Nov 2, 2023
1 parent ab52824 commit de1346b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hooks/gen_docs/gen_docs_changelog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Copies ``CHANGELOG.md`` from root to the docs."""
from hooks.gen_docs.utils import copy_file
from hooks import ROOT
from hooks.gen_docs.utils import copy_file

SOURCE = ROOT / "CHANGELOG.md"
DEST = ROOT / "docs/docs/user/changelog.md"
Expand Down
18 changes: 13 additions & 5 deletions hooks/gen_docs/utils.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import inspect
import shutil
from pathlib import Path
from tempfile import TemporaryFile

from hooks import ROOT
import inspect

def copy_file(source: Path, dest: Path, *, add_header: bool | None = None, header: str | None = None) -> None:
"""Copy file from 1 location to another, optionally add a header

def copy_file(
source: Path,
dest: Path,
*,
add_header: bool | None = None,
header: str | None = None,
) -> None:
r"""Copy file from 1 location to another, optionally add a header.
:param source: Path to file to be copied
:param dest: Path to new file
:param add_header: Whether to add header
:param header: Will be placed at the top of the file, defaults to
:param add_header: Whether to add header
:param header: Will be placed at the top of the file, defaults to
``f"<!-- This file is autogenerated by {Path(__file__).relative_to(ROOT)}. -->\n\n"``
NOTE: The default header will only contain correct information if the caller of
this function is the one which should be referenced in the header
Expand Down

0 comments on commit de1346b

Please sign in to comment.