diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d4091cc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: check-ast + - id: check-case-conflict + - id: check-json + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + + - repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + args: + - --max-line-length=160 + - repo: https://github.com/PyCQA/isort + rev: 5.11.5 + hooks: + - id: isort + args: + - --line-length=160 + - repo: https://github.com/pre-commit/mirrors-yapf + rev: v0.32.0 + hooks: + - id: yapf + args: + - column_limit = 160 + additional_dependencies: [toml] diff --git a/TaiwanLottery/utils.py b/TaiwanLottery/utils.py index d0d0ad7..c53adcb 100644 --- a/TaiwanLottery/utils.py +++ b/TaiwanLottery/utils.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- import datetime -import math -import logging import json +import logging +import math + from terminaltables import AsciiTable diff --git a/requirements.txt b/requirements.txt index 7909ee5..242316d 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/setup.cfg b/setup.cfg index cbf9916..47e29d8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,6 +29,7 @@ testing = pytest>=7.0 pytest-cov>=4.0 flake8>=6.0 + pre-commit>=3.3 [flake8] max-line-length = 160 diff --git a/setup.py b/setup.py index b39d725..d3c6529 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ "pytest>=7.0", "pytest-cov>=4.0", "flake8>=6.0", + "pre-commit>=3.3" ], keywords=['python', 'taiwanlottery', 'crawler', 'lottery', 'taiwan', '台灣彩券', '樂透', '彩券'], classifiers=[