diff --git a/cookiecutter.json b/cookiecutter.json index bd7859c..11f11de 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,5 +6,6 @@ "open_source": "Is this a public open source project? [y/N]", "python_version": "Your Python version, written as 3.xx", "dependency_manager": "Which dependency manager do you use? [pip/POETRY]", + "license-checker": "Do you want to use license-checker? [Y/n]", "_copy_without_render": [] } diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 32f0568..78104b0 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -74,7 +74,7 @@ testpaths = [ "tests", "src/{{cookiecutter.project_name}}", ] - +{%- if cookiecutter.license-checker == "y" -%} [tool.pylic] safe_licenses = [ "1-clause BSD License", @@ -312,4 +312,5 @@ safe_licenses = [ ] unsafe_packages = [ "unlicensedPackage", -] \ No newline at end of file +] +{% endif %} \ No newline at end of file diff --git a/{{cookiecutter.project_name}}/{{'.pre-commit-config.yaml' if cookiecutter.license-checker == 'n'}} b/{{cookiecutter.project_name}}/{{'.pre-commit-config.yaml' if cookiecutter.license-checker == 'n'}} new file mode 100644 index 0000000..b904646 --- /dev/null +++ b/{{cookiecutter.project_name}}/{{'.pre-commit-config.yaml' if cookiecutter.license-checker == 'n'}} @@ -0,0 +1,20 @@ +repos: +- repo: https://github.com/ambv/black + rev: 23.7.0 + hooks: + - id: black +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.290 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + types_or: [python, pyi] +- repo: https://github.com/kynan/nbstripout + rev: 0.6.0 + hooks: + - id: nbstripout +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.4.1 + hooks: + - id: mypy + args: [--install-types, --non-interactive, --ignore-missing-imports, --show-error-codes] \ No newline at end of file diff --git a/{{cookiecutter.project_name}}/.pre-commit-config.yaml b/{{cookiecutter.project_name}}/{{'.pre-commit-config.yaml' if cookiecutter.license-checker == 'y'}} similarity index 100% rename from {{cookiecutter.project_name}}/.pre-commit-config.yaml rename to {{cookiecutter.project_name}}/{{'.pre-commit-config.yaml' if cookiecutter.license-checker == 'y'}}