From 8e23fb1ddfa6c56314f01c93eb5451188397454d Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 5 Nov 2025 08:48:55 +0100 Subject: [PATCH 1/7] Corrected configuration for Sonar documentation for host.url --- doc/changes/unreleased.md | 4 ++++ doc/user_guide/features/metrics/sonar.rst | 4 ++-- project-template/{{cookiecutter.repo_name}}/pyproject.toml | 2 +- pyproject.toml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 79e701b84..ee950ec04 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -1 +1,5 @@ # Unreleased + +## Documentation + +* #589: Corrected configuration for Sonar documentation for host.url diff --git a/doc/user_guide/features/metrics/sonar.rst b/doc/user_guide/features/metrics/sonar.rst index 696353a8a..18f2f24fe 100644 --- a/doc/user_guide/features/metrics/sonar.rst +++ b/doc/user_guide/features/metrics/sonar.rst @@ -53,7 +53,7 @@ In the code [tool.sonar] projectKey = "" - hostUrl = "https://sonarcloud.io" + host.url = "https://sonarcloud.io" organization = "exasol" exclusions = "/version.py,//*" @@ -98,7 +98,7 @@ In the code [tool.sonar] projectKey = "com.exasol:" - hostUrl = "https://sonar.exasol.com" + host.url = "https://sonar.exasol.com" organization = "exasol" exclusions = "/version.py,//*" diff --git a/project-template/{{cookiecutter.repo_name}}/pyproject.toml b/project-template/{{cookiecutter.repo_name}}/pyproject.toml index 9f6e8f0d6..9e162d773 100644 --- a/project-template/{{cookiecutter.repo_name}}/pyproject.toml +++ b/project-template/{{cookiecutter.repo_name}}/pyproject.toml @@ -65,6 +65,6 @@ ignore_errors = true [tool.sonar] projectKey = "com.exasol:{{cookiecutter.repo_name}}" -hostUrl = "https://sonarcloud.io" +host.url = "https://sonarcloud.io" organization = "exasol" exclusions = "exasol/{{cookiecutter.package_name}}/version.py" diff --git a/pyproject.toml b/pyproject.toml index ffcfc91b0..22e275e09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,6 +120,6 @@ poetry-plugin-export = ">=1.8" [tool.sonar] projectKey = "com.exasol:python-toolbox" -hostUrl = "https://sonarcloud.io" +host.url = "https://sonarcloud.io" organization = "exasol" exclusions = "exasol/toolbox/version.py" From b664cda5363c8e3815ed71253eab9351d685979c Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 5 Nov 2025 08:52:54 +0100 Subject: [PATCH 2/7] Add new line after header at the top of the versionsed changelog --- doc/changes/unreleased.md | 4 ++++ exasol/toolbox/util/release/changelog.py | 2 +- test/unit/util/release/changelog_test.py | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index ee950ec04..b23994832 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -3,3 +3,7 @@ ## Documentation * #589: Corrected configuration for Sonar documentation for host.url + +## Refactoring + +* #589: Added newline after header in versioned changelog diff --git a/exasol/toolbox/util/release/changelog.py b/exasol/toolbox/util/release/changelog.py index 96712f44d..fad6f5b1d 100644 --- a/exasol/toolbox/util/release/changelog.py +++ b/exasol/toolbox/util/release/changelog.py @@ -50,7 +50,7 @@ def _create_versioned_changelog(self, unreleased_content: str) -> None: if dependency_changes := self._describe_dependency_changes(): dependency_content = f"## Dependency Updates\n{dependency_changes}" - template = cleandoc(f"{header}\n{unreleased_content}\n{dependency_content}") + template = cleandoc(f"{header}\n\n{unreleased_content}\n{dependency_content}") self.versioned_changelog_md.write_text(template + "\n") def _extract_unreleased_notes(self) -> str: diff --git a/test/unit/util/release/changelog_test.py b/test/unit/util/release/changelog_test.py index 55c882388..bd332612c 100644 --- a/test/unit/util/release/changelog_test.py +++ b/test/unit/util/release/changelog_test.py @@ -181,6 +181,7 @@ def test_update_changelogs_for_release( saved_text == cleandoc( f"""# 1.0.0 - {datetime.today().strftime('%Y-%m-%d')} + ## Added * Added Awesome feature @@ -218,6 +219,7 @@ def test_update_changelogs_for_release_with_no_dependencies( saved_text == cleandoc( f"""# 1.0.0 - {datetime.today().strftime('%Y-%m-%d')} + ## Added * Added Awesome feature From ddb3f0e113ecdcd7e65d48d7762de61e19e3cb67 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 5 Nov 2025 08:56:55 +0100 Subject: [PATCH 3/7] Add reference to Sonar's analysis parameter page --- doc/user_guide/features/metrics/sonar.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/user_guide/features/metrics/sonar.rst b/doc/user_guide/features/metrics/sonar.rst index 18f2f24fe..c3ac7346f 100644 --- a/doc/user_guide/features/metrics/sonar.rst +++ b/doc/user_guide/features/metrics/sonar.rst @@ -19,6 +19,10 @@ Section :ref:`configuration` gives instructions for public and private repositor Configuration +++++++++++++ +.. note:: + For additional configuration information, see + `Sonar's analysis parameters `__ page. + .. _configure_sonar_public_project: **Public** GitHub repository From d87f2fe25135f7037340c2bcf31120dda58938ee Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 5 Nov 2025 09:05:17 +0100 Subject: [PATCH 4/7] Add more information about exclusions --- doc/changes/unreleased.md | 1 + doc/user_guide/features/metrics/sonar.rst | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index b23994832..782da7d9e 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -3,6 +3,7 @@ ## Documentation * #589: Corrected configuration for Sonar documentation for host.url +* #535: Added more information about Sonar's usage of ``exclusions`` ## Refactoring diff --git a/doc/user_guide/features/metrics/sonar.rst b/doc/user_guide/features/metrics/sonar.rst index c3ac7346f..884f486be 100644 --- a/doc/user_guide/features/metrics/sonar.rst +++ b/doc/user_guide/features/metrics/sonar.rst @@ -61,6 +61,16 @@ In the code organization = "exasol" exclusions = "/version.py,//*" +.. note:: + With the value of ``exclusions``, you can exclude files and directories of your + project from Sonar's analysis: + + * You can use wildcards, e.g. ``/dir/*.py`` or ``/**/*.py`` + * Multiple exclusions can be comma-separated (as shown above). + * For excluding arbitrary directories and files below a specific directory, please use two asterisks, e.g. ``root/abc/**``. + + See the `Sonar Matching Patterns`_ for more details. + .. _configure_sonar_private_project: **Private** GitHub repository @@ -107,3 +117,14 @@ In the code exclusions = "/version.py,//*" .. _Exasol Way: https://sonarcloud.io/organizations/exasol/quality_gates/show/AXxvLH-3BdtLlpiYmZhh +.. _Sonar Matching Patterns: https://docs.sonarsource.com/sonarqube-server/project-administration/setting-analysis-scope/defining-matching-patterns + +.. note:: + With the value of ``exclusions``, you can exclude files and directories of your + project from Sonar's analysis: + + * You can use wildcards, e.g. ``/dir/*.py`` or ``/**/*.py`` + * Multiple exclusions can be comma-separated (as shown above). + * For excluding arbitrary directories and files below a specific directory, please use two asterisks, e.g. ``root/abc/**``. + + See the `Sonar Matching Patterns`_ for more details. From e3817afcd1b35382fb0622c3dd72c18730dde09f Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 5 Nov 2025 09:22:09 +0100 Subject: [PATCH 5/7] Add and correct information on pyupgrade usage --- doc/changes/unreleased.md | 1 + doc/user_guide/features/formatting_code/index.rst | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 782da7d9e..f9eac42b0 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -4,6 +4,7 @@ * #589: Corrected configuration for Sonar documentation for host.url * #535: Added more information about Sonar's usage of ``exclusions`` +* #589: Corrected and added more information regarding ``pyupgrade`` ## Refactoring diff --git a/doc/user_guide/features/formatting_code/index.rst b/doc/user_guide/features/formatting_code/index.rst index 3345d76f4..8cc849cca 100644 --- a/doc/user_guide/features/formatting_code/index.rst +++ b/doc/user_guide/features/formatting_code/index.rst @@ -44,6 +44,7 @@ deterministic manner. Configuration +++++++++++++ + black ^^^^^ @@ -59,6 +60,7 @@ For further configuration options, see isort ^^^^^ + Ensure ``isort`` is configured with compatibility for ``black``: .. literalinclude:: ../../../../project-template/{{cookiecutter.repo_name}}/pyproject.toml @@ -72,9 +74,10 @@ For further configuration options, see pyupgrade ^^^^^^^^^ -No initial configuration of ``pyupgrade`` is required. -For individual configuration, see the -`pyupgrade CLI options `__. These can -be passed to the :ref:`formatting_sessions` via the ``pyupgrade_args`` -attribute of the :class:`noxconfig.Config`. +No initial configuration of ``pyupgrade`` is required. By default, this is +configured to be derived from the minimum Python version that your project supports +and is defined in the :meth:`exasol.toolbox.config.BaseConfig.pyupgrade_argument`. + +For further configuration options, see the +`pyupgrade documentation `__. From 1f57420bf82b347bdf9492cdc715084391876227 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 5 Nov 2025 12:35:10 +0100 Subject: [PATCH 6/7] Switch these to a dedicated issue created to resolve them --- doc/changes/unreleased.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index f9eac42b0..a3ce340a5 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -4,8 +4,8 @@ * #589: Corrected configuration for Sonar documentation for host.url * #535: Added more information about Sonar's usage of ``exclusions`` -* #589: Corrected and added more information regarding ``pyupgrade`` +* #596: Corrected and added more information regarding ``pyupgrade`` ## Refactoring -* #589: Added newline after header in versioned changelog +* #596: Added newline after header in versioned changelog From a99f5a4639850e677c1752f6f5e2028b771b706b Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 5 Nov 2025 12:46:01 +0100 Subject: [PATCH 7/7] Reduce duplicate information by creating a General remarks section --- doc/user_guide/features/metrics/sonar.rst | 40 +++++++++++++---------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/doc/user_guide/features/metrics/sonar.rst b/doc/user_guide/features/metrics/sonar.rst index 884f486be..77a767c29 100644 --- a/doc/user_guide/features/metrics/sonar.rst +++ b/doc/user_guide/features/metrics/sonar.rst @@ -19,10 +19,6 @@ Section :ref:`configuration` gives instructions for public and private repositor Configuration +++++++++++++ -.. note:: - For additional configuration information, see - `Sonar's analysis parameters `__ page. - .. _configure_sonar_public_project: **Public** GitHub repository @@ -62,14 +58,8 @@ In the code exclusions = "/version.py,//*" .. note:: - With the value of ``exclusions``, you can exclude files and directories of your - project from Sonar's analysis: - - * You can use wildcards, e.g. ``/dir/*.py`` or ``/**/*.py`` - * Multiple exclusions can be comma-separated (as shown above). - * For excluding arbitrary directories and files below a specific directory, please use two asterisks, e.g. ``root/abc/**``. + For more information, see the :ref:`General remarks ` section. - See the `Sonar Matching Patterns`_ for more details. .. _configure_sonar_private_project: @@ -116,15 +106,29 @@ In the code organization = "exasol" exclusions = "/version.py,//*" +.. note:: + For more information, see the :ref:`General remarks ` section. + .. _Exasol Way: https://sonarcloud.io/organizations/exasol/quality_gates/show/AXxvLH-3BdtLlpiYmZhh .. _Sonar Matching Patterns: https://docs.sonarsource.com/sonarqube-server/project-administration/setting-analysis-scope/defining-matching-patterns -.. note:: - With the value of ``exclusions``, you can exclude files and directories of your - project from Sonar's analysis: +.. _configuration_general_remarks: + +General remarks +^^^^^^^^^^^^^^^^^^^ +For additional configuration information, see `Sonar's analysis parameters `__ page. + +``exclusions`` +"""""""""""""" +With the value of ``exclusions``, you can exclude files and directories of your +project from Sonar's analysis: + +* You can use wildcards, e.g. ``/dir/*.py`` or ``/**/*.py`` +* Multiple exclusions can be comma-separated (as shown above). +* For excluding arbitrary directories and files below a specific directory, please use two asterisks, e.g. ``root/abc/**``. - * You can use wildcards, e.g. ``/dir/*.py`` or ``/**/*.py`` - * Multiple exclusions can be comma-separated (as shown above). - * For excluding arbitrary directories and files below a specific directory, please use two asterisks, e.g. ``root/abc/**``. +See the `Sonar Matching Patterns`_ for more details. - See the `Sonar Matching Patterns`_ for more details. +By default, the nox session ``sonar:check`` only analyses the source code, +as specified by the ``PROJECT_CONFIG.source``, so directories outside of this +are already excluded from being analyzed.