Project

General

Profile

Actions

Bug #6200

closed

git-pbchk manlint regexp could be improved

Added by Toomas Soome over 8 years ago. Updated almost 5 years 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
Gerrit CR:
External Bug:

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.

Actions #1

Updated by Toomas Soome almost 5 years ago

  • Status changed from New to Closed

Dropping this one.

Actions

Also available in: Atom PDF