Skip to content

Commit a0786d3

Browse files
Fix .git in package links in the primer (#6782)
Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent bd33f79 commit a0786d3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tests/primer/packages_to_prime.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
"branch": "main",
2020
"directories": ["pandas"],
2121
"pylint_additional_args": ["--ignore-patterns=\"test_"],
22-
"url": "https://github.com/pandas-dev/pandas.git"
22+
"url": "https://github.com/pandas-dev/pandas"
2323
},
2424
"psycopg": {
2525
"branch": "master",
2626
"directories": ["psycopg/psycopg"],
27-
"url": "https://github.com/psycopg/psycopg.git"
27+
"url": "https://github.com/psycopg/psycopg"
2828
},
2929
"pygame": {
3030
"branch": "main",
@@ -39,6 +39,6 @@
3939
"sentry": {
4040
"branch": "master",
4141
"directories": ["src/sentry"],
42-
"url": "https://github.com/getsentry/sentry.git"
42+
"url": "https://github.com/getsentry/sentry"
4343
}
4444
}

tests/primer/primer_tool.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,10 @@ def _create_comment(
240240
filepath = str(message["path"]).replace(
241241
str(package_data.clone_directory), ""
242242
)
243-
without_suffix = package_data.url.rsplit(".git")[0]
244-
comment += f"{without_suffix}/blob/{package_data.branch}{filepath}#L{message['line']}\n"
243+
assert not package_data.url.endswith(
244+
".git"
245+
), "You don't need the .git at the end of the github url."
246+
comment += f"{package_data.url}/blob/{package_data.branch}{filepath}#L{message['line']}\n"
245247
count += 1
246248
print(message)
247249
if missing_messages:

0 commit comments

Comments
 (0)