diff --git a/ruff.toml b/ruff.toml index b89efdb2..959b75ad 100644 --- a/ruff.toml +++ b/ruff.toml @@ -6,12 +6,13 @@ quote-style = 'single' [lint] ignore = ['E501'] select = [ - 'E', # pycodestyle - 'F', # Pyflakes - 'UP', # pyupgrade - 'B', # flake8-bugbear - 'SIM', # flake8-simplify - 'I' # isort + 'E', # pycodestyle + 'F', # Pyflakes + 'UP', # pyupgrade + 'B', # flake8-bugbear + 'SIM', # flake8-simplify + 'I', # isort + 'PERF' # performance ] [lint.isort] diff --git a/scripts/generate_osv_advisories.py b/scripts/generate_osv_advisories.py index 8fdda1a2..23b080f9 100755 --- a/scripts/generate_osv_advisories.py +++ b/scripts/generate_osv_advisories.py @@ -152,13 +152,15 @@ def parse_version_constraint( warnings.append( 'the = operator is not real, and will be treated as an exact version' ) - for component in [ - part.first_component or '', - part.second_component or '', - part.third_component or '', - ]: - if len(component) > 1 and component.startswith('0'): - warnings.append('components should not be prefixed with leading zeros') + warnings.extend( + 'components should not be prefixed with leading zeros' + for component in [ + part.first_component or '', + part.second_component or '', + part.third_component or '', + ] + if len(component) > 1 and component.startswith('0') + ) # https://getcomposer.org/doc/articles/versions.md#wildcard-version-range- if parts[0].second_component == '*' or parts[0].third_component == '*':