Skip to content

Commit f05b7c9

Browse files
committed
Modify function names to be verb_name
1 parent 955a70f commit f05b7c9

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

exasol/toolbox/nox/_format.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def command(*args: str) -> Iterable[str]:
4343

4444

4545
@nox.session(name="format:fix", python=False)
46-
def fix(session: Session) -> None:
47-
"""Runs all automated fixes on the code base"""
46+
def fix_format(session: Session) -> None:
47+
"""Runs all automated format fixes on the code base"""
4848
py_files = python_files(PROJECT_CONFIG.root)
4949
_version(session, Mode.Fix)
5050
_pyupgrade(session, config=PROJECT_CONFIG, files=py_files)
@@ -53,7 +53,7 @@ def fix(session: Session) -> None:
5353

5454

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

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

test/unit/nox/_format_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
_code_format,
99
_pyupgrade,
1010
_ruff,
11-
fix,
12-
fmt_check,
11+
check_format,
12+
fix_format,
1313
)
1414
from exasol.toolbox.nox._shared import Mode
1515
from noxconfig import Config
@@ -148,14 +148,14 @@ def file_with_multiple_problems(tmp_path):
148148
return file_path
149149

150150

151-
def test_project_fix(nox_session, tmp_path, file_with_multiple_problems):
151+
def test_fix_format(nox_session, tmp_path, file_with_multiple_problems):
152152
with patch("exasol.toolbox.nox._format.PROJECT_CONFIG") as config:
153153
with patch("exasol.toolbox.nox._format._version") as version:
154154
config.root = tmp_path
155155
config.pyupgrade_argument = ("--py310-plus",)
156156
# Simulate version is up-to-date, as version check is out of the scope of the test case
157157
version.return_value = True
158-
fix(nox_session)
158+
fix_format(nox_session)
159159

160160
assert (
161161
file_with_multiple_problems.read_text()
@@ -171,15 +171,15 @@ def test_project_fix(nox_session, tmp_path, file_with_multiple_problems):
171171
)
172172

173173

174-
def test_project_format(
174+
def test_check_format(
175175
nox_session, tmp_path, file_with_multiple_problems, caplog, capsys
176176
):
177177
expected_text = file_with_multiple_problems.read_text()
178178

179179
with patch("exasol.toolbox.nox._format.PROJECT_CONFIG") as config:
180180
config.root = tmp_path
181181
with pytest.raises(CommandFailed):
182-
fmt_check(nox_session)
182+
check_format(nox_session)
183183

184184
# The failed message should always relate to the checking function called first.
185185
assert (

0 commit comments

Comments
 (0)