diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 60628c246..3bdc32f96 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -158,7 +158,7 @@ jobs: uses: ./.github/actions/python-environment - name: Run format check - run: poetry run -- nox -s project:format + run: poetry run -- nox -s format:check Build-Packages: name: Build Package Check diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec91ee524..9da14ce57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: types: [ python ] pass_filenames: false language: system - entry: poetry run -- nox -s project:fix + entry: poetry run -- nox -s format:fix stages: [ pre-commit ] - repo: local @@ -39,4 +39,4 @@ repos: - id: end-of-file-fixer stages: [ pre-commit ] - id: trailing-whitespace - stages: [ pre-commit ] \ No newline at end of file + stages: [ pre-commit ] diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 79e701b84..eb010753d 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -1 +1,5 @@ # Unreleased + +## Refactoring + +* #606: Renamed nox session `project:fix` more aptly to `format:fix` and `project:format` to `format:check` diff --git a/doc/user_guide/features/formatting_code/index.rst b/doc/user_guide/features/formatting_code/index.rst index ded96f8d7..2f769e61e 100644 --- a/doc/user_guide/features/formatting_code/index.rst +++ b/doc/user_guide/features/formatting_code/index.rst @@ -38,9 +38,9 @@ deterministic manner. +--------------------+------------------+------------------------------------+ | Nox session | CI Usage | Action | +====================+==================+====================================+ -| ``project:fix`` | No | Applies code formatting changes | +| ``format:fix`` | No | Applies code formatting changes | +--------------------+------------------+------------------------------------+ -| ``project:format`` | ``checks.yml`` | Checks that current code does not | +| ``format:check`` | ``checks.yml`` | Checks that current code does not | | | | need to be re-formatted | +--------------------+------------------+------------------------------------+ diff --git a/doc/user_guide/features/formatting_code/troubleshooting.rst b/doc/user_guide/features/formatting_code/troubleshooting.rst index a2cac89e5..1e9e39ebf 100644 --- a/doc/user_guide/features/formatting_code/troubleshooting.rst +++ b/doc/user_guide/features/formatting_code/troubleshooting.rst @@ -3,15 +3,15 @@ Troubleshooting =============== -Formatting still fails after running ``project:fix`` +Formatting still fails after running ``format:fix`` ---------------------------------------------------- If when you execute: -#. Run ``project:fix`` -#. Run ``project:format`` +#. Run ``format:fix`` +#. Run ``format:check`` -you receive an error from ``project:format`` (i.e. ``isort`` or ``black``), it it +you receive an error from ``format:check`` (i.e. ``isort`` or ``black``), it it likely that you need to update your configuration to align with :ref:`formatting_configuration`. @@ -44,7 +44,7 @@ might want to ignore automatically applied formatting. +-----------------------+--------------------------------+-----------------------+ -In the ``checks.yml``, ``project:format`` wants me to reformat code I did not modify +In the ``checks.yml``, ``format:check`` wants me to reformat code I did not modify ------------------------------------------------------------------------------------ This is likely due to one of our tools (i.e. ``black``) being upgraded. Within the diff --git a/doc/user_guide/migrating.rst b/doc/user_guide/migrating.rst index 8463c48b3..fcbea6163 100644 --- a/doc/user_guide/migrating.rst +++ b/doc/user_guide/migrating.rst @@ -63,9 +63,9 @@ For example, if test execution isn't performed in the standard way (e.g., :code: from exasol.toolbox.nox.tasks import * # pylint: disable=wildcard-import disable=unused-wildcard-import # default actions to be run if nothing is explicitly specified with the -s option - nox.options.sessions = ["project:fix"] + nox.options.sessions = ["format:fix"] - @nox.session(name="project:fix", python=False) + @nox.session(name="format:fix", python=False) def my_project_fix_overwrite(session) -> None: """Runs all automated fixes on the code base""" @@ -75,7 +75,7 @@ For example, if test execution isn't performed in the standard way (e.g., :code: from exasol.toolbox.nox._shared import python_files py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)] - print("The original 'project:fix' task has been taken hostage by this overwrite") + print("The original 'format:fix' task has been taken hostage by this overwrite") print("Files:\n{files}".format(files="\n".join(py_files)) diff --git a/exasol/toolbox/nox/_format.py b/exasol/toolbox/nox/_format.py index 9e2789ef9..551ab0ec1 100644 --- a/exasol/toolbox/nox/_format.py +++ b/exasol/toolbox/nox/_format.py @@ -42,9 +42,9 @@ def command(*args: str) -> Iterable[str]: session.run(*command("ruff", "check"), *files) -@nox.session(name="project:fix", python=False) -def fix(session: Session) -> None: - """Runs all automated fixes on the code base""" +@nox.session(name="format:fix", python=False) +def fix_format(session: Session) -> None: + """Runs all automated format fixes on the code base""" py_files = python_files(PROJECT_CONFIG.root) _version(session, Mode.Fix) _pyupgrade(session, config=PROJECT_CONFIG, files=py_files) @@ -52,8 +52,8 @@ def fix(session: Session) -> None: _code_format(session, Mode.Fix, py_files) -@nox.session(name="project:format", python=False) -def fmt_check(session: Session) -> None: +@nox.session(name="format:check", python=False) +def check_format(session: Session) -> None: """Checks the project for correct formatting""" py_files = python_files(PROJECT_CONFIG.root) _ruff(session, mode=Mode.Check, files=py_files) diff --git a/exasol/toolbox/nox/_package_version.py b/exasol/toolbox/nox/_package_version.py index c20c66d2b..a1a04d471 100644 --- a/exasol/toolbox/nox/_package_version.py +++ b/exasol/toolbox/nox/_package_version.py @@ -23,7 +23,7 @@ """ ATTENTION: This file is generated by exasol/toolbox/nox/_package_version.py when using: - * either "poetry run -- nox -s project:fix" + * either "poetry run -- nox -s format:fix" * or "poetry run -- nox -s version:check -- --fix" Do not edit this file manually! If you need to change the version, do so in the pyproject.toml, e.g. by using diff --git a/exasol/toolbox/nox/tasks.py b/exasol/toolbox/nox/tasks.py index dbb0c257b..14638c92c 100644 --- a/exasol/toolbox/nox/tasks.py +++ b/exasol/toolbox/nox/tasks.py @@ -6,7 +6,7 @@ "check", "clean_docs", "coverage", - "fix", + "fix_format", "integration_tests", "lint", "open_docs", @@ -22,7 +22,7 @@ # ruff: noqa F401 from exasol.toolbox.nox._format import ( _code_format, - fix, + fix_format, ) # fmt: off diff --git a/exasol/toolbox/templates/github/workflows/checks.yml b/exasol/toolbox/templates/github/workflows/checks.yml index 0ec942e5b..ea4ead6c2 100644 --- a/exasol/toolbox/templates/github/workflows/checks.yml +++ b/exasol/toolbox/templates/github/workflows/checks.yml @@ -158,7 +158,7 @@ jobs: uses: exasol/python-toolbox/.github/actions/python-environment@v3 - name: Run format check - run: poetry run -- nox -s project:format + run: poetry run -- nox -s format:check Build-Packages: name: Build Package Check diff --git a/exasol/toolbox/templates/noxfile.py b/exasol/toolbox/templates/noxfile.py index 176dbf97b..40a6dc204 100644 --- a/exasol/toolbox/templates/noxfile.py +++ b/exasol/toolbox/templates/noxfile.py @@ -4,4 +4,4 @@ from exasol.toolbox.nox.tasks import * # default actions to be run if nothing is explicitly specified with the -s option -nox.options.sessions = ["project:fix"] +nox.options.sessions = ["format:fix"] diff --git a/exasol/toolbox/templates/pre-commit-config.yaml b/exasol/toolbox/templates/pre-commit-config.yaml index d969b35f1..b4eaf6b80 100644 --- a/exasol/toolbox/templates/pre-commit-config.yaml +++ b/exasol/toolbox/templates/pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: types: [ python ] pass_filenames: false language: system - entry: poetry run -- nox -s project:fix + entry: poetry run -- nox -s format:fix - repo: local hooks: diff --git a/exasol/toolbox/version.py b/exasol/toolbox/version.py index b8e8196ef..920a0196d 100644 --- a/exasol/toolbox/version.py +++ b/exasol/toolbox/version.py @@ -1,7 +1,7 @@ """ ATTENTION: This file is generated by exasol/toolbox/nox/_package_version.py when using: - * either "poetry run -- nox -s project:fix" + * either "poetry run -- nox -s format:fix" * or "poetry run -- nox -s version:check -- --fix" Do not edit this file manually! If you need to change the version, do so in the pyproject.toml, e.g. by using diff --git a/noxfile.py b/noxfile.py index b67ac16a7..63e1a63ad 100644 --- a/noxfile.py +++ b/noxfile.py @@ -6,7 +6,7 @@ from exasol.toolbox.nox.tasks import * # pylint: disable=wildcard-import disable=unused-wildcard-import # default actions to be run if nothing is explicitly specified with the -s option -nox.options.sessions = ["project:fix"] +nox.options.sessions = ["format:fix"] # entry point for debugging diff --git a/poetry.lock b/poetry.lock index 265fcf5dd..9dddbdb29 100644 --- a/poetry.lock +++ b/poetry.lock @@ -228,14 +228,14 @@ testing = ["jaraco.test", "pytest (!=8.0.*)", "pytest (>=6,!=8.1.*)", "pytest-ch [[package]] name = "bandit" -version = "1.9.1" +version = "1.9.2" description = "Security oriented static analyser for python code." optional = false python-versions = ">=3.10" groups = ["main"] files = [ - {file = "bandit-1.9.1-py3-none-any.whl", hash = "sha256:0a1f34c04f067ee28985b7854edaa659c9299bd71e1b7e18236e46cccc79720b"}, - {file = "bandit-1.9.1.tar.gz", hash = "sha256:6dbafd1a51e276e065404f06980d624bad142344daeac3b085121fcfd117b7cf"}, + {file = "bandit-1.9.2-py3-none-any.whl", hash = "sha256:bda8d68610fc33a6e10b7a8f1d61d92c8f6c004051d5e946406be1fb1b16a868"}, + {file = "bandit-1.9.2.tar.gz", hash = "sha256:32410415cd93bf9c8b91972159d5cf1e7f063a9146d70345641cd3877de348ce"}, ] [package.dependencies] @@ -1042,15 +1042,15 @@ dates = ["pytz (>=2019.1)"] [[package]] name = "exceptiongroup" -version = "1.3.0" +version = "1.3.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" groups = ["main"] markers = "python_version == \"3.10\"" files = [ - {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, - {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, + {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, + {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, ] [package.dependencies] @@ -2030,14 +2030,14 @@ uv = ["uv (>=0.1.6)"] [[package]] name = "packageurl-python" -version = "0.17.5" +version = "0.17.6" description = "A purl aka. Package URL parser and builder" optional = false python-versions = ">=3.8" groups = ["main"] files = [ - {file = "packageurl_python-0.17.5-py3-none-any.whl", hash = "sha256:f0e55452ab37b5c192c443de1458e3f3b4d8ac27f747df6e8c48adeab081d321"}, - {file = "packageurl_python-0.17.5.tar.gz", hash = "sha256:a7be3f3ba70d705f738ace9bf6124f31920245a49fa69d4b416da7037dd2de61"}, + {file = "packageurl_python-0.17.6-py3-none-any.whl", hash = "sha256:31a85c2717bc41dd818f3c62908685ff9eebcb68588213745b14a6ee9e7df7c9"}, + {file = "packageurl_python-0.17.6.tar.gz", hash = "sha256:1252ce3a102372ca6f86eb968e16f9014c4ba511c5c37d95a7f023e2ca6e5c25"}, ] [package.extras] @@ -2200,14 +2200,14 @@ testing = ["coverage", "pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "4.4.0" +version = "4.5.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false python-versions = ">=3.10" groups = ["main"] files = [ - {file = "pre_commit-4.4.0-py2.py3-none-any.whl", hash = "sha256:b35ea52957cbf83dcc5d8ee636cbead8624e3a15fbfa61a370e42158ac8a5813"}, - {file = "pre_commit-4.4.0.tar.gz", hash = "sha256:f0233ebab440e9f17cabbb558706eb173d19ace965c68cdce2c081042b4fab15"}, + {file = "pre_commit-4.5.0-py2.py3-none-any.whl", hash = "sha256:25e2ce09595174d9c97860a95609f9f852c0614ba602de3561e267547f2335e1"}, + {file = "pre_commit-4.5.0.tar.gz", hash = "sha256:dc5a065e932b19fc1d4c653c6939068fe54325af8e741e74e88db4d28a4dd66b"}, ] [package.dependencies] @@ -2265,14 +2265,14 @@ files = [ [[package]] name = "pydantic" -version = "2.12.4" +version = "2.12.5" description = "Data validation using Python type hints" optional = false python-versions = ">=3.9" groups = ["main", "dev"] files = [ - {file = "pydantic-2.12.4-py3-none-any.whl", hash = "sha256:92d3d202a745d46f9be6df459ac5a064fdaa3c1c4cd8adcfa332ccf3c05f871e"}, - {file = "pydantic-2.12.4.tar.gz", hash = "sha256:0f8cb9555000a4b5b617f66bfd2566264c4984b27589d3b845685983e8ea85ac"}, + {file = "pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d"}, + {file = "pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49"}, ] [package.dependencies] @@ -2932,44 +2932,44 @@ files = [ [[package]] name = "ruff" -version = "0.14.5" +version = "0.14.6" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" groups = ["main"] files = [ - {file = "ruff-0.14.5-py3-none-linux_armv6l.whl", hash = "sha256:f3b8248123b586de44a8018bcc9fefe31d23dda57a34e6f0e1e53bd51fd63594"}, - {file = "ruff-0.14.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:f7a75236570318c7a30edd7f5491945f0169de738d945ca8784500b517163a72"}, - {file = "ruff-0.14.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:6d146132d1ee115f8802356a2dc9a634dbf58184c51bff21f313e8cd1c74899a"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2380596653dcd20b057794d55681571a257a42327da8894b93bbd6111aa801f"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2d1fa985a42b1f075a098fa1ab9d472b712bdb17ad87a8ec86e45e7fa6273e68"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88f0770d42b7fa02bbefddde15d235ca3aa24e2f0137388cc15b2dcbb1f7c7a7"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:3676cb02b9061fee7294661071c4709fa21419ea9176087cb77e64410926eb78"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b595bedf6bc9cab647c4a173a61acf4f1ac5f2b545203ba82f30fcb10b0318fb"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f55382725ad0bdb2e8ee2babcbbfb16f124f5a59496a2f6a46f1d9d99d93e6e2"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7497d19dce23976bdaca24345ae131a1d38dcfe1b0850ad8e9e6e4fa321a6e19"}, - {file = "ruff-0.14.5-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:410e781f1122d6be4f446981dd479470af86537fb0b8857f27a6e872f65a38e4"}, - {file = "ruff-0.14.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c01be527ef4c91a6d55e53b337bfe2c0f82af024cc1a33c44792d6844e2331e1"}, - {file = "ruff-0.14.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f66e9bb762e68d66e48550b59c74314168ebb46199886c5c5aa0b0fbcc81b151"}, - {file = "ruff-0.14.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d93be8f1fa01022337f1f8f3bcaa7ffee2d0b03f00922c45c2207954f351f465"}, - {file = "ruff-0.14.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:c135d4b681f7401fe0e7312017e41aba9b3160861105726b76cfa14bc25aa367"}, - {file = "ruff-0.14.5-py3-none-win32.whl", hash = "sha256:c83642e6fccfb6dea8b785eb9f456800dcd6a63f362238af5fc0c83d027dd08b"}, - {file = "ruff-0.14.5-py3-none-win_amd64.whl", hash = "sha256:9d55d7af7166f143c94eae1db3312f9ea8f95a4defef1979ed516dbb38c27621"}, - {file = "ruff-0.14.5-py3-none-win_arm64.whl", hash = "sha256:4b700459d4649e2594b31f20a9de33bc7c19976d4746d8d0798ad959621d64a4"}, - {file = "ruff-0.14.5.tar.gz", hash = "sha256:8d3b48d7d8aad423d3137af7ab6c8b1e38e4de104800f0d596990f6ada1a9fc1"}, + {file = "ruff-0.14.6-py3-none-linux_armv6l.whl", hash = "sha256:d724ac2f1c240dbd01a2ae98db5d1d9a5e1d9e96eba999d1c48e30062df578a3"}, + {file = "ruff-0.14.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9f7539ea257aa4d07b7ce87aed580e485c40143f2473ff2f2b75aee003186004"}, + {file = "ruff-0.14.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7f6007e55b90a2a7e93083ba48a9f23c3158c433591c33ee2e99a49b889c6332"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a8e7b9d73d8728b68f632aa8e824ef041d068d231d8dbc7808532d3629a6bef"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d50d45d4553a3ebcbd33e7c5e0fe6ca4aafd9a9122492de357205c2c48f00775"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:118548dd121f8a21bfa8ab2c5b80e5b4aed67ead4b7567790962554f38e598ce"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:57256efafbfefcb8748df9d1d766062f62b20150691021f8ab79e2d919f7c11f"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ff18134841e5c68f8e5df1999a64429a02d5549036b394fafbe410f886e1989d"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:29c4b7ec1e66a105d5c27bd57fa93203637d66a26d10ca9809dc7fc18ec58440"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167843a6f78680746d7e226f255d920aeed5e4ad9c03258094a2d49d3028b105"}, + {file = "ruff-0.14.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:16a33af621c9c523b1ae006b1b99b159bf5ac7e4b1f20b85b2572455018e0821"}, + {file = "ruff-0.14.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1432ab6e1ae2dc565a7eea707d3b03a0c234ef401482a6f1621bc1f427c2ff55"}, + {file = "ruff-0.14.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4c55cfbbe7abb61eb914bfd20683d14cdfb38a6d56c6c66efa55ec6570ee4e71"}, + {file = "ruff-0.14.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:efea3c0f21901a685fff4befda6d61a1bf4cb43de16da87e8226a281d614350b"}, + {file = "ruff-0.14.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:344d97172576d75dc6afc0e9243376dbe1668559c72de1864439c4fc95f78185"}, + {file = "ruff-0.14.6-py3-none-win32.whl", hash = "sha256:00169c0c8b85396516fdd9ce3446c7ca20c2a8f90a77aa945ba6b8f2bfe99e85"}, + {file = "ruff-0.14.6-py3-none-win_amd64.whl", hash = "sha256:390e6480c5e3659f8a4c8d6a0373027820419ac14fa0d2713bd8e6c3e125b8b9"}, + {file = "ruff-0.14.6-py3-none-win_arm64.whl", hash = "sha256:d43c81fbeae52cfa8728d8766bbf46ee4298c888072105815b392da70ca836b2"}, + {file = "ruff-0.14.6.tar.gz", hash = "sha256:6f0c742ca6a7783a736b867a263b9a7a80a45ce9bee391eeda296895f1b4e1cc"}, ] [[package]] name = "secretstorage" -version = "3.4.1" +version = "3.5.0" description = "Python bindings to FreeDesktop.org Secret Service API" optional = false python-versions = ">=3.10" groups = ["main"] markers = "platform_machine != \"ppc64le\" and platform_machine != \"s390x\" and sys_platform == \"linux\"" files = [ - {file = "secretstorage-3.4.1-py3-none-any.whl", hash = "sha256:c55d57b4da3de568d8c3af89dad244ab24c35ca1da8625fc1b550edf005ebc41"}, - {file = "secretstorage-3.4.1.tar.gz", hash = "sha256:a799acf5be9fb93db609ebaa4ab6e8f1f3ed5ae640e0fa732bfea59e9c3b50e8"}, + {file = "secretstorage-3.5.0-py3-none-any.whl", hash = "sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137"}, + {file = "secretstorage-3.5.0.tar.gz", hash = "sha256:f04b8e4689cbce351744d5537bf6b1329c6fc68f91fa666f60a380edddcd11be"}, ] [package.dependencies] diff --git a/project-template/{{cookiecutter.repo_name}}/.pre-commit-config.yaml b/project-template/{{cookiecutter.repo_name}}/.pre-commit-config.yaml index ec91ee524..9da14ce57 100644 --- a/project-template/{{cookiecutter.repo_name}}/.pre-commit-config.yaml +++ b/project-template/{{cookiecutter.repo_name}}/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: types: [ python ] pass_filenames: false language: system - entry: poetry run -- nox -s project:fix + entry: poetry run -- nox -s format:fix stages: [ pre-commit ] - repo: local @@ -39,4 +39,4 @@ repos: - id: end-of-file-fixer stages: [ pre-commit ] - id: trailing-whitespace - stages: [ pre-commit ] \ No newline at end of file + stages: [ pre-commit ] diff --git a/project-template/{{cookiecutter.repo_name}}/exasol/{{cookiecutter.package_name}}/version.py b/project-template/{{cookiecutter.repo_name}}/exasol/{{cookiecutter.package_name}}/version.py index 55c391fa0..d9066af99 100644 --- a/project-template/{{cookiecutter.repo_name}}/exasol/{{cookiecutter.package_name}}/version.py +++ b/project-template/{{cookiecutter.repo_name}}/exasol/{{cookiecutter.package_name}}/version.py @@ -1,6 +1,6 @@ """ATTENTION: This file is generated by exasol/toolbox/nox/_package_version.py when using: - * either "poetry run -- nox -s project:fix" + * either "poetry run -- nox -s format:fix" * or "poetry run -- nox -s version:check -- --fix" Do not edit this file manually! If you need to change the version, do so in the pyproject.toml, e.g. by using diff --git a/project-template/{{cookiecutter.repo_name}}/noxfile.py b/project-template/{{cookiecutter.repo_name}}/noxfile.py index 176dbf97b..40a6dc204 100644 --- a/project-template/{{cookiecutter.repo_name}}/noxfile.py +++ b/project-template/{{cookiecutter.repo_name}}/noxfile.py @@ -4,4 +4,4 @@ from exasol.toolbox.nox.tasks import * # default actions to be run if nothing is explicitly specified with the -s option -nox.options.sessions = ["project:fix"] +nox.options.sessions = ["format:fix"] diff --git a/test/unit/nox/_format_test.py b/test/unit/nox/_format_test.py index e66b0356c..56aa3e062 100644 --- a/test/unit/nox/_format_test.py +++ b/test/unit/nox/_format_test.py @@ -8,8 +8,8 @@ _code_format, _pyupgrade, _ruff, - fix, - fmt_check, + check_format, + fix_format, ) from exasol.toolbox.nox._shared import Mode from noxconfig import Config @@ -120,7 +120,7 @@ def test_mode_check(nox_session, file_with_unneeded_import, caplog): def file_with_multiple_problems(tmp_path): """ In this file with multiple problems, it is expected that the nox session - `project:fix` would alter the following: + `format:fix` would alter the following: * x: Union[int, str]=2 * This should be altered to `x: int | str = 2` via pyupgrade. @@ -148,14 +148,14 @@ def file_with_multiple_problems(tmp_path): return file_path -def test_project_fix(nox_session, tmp_path, file_with_multiple_problems): +def test_fix_format(nox_session, tmp_path, file_with_multiple_problems): with patch("exasol.toolbox.nox._format.PROJECT_CONFIG") as config: with patch("exasol.toolbox.nox._format._version") as version: config.root = tmp_path config.pyupgrade_argument = ("--py310-plus",) # Simulate version is up-to-date, as version check is out of the scope of the test case version.return_value = True - fix(nox_session) + fix_format(nox_session) assert ( file_with_multiple_problems.read_text() @@ -171,7 +171,7 @@ def test_project_fix(nox_session, tmp_path, file_with_multiple_problems): ) -def test_project_format( +def test_check_format( nox_session, tmp_path, file_with_multiple_problems, caplog, capsys ): expected_text = file_with_multiple_problems.read_text() @@ -179,7 +179,7 @@ def test_project_format( with patch("exasol.toolbox.nox._format.PROJECT_CONFIG") as config: config.root = tmp_path with pytest.raises(CommandFailed): - fmt_check(nox_session) + check_format(nox_session) # The failed message should always relate to the checking function called first. assert (