Skip to content

Commit 34f39f1

Browse files
committed
Merge branch 'main' into feature/613_move_path_filters_to_BaseConfig
2 parents eec672c + b36544d commit 34f39f1

File tree

20 files changed

+84
-77
lines changed

20 files changed

+84
-77
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jobs:
158158
uses: ./.github/actions/python-environment
159159

160160
- name: Run format check
161-
run: poetry run -- nox -s project:format
161+
run: poetry run -- nox -s format:check
162162

163163
Build-Packages:
164164
name: Build Package Check

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
types: [ python ]
99
pass_filenames: false
1010
language: system
11-
entry: poetry run -- nox -s project:fix
11+
entry: poetry run -- nox -s format:fix
1212
stages: [ pre-commit ]
1313

1414
- repo: local
@@ -39,4 +39,4 @@ repos:
3939
- id: end-of-file-fixer
4040
stages: [ pre-commit ]
4141
- id: trailing-whitespace
42-
stages: [ pre-commit ]
42+
stages: [ pre-commit ]

doc/changes/unreleased.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Unreleased
22

3+
This major release removes `project:fix` and `project:format`
4+
and replaces them with `format:fix` and `format:check`.
5+
6+
## Refactoring
7+
8+
* #606: Renamed nox session `project:fix` more aptly to `format:fix` and `project:format` to `format:check`
9+
310
## Feature
411

512
* #614: Replaced `path_filters` with `BaseConfig.add_to_excluded_python_paths` and `BaseConfig.excluded_python_paths`

doc/user_guide/features/formatting_code/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ deterministic manner.
4545
+--------------------+------------------+------------------------------------+
4646
| Nox session | CI Usage | Action |
4747
+====================+==================+====================================+
48-
| ``project:fix`` | No | Applies code formatting changes |
48+
| ``format:fix`` | No | Applies code formatting changes |
4949
+--------------------+------------------+------------------------------------+
50-
| ``project:format`` | ``checks.yml`` | Checks that current code does not |
50+
| ``format:check`` | ``checks.yml`` | Checks that current code does not |
5151
| | | need to be re-formatted |
5252
+--------------------+------------------+------------------------------------+
5353

doc/user_guide/features/formatting_code/troubleshooting.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
Troubleshooting
44
===============
55

6-
Formatting still fails after running ``project:fix``
6+
Formatting still fails after running ``format:fix``
77
----------------------------------------------------
88

99
If when you execute:
1010

11-
#. Run ``project:fix``
12-
#. Run ``project:format``
11+
#. Run ``format:fix``
12+
#. Run ``format:check``
1313

14-
you receive an error from ``project:format`` (i.e. ``isort`` or ``black``), it it
14+
you receive an error from ``format:check`` (i.e. ``isort`` or ``black``), it it
1515
likely that you need to update your configuration to align with
1616
:ref:`formatting_configuration`.
1717

@@ -46,7 +46,7 @@ might want to ignore automatically applied formatting.
4646
+-----------------------+--------------------------------+-----------------------+
4747

4848

49-
In the ``checks.yml``, ``project:format`` wants me to reformat code I did not modify
49+
In the ``checks.yml``, ``format:check`` wants me to reformat code I did not modify
5050
------------------------------------------------------------------------------------
5151

5252
This is likely due to one of our tools (i.e. ``black``) being upgraded. Within the

doc/user_guide/migrating.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ For example, if test execution isn't performed in the standard way (e.g., :code:
6363
from exasol.toolbox.nox.tasks import * # pylint: disable=wildcard-import disable=unused-wildcard-import
6464
6565
# default actions to be run if nothing is explicitly specified with the -s option
66-
nox.options.sessions = ["project:fix"]
66+
nox.options.sessions = ["format:fix"]
6767
68-
@nox.session(name="project:fix", python=False)
68+
@nox.session(name="format:fix", python=False)
6969
def my_project_fix_overwrite(session) -> None:
7070
"""Runs all automated fixes on the code base"""
7171
@@ -75,7 +75,7 @@ For example, if test execution isn't performed in the standard way (e.g., :code:
7575
from exasol.toolbox.nox._shared import get_filtered_python_files
7676
7777
py_files = get_filtered_python_files(PROJECT_CONFIG.root)
78-
print("The original 'project:fix' task has been taken hostage by this overwrite")
78+
print("The original 'format:fix' task has been taken hostage by this overwrite")
7979
print("Files:\n{files}".format(files="\n".join(py_files))
8080
8181

exasol/toolbox/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def excluded_python_paths(self) -> tuple[str, ...]:
9292
- lint:code
9393
- lint:security
9494
- lint:typing
95-
- project:fix
96-
- project:format
95+
- format:fix
96+
- format:check
9797
where it is desired restrict which Python files are considered within the
9898
source_path, like excluding `dist`, `.eggs`. As such, this property is used to
9999
exclude such undesired paths.

exasol/toolbox/nox/_format.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ def command(*args: str) -> Iterable[str]:
4242
session.run(*command("ruff", "check"), *files)
4343

4444

45-
@nox.session(name="project:fix", python=False)
46-
def fix(session: Session) -> None:
47-
"""Runs all automated fixes on the code base"""
45+
@nox.session(name="format:fix", python=False)
46+
def fix_format(session: Session) -> None:
47+
"""Runs all automated format fixes on the code base"""
4848
py_files = get_filtered_python_files(PROJECT_CONFIG.root)
4949
_version(session, Mode.Fix)
5050
_pyupgrade(session, config=PROJECT_CONFIG, files=py_files)
5151
_ruff(session, mode=Mode.Fix, files=py_files)
5252
_code_format(session, Mode.Fix, py_files)
5353

5454

55-
@nox.session(name="project:format", python=False)
56-
def fmt_check(session: Session) -> None:
55+
@nox.session(name="format:check", python=False)
56+
def check_format(session: Session) -> None:
5757
"""Checks the project for correct formatting"""
5858
py_files = get_filtered_python_files(PROJECT_CONFIG.root)
5959
_ruff(session, mode=Mode.Check, files=py_files)

exasol/toolbox/nox/_package_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"""
2424
ATTENTION:
2525
This file is generated by exasol/toolbox/nox/_package_version.py when using:
26-
* either "poetry run -- nox -s project:fix"
26+
* either "poetry run -- nox -s format:fix"
2727
* or "poetry run -- nox -s version:check -- --fix"
2828
Do not edit this file manually!
2929
If you need to change the version, do so in the pyproject.toml, e.g. by using

exasol/toolbox/nox/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"check",
77
"clean_docs",
88
"coverage",
9-
"fix",
9+
"fix_format",
1010
"integration_tests",
1111
"lint",
1212
"open_docs",
@@ -22,7 +22,7 @@
2222
# ruff: noqa F401
2323
from exasol.toolbox.nox._format import (
2424
_code_format,
25-
fix,
25+
fix_format,
2626
)
2727

2828
# fmt: off

0 commit comments

Comments
 (0)