Opened 4 years ago

Closed 13 months ago

#61980 closed defect (fixed)

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

Reported by: Tatsh (Andrew Udvare) Owned by:
Priority: Normal Milestone: MacPorts 2.8.0
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 (4)

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten 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 4 years ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

comment:3 Changed 22 months ago by Tatsh (Andrew Udvare)

This can be closed as the PR has been merged.

comment:4 Changed 13 months ago by jmroot (Joshua Root)

Milestone: MacPorts 2.8.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.