Skip to content

Commit

Permalink
Tune pre-commit config file (aio-libs#5178)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Oct 29, 2020
1 parent ea7a08f commit 52e8b62
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
48 changes: 25 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
repos:
- repo: local
hooks:
- id: check-changes
name: Check CHANGES
language: system
entry: ./tools/check_changes.py
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.3.0'
hooks:
Expand All @@ -19,37 +26,32 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.3.0'
hooks:
- id: end-of-file-fixer
exclude: >-
^docs/[^/]*\.svg$
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: file-contents-sorter
files: |
CONTRIBUTORS.txt|
docs/spelling_wordlist.txt|
.gitignore|
.gitattributes
- id: check-case-conflict
- id: check-json
- id: check-xml
- id: check-executables-have-shebangs
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-added-large-files
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: check-symlinks
- id: file-contents-sorter
files: CONTRIBUTORS.txt
- id: debug-statements
# Another entry is required to apply file-contents-sorter to another file
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.3.0'
hooks:
- id: file-contents-sorter
files: docs/spelling_wordlist.txt
# Another entry is required to apply file-contents-sorter to another file
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.3.0'
hooks:
- id: file-contents-sorter
files: .gitignore
# Another entry is required to apply file-contents-sorter to another file
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.3.0'
hooks:
- id: file-contents-sorter
files: .gitattributes
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
exclude: ^examples/
- repo: https://github.com/asottile/pyupgrade
rev: 'v2.7.3'
hooks:
Expand Down
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,13 @@ cythonize: .install-cython $(PYXS:.pyx=.c)
lint: fmt mypy

.PHONY: fmt format
fmt format: check_changes
fmt format:
python -m pre_commit run --all-files --show-diff-on-failure

.PHONY: mypy
mypy:
mypy aiohttp

.PHONY: check_changes
check_changes:
./tools/check_changes.py


.develop: .install-deps $(call to-md5,$(PYS) $(CYS) $(CS))
pip install -e .
@touch .develop
Expand Down
1 change: 1 addition & 0 deletions examples/cli_app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
"""
Example of serving an Application using the `aiohttp.web` CLI.
Expand Down
1 change: 1 addition & 0 deletions examples/client_auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import asyncio

import aiohttp
Expand Down
1 change: 1 addition & 0 deletions examples/client_json.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import asyncio

import aiohttp
Expand Down
1 change: 1 addition & 0 deletions examples/fake_server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import asyncio
import pathlib
import socket
Expand Down
1 change: 1 addition & 0 deletions examples/static_files.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import pathlib

from aiohttp import web
Expand Down

0 comments on commit 52e8b62

Please sign in to comment.