Opened 2 years ago

Last modified 12 days ago

#61980 new defect

port lint --nitpick gives false warning when version is a single integer

Reported by: Tatsh (Andrew Udvare) Owned by:
Priority: Normal Milestone:
Component: base Version:
Keywords: Cc: kurthindenburg (Kurt Hindenburg)
Port:

Description

I made a Portfile for pyproject2setuppy which uses single integer versions: https://pypi.org/project/pyproject2setuppy/#history

I set this version in the Portfile in the version field as usual, and I set python.versions .... This seems to confuse port lint --nitpick:

Warning: Line 18 seems to hardcode the version number, consider using ${version} instead

If I put a 'normal' version string like 9.0, the warning does not appear.

Portfile before workaround: https://github.com/Tatsh/ports/blob/0ac5a6fb6f4c39bec98e5c52938b1895ce84c156/python/py-pyproject2setuppy/Portfile

Change History (3)

comment:1 Changed 2 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign removed
Summary: port lint --nitpick gives false warning when version is a single integer and python PortGroup is usedport lint --nitpick gives false warning when version is a single integer

It's not exactly related to the python portgroup or any portgroup. It's just how lint works. You set version to "9", and line 18 is your python.versions line which contains "39", which does contain "9", as it says. I've seen a similar problem in other ports with single integer version numbers where the lint warning can be triggered by checksums.

We could improve lint. For example, maybe it should only detect version numbers that are isolated by themselves and are not part of other numbers.

The "seems to hardcode the version number" lint check is not performed for some lines (specifically, currently, those that match (?:PortSystem|PortGroup|version|license|[A-Za-z0-9_]+\.setup)). We could add python.versions and potentially other options that wouldn't contain a port version to that list.

comment:2 Changed 23 months ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

comment:3 Changed 12 days ago by Tatsh (Andrew Udvare)

This can be closed as the PR has been merged.

Note: See TracTickets for help on using tickets.