Opened 8 years ago

Last modified 4 years ago

#52767 new enhancement

port lint should warn when modeline is missing

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.3.4
Keywords: Cc: mkae (Marko Käning), kurthindenburg (Kurt Hindenburg)
Port:

Description

port lint should warn if the Portfile doesn't have a modeline. We recommend a standard modeline, but some ports use a slightly different modeline, or make it span multiple lines, or put it at the end of the Portfile. While I would prefer port authors use the standard modeline at the top of the Portfile on a single line, for lint purposes we could probably allow any modeline anywhere. Or maybe that's too hard to code, in which case we could be more restrictive.

Change History (5)

comment:1 Changed 8 years ago by mkae (Marko Käning)

Cc: mkae added

comment:2 Changed 7 years ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

comment:3 Changed 7 years ago by jmroot (Joshua Root)

r-

The patch in the PR warns in every case except where exactly the recommended modeline is on the first line. The request here is to warn only if the Portfile doesn't have a modeline. The existing variation in modelines is valid because indentation style is up to the maintainer, and because some maintainers use a custom Portfile syntax highlighting mode in their editor and set the file type to Portfile in the modeline to enable that.

The other thing that lint should complain about is if the actual indentation doesn't match that declared in the modeline, but that might be difficult.

comment:4 Changed 7 years ago by kurthindenburg (Kurt Hindenburg)

There are about 2497 warnings with the modeline on the first line; there are about 3 modelines warnings on other lines in all the Portfiles (~20k).

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

In 24d3bd45be4359eb10fde4704e314b2df081eade/macports-base (master):

Check for tab characters in port lint

If a portfile uses a modeline that says tabs should be expanded, warn if
the portfile contains unexpanded tab characters.

See: #52767

Note: See TracTickets for help on using tickets.