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

Quentin Schulz <[email protected]> Tue, 28 Jul 2026 11:10:42 +0200
Newsgroups org.yoctoproject.lists.docs
Message-ID <[email protected]>
Hi Antonin,

On 7/28/26 10:40 AM, Antonin Godard wrote:
> 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,
>>>
>>> On Mon Jul 20, 2026 at 6:39 PM CEST, Quentin Schulz via lists.yoctoproject.org wrote:
>>>> Hi Antonin,
>>>>
>>>> On 7/16/26 2:18 PM, Antonin Godard via lists.yoctoproject.org wrote:
>> [...]
>>>>> +def main():
>>>>> +    args = parse_arguments()
>>>>> +
>>>>> +    yocto_docs_dict = {}
>>>>> +
>>>>> +    if not args.yocto_docs_inv.exists():
>>>>> +        print(f"yocto-docs inventory not found at {args.yocto_docs_inv}, "
>>>>> +              "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?
>>>
>>> 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 that
>>> could signify a SKIP.
>>>
>>
>> Mmmmm... Any chance this can be configurable? I'm thinking people may
>> want to run this script outside of pre-commit. Maybe via a parameter you
>> pass to pre-commit for example, or via an environment variable that is
>> 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.
> 

Exactly what I had in my mind with my first suggestion, just had it 
poorly worded :) So we're thinking the same thing!

Cheers,
Quentin