Re: [PATCH v4 2/2] parse-options.c: add style checks for usage-strings
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 25, 2022, 15:36 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2202251632320.11118@tvgsbejvaqbjf.bet>
- In-Reply-To
- <e1c5a3258263d05530f236c247603c2f342dac85.1645766599.git.gitgitgadget@gmail.com>
Hi Abhradeep,
On Fri, 25 Feb 2022, Abhradeep Chakraborty via GitGitGadget wrote:
Show 9 quoted lines
> From: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com> > > `parse-options.c` doesn't check if the usage strings for option flags > are following the style guide or not. Style convention says, usage > strings should not start with capital letter (unless needed) and > it should not end with `.`. > > Add checks to the `parse_options_check()` function to check usage > strings against the style convention.
As I just pointed out in https://lore.kernel.org/git/nycvar.QRO.7.76.6.2202251600210.11118@tvgsbejvaqbjf.bet/, it seems that replacing the static check presented in v1 by a runtime check needs to be reverted.
In addition to the example I presented, there is another compelling reason to do so: with the static check, we can detect incorrect usage strings in all code, even in code that is platform-dependent (such as in `fsmonitor--daemon`).
Ciao, Dscho