Skip to content

Commit

Permalink
chore: Minor change pre-commit config with reformat. (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Dec 5, 2023
1 parent 4fb5d67 commit 1bbb601
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 72 deletions.
73 changes: 37 additions & 36 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
repos:
- hooks:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
- id: check-json
- args:
- id: check-merge-conflict
args:
- '--assume-in-merge'
id: check-merge-conflict
- id: check-toml
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
- stages:
- id: no-commit-to-branch
stages:
- push
id: no-commit-to-branch
- args:
- id: pretty-format-json
args:
- '--autofix'
id: pretty-format-json
- args:
- id: requirements-txt-fixer
args:
- constraints/3.8.txt
- constraints/3.9.txt
- constraints/3.10.txt
Expand All @@ -30,46 +33,44 @@ repos:
- requirements/lint.txt
- requirements/package.txt
- requirements/test.txt
id: requirements-txt-fixer
- files: .pre-commit-config.yaml
id: sort-simple-yaml
- id: sort-simple-yaml
files: .pre-commit-config.yaml
- id: trailing-whitespace
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
- hooks:
- entry: make mypy
id: mypy
language: system
- repo: local
hooks:
- id: mypy
name: mypy
pass_filenames: false
require_serial: true
types:
- python
- entry: pipenv run python -m ruff check --force-exclude
id: ruff
entry: pipenv run python -m mypy
language: system
name: ruff
require_serial: true
exclude: ^template/.*
types_or:
- python
- pyi
- entry: pipenv run python -m ruff format --check --force-exclude
id: ruff-format
language: system
name: ruff-format
require_serial: true
- id: ruff
name: ruff
entry: pipenv run python -m ruff check --force-exclude
language: system
types_or:
- python
- pyi
- entry: pipenv run toml-sort
id: toml-sort
require_serial: true
- id: ruff-format
name: ruff-format
entry: pipenv run python -m ruff format --force-exclude
language: system
types_or:
- python
- pyi
require_serial: true
- id: toml-sort
name: toml-sort
entry: pipenv run toml-sort
language: system
types:
- toml
- entry: found Copier update rejection files; review them and remove them
files: \.rej$
id: forbidden-files
language: fail
- id: forbidden-files
name: forbidden files
repo: local
entry: found Copier update rejection files; review them and remove them
language: fail
files: \.rej$
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@
"sortJSONValuesReverse": false
},
"vscode-yaml-sort.customSortKeywords_2": [
"repo",
"rev",
"hooks",
"id",
"name",
"entry",
"language",
"files",
"exclude",
"stages",
"types",
"types_or",
"require_serial",
"description",
"args",
"stages",
"default",
"_envops",
Expand Down
75 changes: 39 additions & 36 deletions template/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
[% from pathjoin("includes", "version_compare.jinja") import version_between -%]
repos:
- hooks:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
- id: check-json
- args:
- id: check-merge-conflict
args:
- '--assume-in-merge'
id: check-merge-conflict
- id: check-toml
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
- stages:
- id: no-commit-to-branch
stages:
- push
id: no-commit-to-branch
- args:
- id: pretty-format-json
args:
- '--autofix'
id: pretty-format-json
- args:
- id: requirements-txt-fixer
args:
[%- if version_between("3.8", min_py, max_py) %]
- constraints/3.8.txt
[%- endif %]
Expand All @@ -41,46 +44,46 @@ repos:
- requirements/lint.txt
- requirements/package.txt
- requirements/test.txt
id: requirements-txt-fixer
- files: .pre-commit-config.yaml
id: sort-simple-yaml
- id: sort-simple-yaml
files: .pre-commit-config.yaml
- id: trailing-whitespace
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
- hooks:
- entry: make mypy
id: mypy
language: system
- repo: local
hooks:
- id: mypy
name: mypy
pass_filenames: false
require_serial: true
types:
- python
- entry: pipenv run python -m ruff check --force-exclude
id: ruff
entry: pipenv run python -m mypy
language: system
name: ruff
require_serial: true
[%- if project_name == 'Serious Scaffold Python' %]
exclude: ^template/.*
[%- endif %]
types_or:
- python
- pyi
- entry: pipenv run python -m ruff format --check --force-exclude
id: ruff-format
language: system
name: ruff-format
require_serial: true
- id: ruff
name: ruff
entry: pipenv run python -m ruff check --force-exclude
language: system
types_or:
- python
- pyi
- entry: pipenv run toml-sort
id: toml-sort
require_serial: true
- id: ruff-format
name: ruff-format
entry: pipenv run python -m ruff format --force-exclude
language: system
types_or:
- python
- pyi
require_serial: true
- id: toml-sort
name: toml-sort
entry: pipenv run toml-sort
language: system
types:
- toml
- entry: found Copier update rejection files; review them and remove them
files: \.rej$
id: forbidden-files
language: fail
- id: forbidden-files
name: forbidden files
repo: local
entry: found Copier update rejection files; review them and remove them
language: fail
files: \.rej$
15 changes: 15 additions & 0 deletions template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@
"sortJSONValuesReverse": false
},
"vscode-yaml-sort.customSortKeywords_2": [
"repo",
"rev",
"hooks",
"id",
"name",
"entry",
"language",
"files",
"exclude",
"stages",
"types",
"types_or",
"require_serial",
"description",
"args",
"stages",
"default",
"_envops",
Expand Down

0 comments on commit 1bbb601

Please sign in to comment.