Skip to content

Commit

Permalink
Run black an isort with option that makes them fail on incorrect form…
Browse files Browse the repository at this point in the history
…atting

Internal-tag: [#50994]
Signed-off-by: Krzysztof Obłonczek <koblonczek@internships.antmicro.com>
  • Loading branch information
koblonczek authored and rw1nkler committed Nov 8, 2023
1 parent 2bc8635 commit ad83cdc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lint:
- python3 -m pip install -U pip wheel setuptools
script:
- python3 -m pip install -r requirements.dev.txt
- nox -s isort black flake8
- nox -s isort_check black_check flake8

pytest:
stage: test
Expand Down
14 changes: 14 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ def isort(session: nox.Session) -> None:
session.run("isort", ".")


@nox.session()
def isort_check(session: nox.Session) -> None:
"""Options are defined in pyproject.toml file"""
session.install("isort")
session.run("isort", "--check", ".")


@nox.session
def flake8(session):
"""Options are defined in .flake8 file."""
Expand All @@ -32,6 +39,13 @@ def black(session):
session.run("black", ".")


@nox.session
def black_check(session):
"""Options are defined in pyproject.toml file"""
session.install("black")
session.run("black", "--check", ".")


@nox.session
def tests(session: nox.Session) -> None:
session.install("-r", "requirements.txt")
Expand Down

0 comments on commit ad83cdc

Please sign in to comment.