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 1a72c408 authored by Dorian Turba's avatar Dorian Turba
Browse files

add choices

parent fa5ffc4a
No related branches found
No related tags found
No related merge requests found
Pipeline #32064 failed
......@@ -11,6 +11,8 @@
"package_bug_tracker_url": "{{ cookiecutter.package_homepage_url }}/{{ cookiecutter.package_bug_tracker_path }}",
"minimum_supported_python": "3.8",
"requires_python": ">={{ cookiecutter.minimum_supported_python }}",
"formatter": ["ruff", "black"],
"linter": ["ruff", "flake8"],
"lint_indent_width": 4,
"lint_max_line_length": 88
}
\ No newline at end of file
......@@ -3,56 +3,22 @@ stages:
- test
include:
{% if cookiecutter.formatter == 'black' %}
# https://r2devops.io/marketplace/gitlab/dorianturba-templates/r2devops_catalog/r2_metadata/black
- remote: 'https://gitlab.com/dorianturba-templates/r2devops_catalog/-/raw/main/templates/python/code_quality/black/black.yml'
{% endif %}
{% if 'ruff' in (cookiecutter.formatter, cookiecutter.linter) %}
# https://r2devops.io/marketplace/gitlab/dorianturba-templates/r2devops_catalog/r2_metadata/ruff
- remote: 'https://gitlab.com/dorianturba-templates/r2devops_catalog/-/raw/main/templates/python/code_quality/ruff/ruff.yml'
{% endif %}
# https://r2devops.io/marketplace/gitlab/dorianturba-templates/r2devops_catalog/r2_metadata/pytest
- remote: 'https://gitlab.com/dorianturba-templates/r2devops_catalog/-/raw/main/templates/python/testing/pytest/pytest.yml'
{% if cookiecutter.linter == 'flake8' %}
# https://r2devops.io/marketplace/gitlab/dorianturba-templates/r2devops_catalog/r2_metadata/flake8
- remote: 'https://gitlab.com/dorianturba-templates/r2devops_catalog/-/raw/main/templates/python/code_quality/flake8/flake8.yml'
{% endif %}
# https://r2devops.io/marketplace/gitlab/dorianturba-templates/r2devops_catalog/r2_metadata/mypy
- remote: 'https://gitlab.com/dorianturba-templates/r2devops_catalog/-/raw/main/templates/python/code_quality/mypy/mypy.yml'
variables:
PACKAGE_NAME: "{{cookiecutter.package_slug}}"
black:
variables:
PYTHON_SETUP: "pip install ${PROJECT_PATH}[QUALITY]"
ruff:
variables:
PYTHON_SETUP: "pip install ${PROJECT_PATH}[QUALITY]"
flake8:
variables:
PYTHON_SETUP: "pip install ${PROJECT_PATH}[QUALITY]"
mypy:
variables:
PYTHON_SETUP: "pip install ${PROJECT_PATH}[QUALITY]"
pytest:
variables:
PYTHON_SETUP: "pip install ${PROJECT_PATH}[TEST]"
pytest_310:
extends: pytest
variables:
IMAGE_TAG: "3.10"
pytest_39:
extends: pytest
variables:
IMAGE_TAG: "3.9"
pytest_38:
extends: pytest
variables:
IMAGE_TAG: "3.8"
pytest_37:
extends: pytest
variables:
IMAGE_TAG: "3.7"
......@@ -31,14 +31,22 @@ dependencies = [
"Bug Tracker" = "{{ cookiecutter.package_homepage_url }}"
[project.optional-dependencies]
ALL = ["{{ cookiecutter.package_slug}}[DEV,QUALITY,TEST]"]
ALL = ["{{ cookiecutter.package_slug }}[DEV,QUALITY,TEST]"]
DEV = [
"bump-my-version",
"pip-tools",
]
QUALITY = [
"pre-commit",
{% if cookiecutter.formatter == 'black' %}
"black",
{% endif %}
{% if cookiecutter.linter == 'flake8' %}
"flake8",
{% endif %}
{% if 'ruff' in (cookiecutter.formatter, cookiecutter.linter) %}
"ruff>=0.3.3",
{% endif %}
"toml-sort",
]
TEST = [
......@@ -113,6 +121,7 @@ quiet = true
strip-extras = true
upgrade = true
{% if cookiecutter.formatter == 'ruff' %}
[tool.ruff]
exclude = [
".bzr",
......@@ -140,20 +149,35 @@ exclude = [
indent-width = "{{ cookiecutter.lint_indent_width }}"
line-length = "{{ cookiecutter.lint_max_line_length }}"
target-version = "py{{ cookiecutter.minimum_supported_python.replace('.', '') }}"
{% endif %}
{% if cookiecutter.formatter == 'ruff' %}
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
{% endif %}
{% if cookiecutter.linter == 'ruff' %}
[tool.ruff.lint]
select = ["ANN", "C90", "D2", "D3", "D4", "E", "F", "I", "N", "RUF", "UP", "W"]
{% endif %}
{% if cookiecutter.linter == 'ruff' %}
[tool.ruff.lint.flake8-annotations]
suppress-dummy-args = true
{% endif %}
{% if cookiecutter.linter == 'ruff' %}
[tool.ruff.lint.pydocstyle]
convention = "pep257"
ignore-decorators = ["typing.overload"]
{% endif %}
{% if cookiecutter.formatter == 'black' %}
[tool.black]
line-length = "{{ cookiecutter.lint_max_line_length }}"
target-version = ["py{{ cookiecutter.minimum_supported_python.replace('.', '') }}"]
{% endif %}
[tool.tomlsort]
check = false
......
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