Rewrite the Forgejo links instead of GitHub links in the nox session
This commit is contained in:
parent
ce2cdd6f3e
commit
abc3ec5b3c
1 changed files with 4 additions and 11 deletions
15
noxfile.py
15
noxfile.py
|
|
@ -40,7 +40,7 @@ import nox
|
|||
from nox.sessions import Session
|
||||
|
||||
|
||||
GITHUB_REPOSITORY = 'webartifex/urban-meal-delivery'
|
||||
FORGEJO_REPOSITORY = 'code.webartifex.de/alexander/velofy'
|
||||
PACKAGE_IMPORT_NAME = 'velofy'
|
||||
|
||||
# Docs/sphinx locations.
|
||||
|
|
@ -390,7 +390,7 @@ def fix_branch_references(session): # noqa:WPS210
|
|||
Intended to be run as a pre-commit hook.
|
||||
|
||||
Many files in the project (e.g., README.md) contain links to resources
|
||||
on github.com or nbviewer.jupyter.org that contain branch labels.
|
||||
on Forgejo that contain branch labels.
|
||||
|
||||
This task rewrites these links such that they contain branch references
|
||||
that make sense given the context:
|
||||
|
|
@ -441,16 +441,9 @@ def fix_branch_references(session): # noqa:WPS210
|
|||
|
||||
rewrites = [
|
||||
{
|
||||
'name': 'github',
|
||||
'name': 'forgejo',
|
||||
'pattern': re.compile(
|
||||
fr'((((http)|(https))://github\.com/{GITHUB_REPOSITORY}/((blob)|(tree))/)([\w\.-]+)/)', # noqa:E501
|
||||
),
|
||||
'replacement': fr'\2{branch}/',
|
||||
},
|
||||
{
|
||||
'name': 'nbviewer',
|
||||
'pattern': re.compile(
|
||||
fr'((((http)|(https))://nbviewer\.jupyter\.org/github/{GITHUB_REPOSITORY}/((blob)|(tree))/)([\w\.-]+)/)', # noqa:E501
|
||||
fr'((https://{FORGEJO_REPOSITORY}/src/branch/)([\w\.-]+)/)',
|
||||
),
|
||||
'replacement': fr'\2{branch}/',
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue