diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 79e701b84..a3ce340a5 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -1 +1,11 @@ # Unreleased + +## Documentation + +* #589: Corrected configuration for Sonar documentation for host.url +* #535: Added more information about Sonar's usage of ``exclusions`` +* #596: Corrected and added more information regarding ``pyupgrade`` + +## Refactoring + +* #596: Added newline after header in versioned changelog 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 `__. diff --git a/doc/user_guide/features/metrics/sonar.rst b/doc/user_guide/features/metrics/sonar.rst index 696353a8a..77a767c29 100644 --- a/doc/user_guide/features/metrics/sonar.rst +++ b/doc/user_guide/features/metrics/sonar.rst @@ -53,10 +53,14 @@ In the code [tool.sonar] projectKey = "" - hostUrl = "https://sonarcloud.io" + host.url = "https://sonarcloud.io" organization = "exasol" exclusions = "/version.py,//*" +.. note:: + For more information, see the :ref:`General remarks ` section. + + .. _configure_sonar_private_project: **Private** GitHub repository @@ -98,8 +102,33 @@ In the code [tool.sonar] projectKey = "com.exasol:" - hostUrl = "https://sonar.exasol.com" + host.url = "https://sonar.exasol.com" 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 + +.. _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/**``. + +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. 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/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" 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