Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 480d69da authored by Dorian Turba's avatar Dorian Turba
Browse files

add black

parent baed2288
No related branches found
No related tags found
No related merge requests found
Pipeline #22045 failed
......@@ -4,6 +4,7 @@ stages:
include:
- local: 'templates/python/testing/pytest/pytest.yml'
- local: 'templates/python/code_quality/flake8/flake8.yml'
- local: 'templates/python/code_quality/black/black.yml'
pytest:
stage: templates
......@@ -26,3 +27,14 @@ flake8:
- .gitlab-ci.yml
- pyproject.toml
- templates/python/code_quality/flake8/*
black:
stage: templates
variables:
PROJECT_PATH: "tests/black_project"
PYTHON_SETUP: "pip install ${PROJECT_PATH} black"
only:
changes:
- .gitlab-ci.yml
- pyproject.toml
- templates/python/code_quality/black/*
black:
image: python:latest
image: python:${IMAGE_TAG}
stage: code_quality
variables:
IMAGE_TAG: "latest"
PROJECT_PATH: "."
PYTHON_SETUP: "pip install ${PROJECT_PATH}[CODE_QUALITY]"
script:
- python --version # Debug
- python -m venv venv --upgrade-deps || python -m venv venv # upgrade-deps is not supported before 3.9
- source venv/bin/activate
- pip install black
- black . --check --diff --quiet
- ${PYTHON_SETUP}
- black ${PROJECT_PATH} --check --diff --quiet
only:
changes:
- ./**/*.py
......
flake8:
image: python:latest
image: python:${IMAGE_TAG}
stage: code_quality
variables:
IMAGE_TAG: "latest"
PROJECT_PATH: "."
PYTHON_SETUP: "pip install ${PROJECT_PATH}[CODE_QUALITY]"
script:
- python --version # Debug
- python -m venv venv --upgrade-deps || python -m venv venv # upgrade-deps is not supported before 3.9
- source venv/bin/activate
- pip install flake8
- ${PYTHON_SETUP}
- flake8 ${PROJECT_PATH} -v
only:
changes:
......
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "black_project"
version = "0.1.0"
authors = [
{ name = "Author Name", email = "author.name@example.com" },
]
description = "A description of what the package is for."
from black_project.main import main
__all__ = ['main']
"""Sample main module."""
def main() -> bool:
"""Sample main function."""
print("Hello, world!")
return True
if __name__ == '__main__':
main()
from test_project.main import main
from flake8_project.main import main
__all__ = ['main']
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment