Skip to content

Commit 0558b82

Browse files
committed
#369: Removed option -v for isort
1 parent 5017343 commit 0558b82

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

doc/changes/unreleased.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Unreleased
22

3-
## Added
3+
## Features
44

55
* [#73](https://github.com/exasol/python-toolbox/issues/73): Added nox target for auditing work spaces in regard to known vulnerabilities
6-
* [#65](https://github.com/exasol/python-toolbox/issues/65): Added a Nox task for checking if the changelog got updated.
6+
* [#65](https://github.com/exasol/python-toolbox/issues/65): Added a Nox task for checking if the changelog got updated.
7+
* [#369](https://github.com/exasol/python-toolbox/issues/369): Removed option `-v` for `isort`

exasol/toolbox/nox/_format.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414

1515

1616
def _code_format(session: Session, mode: Mode, files: Iterable[str]) -> None:
17-
isort = ["poetry", "run", "isort", "-v"]
18-
black = ["poetry", "run", "black"]
19-
isort = isort if mode == Mode.Fix else isort + ["--check"]
20-
black = black if mode == Mode.Fix else black + ["--check"]
21-
session.run(*isort, *files)
22-
session.run(*black, *files)
17+
def command(*args: str) -> list[str]:
18+
return args if mode==Mode.Fix else list(args) + ["--check"]
19+
20+
session.run(*command("poetry", "run", "isort"), *files)
21+
session.run(*command("poetry", "run", "black"), *files)
2322

2423

2524
def _pyupgrade(session: Session, files: Iterable[str]) -> None:
@@ -47,3 +46,13 @@ def fmt_check(session: Session) -> None:
4746
"""Checks the project for correct formatting"""
4847
py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)]
4948
_code_format(session=session, mode=Mode.Check, files=py_files)
49+
50+
51+
class XSession:
52+
def run(self, *args):
53+
print(f'session.run(args: {args})')
54+
55+
56+
if __name__ == "__main__":
57+
session = XSession()
58+
_code_format(session, Mode.Fix, [])

0 commit comments

Comments
 (0)