From cf8c408b069e7b688f39f131b30e7d134e814c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Go=C3=A1s=20Aguililla?= Date: Mon, 11 Dec 2023 10:38:12 +0100 Subject: [PATCH] fix: Skip no-commit-to-branch hook in CI --- .../pyproject.toml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/{{ cookiecutter.__package_name_kebab_case }}/pyproject.toml b/{{ cookiecutter.__package_name_kebab_case }}/pyproject.toml index f7ed8d26..84427d30 100644 --- a/{{ cookiecutter.__package_name_kebab_case }}/pyproject.toml +++ b/{{ cookiecutter.__package_name_kebab_case }}/pyproject.toml @@ -274,10 +274,13 @@ convention = "{{ cookiecutter.docstring_style|lower }}" help = "Lint this package" [[tool.poe.tasks.lint.sequence]] - cmd = """ - pre-commit run - --all-files - --color always + shell = """ +{%- if cookiecutter.development_environment == "strict" %} + if [ -n "$CI" ]; then + export SKIP=no-commit-to-branch + fi +{%- endif %} + pre-commit run --all-files --color always """ {%- if cookiecutter.development_environment == "strict" %}