Re: Proposal to have a script to check MR for common mistakes

Ben Cooksley <[email protected]>
Newsgroups gmane.comp.kde.devel.general
Message-ID <CA+XidOHFqt2zCD+m9sVMCHuXFQFucsLNoTsUMEN0EmgFHMkK-A@mail.gmail.com>
Hi Aleix,

Commit hooks are something that can only apply at a global level and don't
really allow for individual (per-repo) rules to be applied.
While technically we could do so, it wouldn't apply to forks so you'd still
end up with issues.

Given we can enforce it globally i'd be happy to add the bugs.kde.org
filter (ensuring people reference BUG/CCBUG instead) as that is relatively
straight forward.
The ones for tags like \since though are more complex and best left to
something that can examine all of the code - like a CI job.

The rule to prevent links to invent.kde.org is not one i'm sure about as
there are plenty of legitimate reasons to refer to activity on
invent.kde.org.

Cheers,
Ben

On Fri, Aug 14, 2026 at 11:31 AM Aleix Pol <[email protected]> wrote:

> +1
>
> Those that happen in the code, if it's possible to set them as commit
> hooks, that would be even better I find.
>
> Aleix
>
> On Tue, Aug 11, 2026 at 7:01 PM Méven <[email protected]> wrote:
> >
> > Hi everyone,
> >
> > I'd like to add a script to our ci-utilities to allow failure builds
> based on regular mistakes that regular contributors or newcomers can make.
> >
> > Like:
> >  - putting links to invent.kde.org in commits
> >  - having \since but the incorrect version
> >  - missing \since on new API
> >  - having links to bugs, instead of using our BUG:/CCBUG:
> >
> > I have implemented them:
> > https://invent.kde.org/sysadmin/ci-utilities/-/merge_requests/700
> >
> > And I am thinking about another one:
> >  - prevent commit message prefix with "fix:" or "feature"
> >
> > As a dolphin maintainer and kio one, I really would enjoy those as they
> will reduce the number of times I have to repeat myself.
> >
> > All of those would be opt-in, not all projects have such preferences.
> > This would be similar to our clang-format check
> https://invent.kde.org/sysadmin/ci-utilities/-/blob/master/run-clang-format.py?ref_type=heads
> that a few projects have adopted (dolphin, Kwin)
> >
> > Later I would like to add to those build failures comments on MR with
> friendly instructions on how to fix them, or having suggestions, like the
> expected version for \since.
> >
> > Many FOSS projects have such bots/checks, It would be great to add that
> to lessen the reviewer burden while upholding best practices.
> >
> > What do you think?
> >
> > --
> > Méven
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.