From a11e8153bfbdc98d6ceb47423ebb2ac469474280 Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Tue, 7 Jun 2022 05:59:07 +0300 Subject: [PATCH 1/2] Update pre-commit config --- .pre-commit-config.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7be7e3bb8..96d89ad9a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/PyCQA/doc8 - rev: 0.8.1 + rev: 0.11.2 hooks: - id: doc8 name: doc8 @@ -17,17 +17,26 @@ repos: language_version: python3 exclude: ^(tests\/hooks-abort-render\/hooks|docs\/HelloCookieCutter1) - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v4.2.0 hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] - id: mixed-line-ending - - id: check-byte-order-marker + - id: fix-byte-order-marker - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable - id: check-merge-conflict - id: check-symlinks + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + exclude: "invalid-syntax.json|tests/fake-repo-bad-json/cookiecutter.json|tests/fake-repo/cookiecutter.json" + - id: check-toml + - id: check-xml + - id: check-yaml + exclude: "not_rendered.yml|invalid-config.yaml" - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + rev: 4.0.1 hooks: - id: flake8 additional_dependencies: @@ -35,7 +44,7 @@ repos: - flake8-black - flake8-docstrings - repo: https://github.com/PyCQA/bandit - rev: 1.6.0 + rev: 1.7.4 hooks: - id: bandit args: [--ini, .bandit] From 6fdbb92e0793015e35e43a8cf53de4991283cf8b Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Tue, 7 Jun 2022 05:59:21 +0300 Subject: [PATCH 2/2] Remove unneeded shebangs to fix pre-commit issues --- setup.py | 1 - tests/hooks-abort-render/hooks/post_gen_project.py | 1 - tests/hooks-abort-render/hooks/pre_gen_project.py | 1 - tests/test-pyhooks/hooks/post_gen_project.py | 1 - tests/test-pyhooks/hooks/pre_gen_project.py | 1 - tests/test-pyshellhooks/hooks/post_gen_project.py | 1 - tests/test-pyshellhooks/hooks/pre_gen_project.py | 1 - 7 files changed, 7 deletions(-) diff --git a/setup.py b/setup.py index 7c6a677b2..d61fbd6ba 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """cookiecutter distutils configuration.""" from setuptools import setup diff --git a/tests/hooks-abort-render/hooks/post_gen_project.py b/tests/hooks-abort-render/hooks/post_gen_project.py index 706cc440d..d95ca59fa 100644 --- a/tests/hooks-abort-render/hooks/post_gen_project.py +++ b/tests/hooks-abort-render/hooks/post_gen_project.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # flake8: noqa """Simple post-gen hook for testing the handling of different exit codes.""" diff --git a/tests/hooks-abort-render/hooks/pre_gen_project.py b/tests/hooks-abort-render/hooks/pre_gen_project.py index a132af807..3bd59868c 100644 --- a/tests/hooks-abort-render/hooks/pre_gen_project.py +++ b/tests/hooks-abort-render/hooks/pre_gen_project.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # flake8: noqa """Simple pre-gen hook for testing the handling of different exit codes.""" diff --git a/tests/test-pyhooks/hooks/post_gen_project.py b/tests/test-pyhooks/hooks/post_gen_project.py index c8b7c194f..98a5a353b 100644 --- a/tests/test-pyhooks/hooks/post_gen_project.py +++ b/tests/test-pyhooks/hooks/post_gen_project.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """Simple post-gen hook for testing project folder and custom file creation.""" print('pre generation hook') diff --git a/tests/test-pyhooks/hooks/pre_gen_project.py b/tests/test-pyhooks/hooks/pre_gen_project.py index 4d84bd3ec..6f1887bd4 100644 --- a/tests/test-pyhooks/hooks/pre_gen_project.py +++ b/tests/test-pyhooks/hooks/pre_gen_project.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """Simple pre-gen hook for testing project folder and custom file creation.""" print('pre generation hook') diff --git a/tests/test-pyshellhooks/hooks/post_gen_project.py b/tests/test-pyshellhooks/hooks/post_gen_project.py index c8b7c194f..98a5a353b 100644 --- a/tests/test-pyshellhooks/hooks/post_gen_project.py +++ b/tests/test-pyshellhooks/hooks/post_gen_project.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """Simple post-gen hook for testing project folder and custom file creation.""" print('pre generation hook') diff --git a/tests/test-pyshellhooks/hooks/pre_gen_project.py b/tests/test-pyshellhooks/hooks/pre_gen_project.py index db8bfc6a7..daeb59acb 100644 --- a/tests/test-pyshellhooks/hooks/pre_gen_project.py +++ b/tests/test-pyshellhooks/hooks/pre_gen_project.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """Simple pre-gen hook for testing project folder and custom file creation."""