From e1aa5f97a287f03002dfa250ac7664d44aae89a6 Mon Sep 17 00:00:00 2001 From: Somraj Saha <31373860+Jarmos-san@users.noreply.github.com> Date: Sun, 24 Sep 2023 21:18:13 +0530 Subject: [PATCH] chore: add some Pre-Commit hooks to the templates --- .../.pre-commit-config.yaml | 37 +++++++++++++++++++ .../.pre-commit-config.yaml | 15 ++++++++ 2 files changed, 52 insertions(+) create mode 100644 simple-landing-page/{{cookiecutter.project_slug}}/.pre-commit-config.yaml create mode 100644 simple-project/{{cookiecutter.project_slug}}/.pre-commit-config.yaml diff --git a/simple-landing-page/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/simple-landing-page/{{cookiecutter.project_slug}}/.pre-commit-config.yaml new file mode 100644 index 0000000..76e63b5 --- /dev/null +++ b/simple-landing-page/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -0,0 +1,37 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: detect-private-key + + - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook + rev: v9.5.0 + hooks: + - id: commitlint + stages: [commit-msg] + additional_dependencies: ["@commitlint/config-conventional"] + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.3 + hooks: + - id: prettier + name: check for non-standard formatting concerns + additional_dependencies: + - prettier@3 + - "@trivago/prettier-plugin-sort-imports" + + - repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.49.0 + hooks: + - id: eslint + name: check for linting errors and warnings + files: \.[jt]sx?$ + types: [file] + additional_dependencies: + - eslint@8 + - eslint-config-prettier + - eslint-config-next diff --git a/simple-project/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/simple-project/{{cookiecutter.project_slug}}/.pre-commit-config.yaml new file mode 100644 index 0000000..d173ff0 --- /dev/null +++ b/simple-project/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + + - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook + rev: v9.5.0 + hooks: + - id: commitlint + stages: [commit-msg] + additional_dependencies: ["@commitlint/config-conventional"]