dev/pre-commit: add additional checks

- Expand scope of python autoformatting
- Check for mixed line endings
- Enforce no tabs for indentation
This commit is contained in:
Shyam Sunder 2020-09-01 11:42:54 -04:00
parent 4ab6aa5c85
commit 67a5dd7c18
1 changed files with 11 additions and 3 deletions

View File

@ -6,19 +6,27 @@ repos:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
- id: check-yaml - id: check-yaml
- id: mixed-line-ending
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.9
hooks:
- id: remove-tabs
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 20.8b1 rev: 20.8b1
hooks: hooks:
- id: black - id: black
files: server/szurubooru/ files: 'server/'
types: [python]
language_version: python3.8 language_version: python3.8
- repo: https://github.com/timothycrosley/isort - repo: https://github.com/timothycrosley/isort
rev: '5.4.2' rev: '5.4.2'
hooks: hooks:
- id: isort - id: isort
files: server/szurubooru/ files: 'server/'
types: [python]
exclude: server/szurubooru/migrations/env.py exclude: server/szurubooru/migrations/env.py
additional_dependencies: additional_dependencies:
- toml - toml
@ -32,7 +40,7 @@ repos:
args: ['--config', 'client/.prettierrc.yml'] args: ['--config', 'client/.prettierrc.yml']
- repo: https://github.com/pre-commit/mirrors-eslint - repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.7.0 rev: v7.8.0
hooks: hooks:
- id: eslint - id: eslint
files: client/js/ files: client/js/