coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Split pathchk's -p into multiple flags?


From: Victor Engmark
Subject: Re: Split pathchk's -p into multiple flags?
Date: Tue, 07 Mar 2023 10:53:39 +1300
User-agent: Evolution 3.46.2

On Mon, 2023-01-09 at 13:55 +0000, Pádraig Brady wrote:
> On 08/01/2023 23:07, Victor Engmark via GNU coreutils General
> Discussion wrote:
> > Hi,
> > 
> > I'd like to enforce the POSIX portable file name character set in
> > my
> > projects, which `pathchk -p` does, but I don't want to enforce the
> > POSIX maximum path component length of 14 characters, which it also
> > does. Would it be useful to introduce separate flags for the three
> > rules enforced by `-p`? One to enforce non-empty file names, one to
> > enforce the POSIX portable file name character set, and one to
> > enforce
> > the POSIX maximum path component length.
> 
> This is a fair suggestion as the path component length is
> generally too restrictive these days.
> For example the coreutils sources don't comply with
> the POSIX 14 char limit.
> 
> I suppose we could have --posix=all,naming,length
> with -p equivalent to --posix=all

After a quick look through the pathchk source I don't think my
understanding is up to implementing this within a reasonable amount of
time, including tests and idiomatic code. So if anyone is interested,
please feel free to look into this.

Also, if using this with pre-commit there's a simple workaround
<https://github.com/linz/geostore/blob/57d1d2b6cf38671932858175bb66cb97b63eea04/.pre-commit-config.yaml#L47>
to bypass the file length check: `exclude: ^([a-zA-Z0-9._][a-zA-Z0-9._-
]+)(/[a-zA-Z0-9._][a-zA-Z0-9._-]+)*$`.

Cheers
Victor



reply via email to

[Prev in Thread] Current Thread [Next in Thread]