[PATCH] MISRA: Extend the R3.1 deviation for URLs to include git://

Andrew Cooper posted 1 patch 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260109131807.860397-1-andrew.cooper3@citrix.com
automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++--
docs/misra/deviations.rst                        | 4 ++--
docs/misra/rules.rst                             | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
[PATCH] MISRA: Extend the R3.1 deviation for URLs to include git://
Posted by Andrew Cooper 4 weeks ago
xen/drivers/passthrough/arm/ipmmu-vmsa.c contains a git:// URL in a block
comment.  This is also not an example of commented out code, so shouldn't be
considered a R3.1 violation.

Extend the regex to include git://, and swap hyperlink for URL in the
associated documentation to be more precise.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: consulting@bugseng.com <consulting@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>

https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2252341951
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++--
 docs/misra/deviations.rst                        | 4 ++--
 docs/misra/rules.rst                             | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 7dee4a488d45..30c323906924 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -58,9 +58,9 @@ removed by the compiler, the resulting slowdown is negligible."
 # Series 3.
 #
 
--doc_begin="Comments starting with '/*' and containing hyperlinks are safe as
+-doc_begin="Comments starting with '/*' and containing URLs are safe as
 they are not instances of commented-out code."
--config=MC3A2.R3.1,reports+={safe, "first_area(text(^.*https?://.*$))"}
+-config=MC3A2.R3.1,reports+={safe, "first_area(text(^.*(https?|git)://.*$))"}
 -doc_end
 
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 0d90f5886e7e..17c21537f286 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -117,8 +117,8 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR.
 
    * - R3.1
-     - Comments starting with '/\*' and containing hyperlinks are safe as they
-       are not instances of commented-out code.
+     - Comments starting with '/\*' and containing URLs are safe as they are
+       not instances of commented-out code.
      - Tagged as `safe` for ECLAIR.
 
    * - R5.3
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 4e9425188742..b3e929307d51 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -143,7 +143,7 @@ maintainers if you want to suggest a change.
      - Required
      - The character sequences /* and // shall not be used within a
        comment
-     - Comments containing hyperlinks inside C-style block comments are safe
+     - Comments containing URLs inside C-style block comments are safe
 
    * - `Rule 3.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_03_02.c>`_
      - Required
-- 
2.39.5


Re: [PATCH] MISRA: Extend the R3.1 deviation for URLs to include git://
Posted by Nicola Vetrini 4 weeks ago
On 2026-01-09 14:18, Andrew Cooper wrote:
> xen/drivers/passthrough/arm/ipmmu-vmsa.c contains a git:// URL in a 
> block
> comment.  This is also not an example of commented out code, so 
> shouldn't be
> considered a R3.1 violation.
> 
> Extend the regex to include git://, and swap hyperlink for URL in the
> associated documentation to be more precise.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: consulting@bugseng.com <consulting@bugseng.com>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2252341951
> ---
>  automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++--
>  docs/misra/deviations.rst                        | 4 ++--
>  docs/misra/rules.rst                             | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
> b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index 7dee4a488d45..30c323906924 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -58,9 +58,9 @@ removed by the compiler, the resulting slowdown is 
> negligible."
>  # Series 3.
>  #
> 
> --doc_begin="Comments starting with '/*' and containing hyperlinks are 
> safe as
> +-doc_begin="Comments starting with '/*' and containing URLs are safe 
> as
>  they are not instances of commented-out code."
> --config=MC3A2.R3.1,reports+={safe, 
> "first_area(text(^.*https?://.*$))"}
> +-config=MC3A2.R3.1,reports+={safe, 
> "first_area(text(^.*(https?|git)://.*$))"}
>  -doc_end
> 
>  #
> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
> index 0d90f5886e7e..17c21537f286 100644
> --- a/docs/misra/deviations.rst
> +++ b/docs/misra/deviations.rst
> @@ -117,8 +117,8 @@ Deviations related to MISRA C:2012 Rules:
>       - Tagged as `deliberate` for ECLAIR.
> 
>     * - R3.1
> -     - Comments starting with '/\*' and containing hyperlinks are safe 
> as they
> -       are not instances of commented-out code.
> +     - Comments starting with '/\*' and containing URLs are safe as 
> they are
> +       not instances of commented-out code.
>       - Tagged as `safe` for ECLAIR.
> 
>     * - R5.3
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index 4e9425188742..b3e929307d51 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -143,7 +143,7 @@ maintainers if you want to suggest a change.
>       - Required
>       - The character sequences /* and // shall not be used within a
>         comment
> -     - Comments containing hyperlinks inside C-style block comments 
> are safe
> +     - Comments containing URLs inside C-style block comments are safe
> 
>     * - `Rule 3.2 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_03_02.c>`_
>       - Required

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253

Re: [PATCH] MISRA: Extend the R3.1 deviation for URLs to include git://
Posted by Orzel, Michal 4 weeks ago

On 09/01/2026 14:18, Andrew Cooper wrote:
> xen/drivers/passthrough/arm/ipmmu-vmsa.c contains a git:// URL in a block
> comment.  This is also not an example of commented out code, so shouldn't be
> considered a R3.1 violation.
> 
> Extend the regex to include git://, and swap hyperlink for URL in the
> associated documentation to be more precise.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>

~Michal