Skip to content

Commit

Permalink
Support spaces in license headers
Browse files Browse the repository at this point in the history
When running `pyink` (black) on a notebook with a license, it adds a space. We should permit this.
  • Loading branch information
markmcd authored May 3, 2024
1 parent 3eac15b commit 0675307
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/tensorflow_docs/tools/nbfmt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def update_license_cells(data: Dict[str, Any]) -> None:
data: object representing a parsed JSON notebook.
"""
# This pattern in Apache and MIT license boilerplate.
license_re = re.compile(r"#@title.*License")
license_re = re.compile(r"#\s?@title.*License")

for idx, cell in enumerate(data["cells"]):
src_text = "".join(cell["source"])
Expand Down

0 comments on commit 0675307

Please sign in to comment.