@@ -37,7 +37,7 @@ def make_link_node(rawtext, app, type, slug, options):
3737 if not base .endswith ('/' ):
3838 base += '/'
3939 except AttributeError as err :
40- raise ValueError ('github_project_url configuration value is not set (%s)' % str ( err ) )
40+ raise ValueError (f 'github_project_url configuration value is not set ({ err } )' )
4141
4242 ref = base + type + '/' + slug + '/'
4343 set_classes (options )
@@ -71,19 +71,19 @@ def ghissue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
7171 except ValueError :
7272 msg = inliner .reporter .error (
7373 'GitHub issue number must be a number greater than or equal to 1; '
74- '"%s " is invalid.' % text , line = lineno )
74+ f'" { text } " is invalid.' , line = lineno )
7575 prb = inliner .problematic (rawtext , rawtext , msg )
7676 return [prb ], [msg ]
7777 app = inliner .document .settings .env .app
78- #app.info('issue %r' % text )
78+ #app.info(f 'issue {text!r}' )
7979 if 'pull' in name .lower ():
8080 category = 'pull'
8181 elif 'issue' in name .lower ():
8282 category = 'issues'
8383 else :
8484 msg = inliner .reporter .error (
8585 'GitHub roles include "ghpull" and "ghissue", '
86- '"%s " is invalid.' % name , line = lineno )
86+ f'" { name } " is invalid.' , line = lineno )
8787 prb = inliner .problematic (rawtext , rawtext , msg )
8888 return [prb ], [msg ]
8989 node = make_link_node (rawtext , app , category , str (issue_num ), options )
@@ -105,7 +105,7 @@ def ghuser_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
105105 :param content: The directive content for customization.
106106 """
107107 app = inliner .document .settings .env .app
108- #app.info('user link %r' % text )
108+ #app.info(f 'user link {text!r}' )
109109 ref = 'https://www.github.com/' + text
110110 node = nodes .reference (rawtext , text , refuri = ref , ** options )
111111 return [node ], []
@@ -126,15 +126,15 @@ def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
126126 :param content: The directive content for customization.
127127 """
128128 app = inliner .document .settings .env .app
129- #app.info('user link %r' % text )
129+ #app.info(f 'user link {text!r}' )
130130 try :
131131 base = app .config .github_project_url
132132 if not base :
133133 raise AttributeError
134134 if not base .endswith ('/' ):
135135 base += '/'
136136 except AttributeError as err :
137- raise ValueError ('github_project_url configuration value is not set (%s)' % str ( err ) )
137+ raise ValueError (f 'github_project_url configuration value is not set ({ err } )' )
138138
139139 ref = base + text
140140 node = nodes .reference (rawtext , text [:6 ], refuri = ref , ** options )
0 commit comments