Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 9 additions & 7 deletions scripts/generate_osv_advisories.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '*':
Expand Down