From 727f4b76da595b4731887e46e7b9b51c68e64538 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 13 Nov 2022 22:28:29 +0530 Subject: [PATCH] Add `pre-commit` config --- .pre-commit-config.yaml | 13 +++++++++++++ setup.cfg | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..29028f23d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + - repo: https://github.com/pre-commit/mirrors-autopep8 + rev: v2.0.0 + hooks: + - id: autopep8 + - repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 diff --git a/setup.cfg b/setup.cfg index da78a9c47..c8892c4bd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,5 +2,18 @@ universal = True [flake8] -exclude = youtube_dl/extractor/__init__.py,devscripts/buildserver.py,devscripts/lazy_load_template.py,devscripts/make_issue_template.py,setup.py,build,.git,venv +exclude = build,venv,.tox,.git,.pytest_cache ignore = E402,E501,E731,E741,W503 +max_line_length = 80 +per_file_ignores = + devscripts/lazy_load_template.py: F401 + +[isort] +py_version = 27 +multi_line_output = VERTICAL_HANGING_INDENT +line_length = 80 +reverse_relative = true +ensure_newline_before_comments = true +include_trailing_comma = true +known_first_party = + test