Skip to content

Commit 436f243

Browse files
committed
Codegen: also mark generated .gitattributes as linguist-generated
1 parent d0047ae commit 436f243

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

misc/codegen/lib/render.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def _dump_registry(self):
195195
self._registry_path.parent.mkdir(parents=True, exist_ok=True)
196196
with open(self._registry_path, 'w') as out, open(self._registry_path.parent / ".gitattributes", "w") as attrs:
197197
print(self._registry_path.name, "linguist-generated", file=attrs)
198+
print(".gitattributes", "linguist-generated", file=attrs)
198199
for f, hashes in sorted(self._hashes.items()):
199200
print(f, hashes.pre, hashes.post, file=out)
200201
print(f, "linguist-generated", file=attrs)

misc/codegen/test/test_render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def write_registry(file, *files_and_hashes):
4545

4646
def assert_registry(file, *files_and_hashes):
4747
assert_file(file, create_registry(files_and_hashes))
48-
files = [file.name] + [f for f, _, _ in files_and_hashes]
48+
files = [file.name, ".gitattributes"] + [f for f, _, _ in files_and_hashes]
4949
assert_file(file.parent / ".gitattributes", "\n".join(f"{f} linguist-generated" for f in files) + "\n")
5050

5151

swift/ql/.gitattributes

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)