From 9be9c26ac6db8dce5bd0f3fcf909ffc822d10735 Mon Sep 17 00:00:00 2001 From: Spacetown <40258682+spacetown@users.noreply.github.com> Date: Sun, 7 Jul 2024 21:37:17 +0200 Subject: [PATCH 1/2] Fix code scanning alert 1 Inefficient regular expression changed to be less greedy. --- CHANGELOG.rst | 2 ++ gcovr/decision_analysis.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8a551b8e4c..efd1a8628a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,6 +24,8 @@ Bug fixes and small improvements: - Fix display filename in HTML report. (:issue:`920`) - Fix bundle of standalone executable with Python 3.12. (:issue:`924`) - Fix merging of function coverage data. (:issue:`925`) +- Fix inefficient regular expression. (:issue:`933`) + Documentation: diff --git a/gcovr/decision_analysis.py b/gcovr/decision_analysis.py index cbb27aa7b3..a3e1bbf628 100644 --- a/gcovr/decision_analysis.py +++ b/gcovr/decision_analysis.py @@ -37,7 +37,7 @@ _CPP_STYLE_COMMENT_PATTERN = re.compile(r"//.*?$") _WHITESPACE_PATTERN = re.compile(r"\s+") -_ONE_LINE_BRANCH = re.compile(r"^[^;]+{(?:.*;)*.*}$") +_ONE_LINE_BRANCH = re.compile(r"^[^;]+{(?:[^;]+;)*.*}$") # helper functions From 34801dd6b5f141c636d66485b46fd5f1f760b1e4 Mon Sep 17 00:00:00 2001 From: Spacetown <40258682+spacetown@users.noreply.github.com> Date: Sun, 7 Jul 2024 21:44:01 +0200 Subject: [PATCH 2/2] Add Spynx configuration for code scanning alerts --- CHANGELOG.rst | 2 +- doc/source/conf.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index efd1a8628a..c0e1414158 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,7 +24,7 @@ Bug fixes and small improvements: - Fix display filename in HTML report. (:issue:`920`) - Fix bundle of standalone executable with Python 3.12. (:issue:`924`) - Fix merging of function coverage data. (:issue:`925`) -- Fix inefficient regular expression. (:issue:`933`) +- Fix inefficient regular expression. (:issue:`933`, :security_issue:`1`) Documentation: diff --git a/doc/source/conf.py b/doc/source/conf.py index c7f815ec33..2bb468c680 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -191,4 +191,10 @@ # -- Options for extlinks extension ------------------------------------------ # see http://www.sphinx-doc.org/en/master/ext/extlinks.html -extlinks = {"issue": ("https://github.com/gcovr/gcovr/issues/%s", "#%s")} +extlinks = { + "issue": ("https://github.com/gcovr/gcovr/issues/%s", "#%s"), + "security_issue": ( + "https://github.com/gcovr/gcovr/security/code-scanning/%s", + "Code scanning alert #%s", + ), +}