Project

General

Profile

Bug #6200

git-pbchk manlint regexp could be improved

Added by Toomas Soome about 4 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2015-09-03
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

The current manlint is a bit too generic while picking up manual pages:
ManfileRE = re.compile(r'.*\.[0-9][a-z]*$', re.IGNORECASE)

it means anything with suffix digit followed by chars from a-z will be considered as manual page. However, in illumos-gate the man pages are located in usr/src/man/man<section> tree and should therefore have suffix '.<section>'. In addition, the section name is not limited with number at start of the section name.

So the idea is to use following RE instead:
ManfileRE = re.compile(r'(.*/man(?P<foo>\d\w*)/.*\.(?P=foo))$', re.IGNORECASE)

it checks for man<section> where <section> still has to start with digit, but may contain chars and digits, and the file name must end with this section name. This RE will not limit the actual location of man<section> directory, but will reduce false positives.

Change suggested by Yuri Pankov, hint for RE from PMT on #illumos irc channel.

History

#1

Updated by Toomas Soome 9 months ago

  • Status changed from New to Closed

Dropping this one.

Also available in: Atom PDF