Skip to content

Commit

Permalink
ci: format
Browse files Browse the repository at this point in the history
  • Loading branch information
sujuka99 committed Oct 25, 2023
1 parent a938bdf commit 7e3d678
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions hooks/gen_docs/gen_docs_contributing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Copies ``CONTROBUTING.md`` from root to the docs"""
"""Copies ``CONTROBUTING.md`` from root to the docs."""
import shutil
from pathlib import Path
from tempfile import TemporaryFile
Expand All @@ -10,10 +10,12 @@

# Copy `CONTRIBUTING.md` into the equivalent file in the docs,
# adding a comment at the top which notes that the file is generated
with TemporaryFile() as file_header:
with (
TemporaryFile() as file_header,
DEST.open("w+b") as file_dest,
SOURCE.open("rb") as file_source,
):
file_header.write(HEADER)
file_header.seek(0)
with DEST.open("w+b") as file_dest:
with SOURCE.open("rb") as file_source:
shutil.copyfileobj(file_header, file_dest)
shutil.copyfileobj(file_source, file_dest)
shutil.copyfileobj(file_header, file_dest)
shutil.copyfileobj(file_source, file_dest)

0 comments on commit 7e3d678

Please sign in to comment.