]> jfr.im git - yt-dlp.git/blobdiff - devscripts/make_readme.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / devscripts / make_readme.py
index 2270b31d3b97a35f00a537ea54077d5252d32831..cbb5859aa1a607c4e453ba2622e22952793dddc6 100755 (executable)
@@ -51,7 +51,7 @@ def apply_patch(text, patch):
     ),
     (   # Headings
         r'(?m)^  (\w.+\n)(    (?=\w))?',
-        r'## \1'
+        r'## \1',
     ),
     (   # Fixup `--date` formatting
         rf'(?m)(    --date DATE.+({delim}[^\[]+)*)\[.+({delim}.+)*$',
@@ -61,26 +61,26 @@ def apply_patch(text, patch):
     ),
     (   # Do not split URLs
         rf'({delim[:-1]})? (?P<label>\[\S+\] )?(?P<url>https?({delim})?:({delim})?/({delim})?/(({delim})?\S+)+)\s',
-        lambda mobj: ''.join((delim, mobj.group('label') or '', re.sub(r'\s+', '', mobj.group('url')), '\n'))
+        lambda mobj: ''.join((delim, mobj.group('label') or '', re.sub(r'\s+', '', mobj.group('url')), '\n')),
     ),
     (   # Do not split "words"
         rf'(?m)({delim}\S+)+$',
-        lambda mobj: ''.join((delim, mobj.group(0).replace(delim, '')))
+        lambda mobj: ''.join((delim, mobj.group(0).replace(delim, ''))),
     ),
     (   # Allow overshooting last line
         rf'(?m)^(?P<prev>.+)${delim}(?P<current>.+)$(?!{delim})',
         lambda mobj: (mobj.group().replace(delim, ' ')
                       if len(mobj.group()) - len(delim) + 1 <= max_width + ALLOWED_OVERSHOOT
-                      else mobj.group())
+                      else mobj.group()),
     ),
     (   # Avoid newline when a space is available b/w switch and description
         DISABLE_PATCH,  # This creates issues with prepare_manpage
         r'(?m)^(\s{4}-.{%d})(%s)' % (switch_col_width - 6, delim),
-        r'\1 '
+        r'\1 ',
     ),
     (   # Replace brackets with a Markdown link
         r'SponsorBlock API \((http.+)\)',
-        r'[SponsorBlock API](\1)'
+        r'[SponsorBlock API](\1)',
     ),
 )