Skip to content

Commit

Permalink
Fix .git in package links in the primer (#6782)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
DanielNoord and Pierre-Sassoulas committed Jun 1, 2022
1 parent bd33f79 commit a0786d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/primer/packages_to_prime.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"branch": "main",
"directories": ["pandas"],
"pylint_additional_args": ["--ignore-patterns=\"test_"],
"url": "https://github.com/pandas-dev/pandas.git"
"url": "https://github.com/pandas-dev/pandas"
},
"psycopg": {
"branch": "master",
"directories": ["psycopg/psycopg"],
"url": "https://github.com/psycopg/psycopg.git"
"url": "https://github.com/psycopg/psycopg"
},
"pygame": {
"branch": "main",
Expand All @@ -39,6 +39,6 @@
"sentry": {
"branch": "master",
"directories": ["src/sentry"],
"url": "https://github.com/getsentry/sentry.git"
"url": "https://github.com/getsentry/sentry"
}
}
6 changes: 4 additions & 2 deletions tests/primer/primer_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ def _create_comment(
filepath = str(message["path"]).replace(
str(package_data.clone_directory), ""
)
without_suffix = package_data.url.rsplit(".git")[0]
comment += f"{without_suffix}/blob/{package_data.branch}{filepath}#L{message['line']}\n"
assert not package_data.url.endswith(
".git"
), "You don't need the .git at the end of the github url."
comment += f"{package_data.url}/blob/{package_data.branch}{filepath}#L{message['line']}\n"
count += 1
print(message)
if missing_messages:
Expand Down

0 comments on commit a0786d3

Please sign in to comment.