[cfe-dev] [clang-tidy][RFC] Add Autosar C++14 clang-tidy module?

Aaron Ballman via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 27 10:46:55 PDT 2021


On Wed, Oct 27, 2021 at 11:29 AM Carlos Galvez via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> Hi!
>
> We are following the Autosar C++14 guidelines and were thinking to add a clang-tidy module for it and start implementing checks. There's a couple local forks with some checks here and there but never made it upstream. I believe quite a lot of them are already covered by the existing checks (e.g. cppcoreguidelines) so most of the work would be about creating aliases and adding some extra configuration.
>
> What do you think, would that be ok? Both about adding the Autosar module itself, but also making aliases from one coding guideline (e.g. cppcoreguidelines) to another coding guideline (autosar). Typically the alias is from a non-coding guideline (e.g. bugprone) to a coding guideline (cppcoreguidelines).
>
> We can of course have our own local fork but it's nice to be able to contribute upstream so everyone can benefit. Autosar would fit well together with the existing guidelines (CppCoreGuidlines, CERT, HiCPP, etc).

Personally, I'm okay with adding a module for AUTOSAR checks. It's an
industry standard set of coding conventions like many of the other
modules we have. However, one issue we've run into with things like
the C++ Core Guidelines is a lack of a useful feedback loop when there
are enforcement questions. Do you have contacts with anyone
maintaining AUTOSAR so that if we run into questions we'll have some
guidance on how to resolve them?

As for aliases from one coding guideline to another; I think that's
fine. We already have the issue where changing the primary check may
cause the alias to no longer be valid, so I don't think this would
introduce any new problems we don't already have to watch out for. One
thing that could get a bit weird is with documentation (aliases
typically automatically redirect back to their primary check, so it
might be weird to go to the docs for an AUTOSAR check and wind up in
CERT C++ or something. But if that causes problems in practice, I
think they can be handled as they come up.

~Aaron

>
> Best regards,
> Carlos
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list