<commit_before>[tox]
envlist = {{ cookiecutter.checks }}{% if cookiecutter.checks and cookiecutter.tests %},{% endif %}{{ cookiecutter.tests }},requirements
skipsdist = true

[testenv]
description = Unit tests
deps =
    pytest-cov
    -r {toxinidir}/requirements.txt
commands =
    pytest {posargs:--cov=application}
{%- if cookiecutter.framework == 'Django' %}
setenv =
    DJANGO_SECRET_KEY = testing
{%- endif %}

[testenv:bandit]
description = PyCQA security linter
deps = bandit<1.6.0
commands = bandit -r --ini tox.ini

[testenv:behave]
description = Acceptence tests (BDD)
deps =
    behave{% if cookiecutter.framework == 'Django' %}-django{% endif %}
    -r {toxinidir}/requirements.txt
{%- if cookiecutter.framework == 'Django' %}
commands =
    python manage.py behave {posargs}
setenv =
    DJANGO_DATABASE_URL = sqlite://
    DJANGO_SECRET_KEY = testing
{%- else %}
commands =
    behave {posargs}
{%- endif %}

[testenv:clean]
description = Remove bytecode and other debris
deps = pyclean
commands =
    pyclean -v {toxinidir}
    rm -rf .cache/ .pytest_cache/ .tox/ tests/reports/
allowlist_externals =
    rm

[testenv:flake8]
description = Static code analysis and code style
deps = flake8{% if cookiecutter.framework == 'Django' %}-django{% endif %}
commands = flake8 {posargs}

[testenv:kubernetes]
description = Validate Kubernetes manifests
deps = kustomize-wrapper
commands =
    # generate directory list:
    # $ ls -d1 deployment/*/overlays/* | sed 's/$/ \\/'
    kustomize lint {posargs:--ignore-missing-schemas --fail-fast \
        deployment/application/overlays/development \
        deployment/application/overlays/integration \
        deployment/application/overlays/production \
        {%- if cookiecutter.database != '(none)' %}
        deployment/database/overlays/development \
        deployment/database/overlays/integration \
        deployment/database/overlays/production \
        {%- endif %}
    }

[testenv:pylint]
description = Check for errors and code smells
deps =
    pylint{% if cookiecutter.framework == 'Django' %}-django{% endif %}
    -r {toxinidir}/requirements.txt
commands =
    # generate module list:
    # $ ls */__init__.py | sed 's#/__init__.py# \\#g'
    pylint --rcfile tox.ini {posargs:{% if cookiecutter.framework == 'Django' %}manage.py{% endif %} \
        application \
    }

[testenv:requirements]
description = Update project dependencies
deps = pip-tools
commands = pip-compile --output-file=requirements.txt requirements.in --upgrade

[testenv:safety]
description = Check for vulnerable dependencies
deps = safety
commands = safety check --bare -r requirements.txt

[bandit]
exclude = .cache,.git,.tox,build,dist,docs,tests
targets = .

[behave]
# default_format = progress
default_tags = -@not_implemented -@xfail
junit = yes
junit_directory = tests/reports
paths = tests/acceptance
show_skipped = no
summary = no

[flake8]
exclude = .cache,.git,.tox,build
max-line-length = 88<commit_msg>Configure Django for pylint-django (check fails)<commit_after>[tox]
envlist = {{ cookiecutter.checks }}{% if cookiecutter.checks and cookiecutter.tests %},{% endif %}{{ cookiecutter.tests }},requirements
skipsdist = true

[testenv]
description = Unit tests
deps =
    pytest-cov
    -r {toxinidir}/requirements.txt
commands =
    pytest {posargs:--cov=application}
{%- if cookiecutter.framework == 'Django' %}
setenv =
    DJANGO_SECRET_KEY=testing
{%- endif %}

[testenv:bandit]
description = PyCQA security linter
deps = bandit<1.6.0
commands = bandit -r --ini tox.ini

[testenv:behave]
description = Acceptence tests (BDD)
deps =
    behave{% if cookiecutter.framework == 'Django' %}-django{% endif %}
    -r {toxinidir}/requirements.txt
{%- if cookiecutter.framework == 'Django' %}
commands =
    python manage.py behave {posargs}
setenv =
    DJANGO_DATABASE_URL=sqlite://
    DJANGO_SECRET_KEY=testing
{%- else %}
commands =
    behave {posargs}
{%- endif %}

[testenv:clean]
description = Remove bytecode and other debris
deps = pyclean
commands =
    pyclean -v {toxinidir}
    rm -rf .cache/ .pytest_cache/ .tox/ tests/reports/
allowlist_externals =
    rm

[testenv:flake8]
description = Static code analysis and code style
deps = flake8{% if cookiecutter.framework == 'Django' %}-django{% endif %}
commands = flake8 {posargs}

[testenv:kubernetes]
description = Validate Kubernetes manifests
deps = kustomize-wrapper
commands =
    # generate directory list:
    # $ ls -d1 deployment/*/overlays/* | sed 's/$/ \\/'
    kustomize lint {posargs:--ignore-missing-schemas --fail-fast \
        deployment/application/overlays/development \
        deployment/application/overlays/integration \
        deployment/application/overlays/production \
        {%- if cookiecutter.database != '(none)' %}
        deployment/database/overlays/development \
        deployment/database/overlays/integration \
        deployment/database/overlays/production \
        {%- endif %}
    }

[testenv:pylint]
description = Check for errors and code smells
deps =
    pylint{% if cookiecutter.framework == 'Django' %}-django{% endif %}
    -r {toxinidir}/requirements.txt
commands =
    # generate module list:
    # $ ls */__init__.py | sed 's#/__init__.py# \\#g'
    pylint --rcfile tox.ini {posargs:{% if cookiecutter.framework == 'Django' %}manage.py{% endif %} \
        application \
    }
{%- if cookiecutter.framework == 'Django' %}
setenv =
    DJANGO_SECRET_KEY=insecure
    DJANGO_SETTINGS_MODULE=application.settings
{%- endif %}

[testenv:requirements]
description = Update project dependencies
deps = pip-tools
commands = pip-compile --output-file=requirements.txt requirements.in --upgrade

[testenv:safety]
description = Check for vulnerable dependencies
deps = safety
commands = safety check --bare -r requirements.txt

[bandit]
exclude = .cache,.git,.tox,build,dist,docs,tests
targets = .

[behave]
# default_format = progress
default_tags = -@not_implemented -@xfail
junit = yes
junit_directory = tests/reports
paths = tests/acceptance
show_skipped = no
summary = no

[flake8]
exclude = .cache,.git,.tox,build
max-line-length = 88
{'fraction_non_alphanumeric': 0.12997217220494353, 'fraction_numerical': 0.003273858241938124, 'mean_word_length': 3.7145061728395063, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '252162', 'n_tokens_mistral': 2107, 'n_tokens_neox': 1976, 'n_words': 468}