Skip to content

Commit 0675307

Browse files
authored
Support spaces in license headers
When running `pyink` (black) on a notebook with a license, it adds a space. We should permit this.
1 parent 3eac15b commit 0675307

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/tensorflow_docs/tools/nbfmt/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def update_license_cells(data: Dict[str, Any]) -> None:
237237
data: object representing a parsed JSON notebook.
238238
"""
239239
# This pattern in Apache and MIT license boilerplate.
240-
license_re = re.compile(r"#@title.*License")
240+
license_re = re.compile(r"#\s?@title.*License")
241241

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

0 commit comments

Comments
 (0)