Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pre-commit-config.yaml to utilise versioned repos rather than local #205

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 6 additions & 39 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,23 @@
repos:
- repo: local
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
- id: check-merge-conflict
name: Check for files with merge conflict strings
entry: check-merge-conflict
language: system
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: check-toml
name: Check Toml
entry: check-toml
language: system
types: [toml]
- id: check-yaml
name: Check Yaml
entry: check-yaml
language: system
exclude: "docs/mkdocs.yml"
types: [yaml]
- id: no-commit-to-branch
name: Prevent commits to dev / master
entry: no-commit-to-branch
language: python
args: ["-b", dev, "-b", master, "-b", main]
pass_filenames: false
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
language_version: python3.10
require_serial: true
# - id: flake8
# name: flake8
# entry: flake8
# language: system
# types: [python]
# args: ["--config='{{ cookiecutter.repo_name }}/setup.cfg'"]
# require_serial: true
- repo: https://github.com/prettier/pre-commit
rev: v2.1.2
hooks:
Expand Down
55 changes: 9 additions & 46 deletions {{ cookiecutter.repo_name }}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,23 @@
repos:
- repo: local
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
- id: check-merge-conflict
name: Check for files with merge conflict strings
entry: check-merge-conflict
language: system
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: check-toml
name: Check Toml
entry: check-toml
language: system
types: [toml]
- id: check-yaml
name: Check Yaml
entry: check-yaml
language: system
types: [yaml]
# - id: reorder-python-imports
# name: Reorder python imports
# entry: reorder-python-imports
# language: system
# types: [python]
# - id: flake8
# name: flake8
# entry: flake8
# language: system
# types: [python]
# args: ["--config=.flake8"]
# require_serial: true
exclude: "docs/mkdocs.yml"
- id: no-commit-to-branch
name: Prevent commits to dev / master
entry: no-commit-to-branch
language: python
args: ["-b", dev, "-b", master, "-b", main]
pass_filenames: false
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
language_version: python3.10
require_serial: true
- repo: https://github.com/prettier/pre-commit
rev: v2.1.2
hooks:
Expand Down
Loading