Re: [docs] [PATCH v2 3/4] tools: add gen-doc-links to generate documentation link flags

"Antonin Godard" <[email protected]> Tue, 28 Jul 2026 10:40:56 +0200
Newsgroups org.yoctoproject.lists.docs
Message-ID <[email protected]>
Hi,

On Fri Jul 24, 2026 at 6:27 PM CEST, Quentin Schulz via lists.yoctoproject.=
org wrote:
> Hi Antonin,
>
> On 7/24/26 3:40 PM, Antonin Godard wrote:
>> Hi,
>>=20
>> On Mon Jul 20, 2026 at 6:39 PM CEST, Quentin Schulz via lists.yoctoproje=
ct.org wrote:
>>> Hi Antonin,
>>>
>>> On 7/16/26 2:18 PM, Antonin Godard via lists.yoctoproject.org wrote:
> [...]
>>>> +def main():
>>>> +    args =3D parse_arguments()
>>>> +
>>>> +    yocto_docs_dict =3D {}
>>>> +
>>>> +    if not args.yocto_docs_inv.exists():
>>>> +        print(f"yocto-docs inventory not found at {args.yocto_docs_in=
v}, "
>>>> +              "use the --yocto-docs-inv option or set YOCTO_DOCS_INV_=
PATH "
>>>> +              "in your environment")
>>>> +        sys.exit(0)
>>>> +
>>>> +    if not args.bitbake_inv.exists():
>>>> +        print(f"bitbake inventory not found at {args.yocto_docs_inv},=
 "
>>>> +              "use the --bitbake-inv option or set BITBAKE_INV_PATH "
>>>> +              "in your environment")
>>>> +        sys.exit(0)
>>>
>>> Don't you want to sys.exit(1) here (and above) instead to show the user
>>> this is an error?
>>=20
>> I did not want to block creating a commit because the docs wasn't built.
>> I looked a bit at it and pre-commit does not have a special error code t=
hat
>> could signify a SKIP.
>>=20
>
> Mmmmm... Any chance this can be configurable? I'm thinking people may=20
> want to run this script outside of pre-commit. Maybe via a parameter you=
=20
> pass to pre-commit for example, or via an environment variable that is=20
> set in pre-commit?

Actually an argument like --no-exit-code which is passed only from the
pre-commit configuration file might do the trick, I'll see what I can do.

Thanks!
Antonin