diff options
author | sepro <4618135+seproDev@users.noreply.github.com> | 2024-06-12 01:09:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-12 01:09:58 +0200 |
commit | add96eb9f84cfffe85682bf2fb85135746994ee8 (patch) | |
tree | 583f209506aa01b2afa3933e504426de575fc43c /devscripts/make_readme.py | |
parent | db50f19d76c6870a5a13d0cab9287d684fd7449a (diff) |
[cleanup] Add more ruff rules (#10149)
Authored by: seproDev
Reviewed-by: bashonly <88596187+bashonly@users.noreply.github.com>
Reviewed-by: Simon Sawicki <contact@grub4k.xyz>
Diffstat (limited to 'devscripts/make_readme.py')
-rwxr-xr-x | devscripts/make_readme.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/devscripts/make_readme.py b/devscripts/make_readme.py index 2270b31d3..cbb5859aa 100755 --- a/devscripts/make_readme.py +++ b/devscripts/make_readme.py @@ -51,7 +51,7 @@ PATCHES = ( ), ( # Headings r'(?m)^ (\w.+\n)( (?=\w))?', - r'## \1' + r'## \1', ), ( # Fixup `--date` formatting rf'(?m)( --date DATE.+({delim}[^\[]+)*)\[.+({delim}.+)*$', @@ -61,26 +61,26 @@ PATCHES = ( ), ( # 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)', ), ) |