Skip to content

Commit 41286f9

Browse files
committed
code reformatted.
1 parent fa791ce commit 41286f9

File tree

5 files changed

+130
-127
lines changed

5 files changed

+130
-127
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
max-line-length = 130
2+
max-line-length = 120
33
per-file-ignores =
44
crontools/*__init__.py: F401

.github/workflows/test.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ jobs:
1616
matrix:
1717
python-version: [3.7, 3.8, 3.9]
1818
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: ${{ matrix.python-version }}
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install pipenv --upgrade
28-
pipenv install --python ${{ matrix.python-version }} --dev
29-
- name: Run linter
30-
run: pipenv run flake8 .
31-
- name: Run tests
32-
run: PYTHONPATH="$(pwd):$PYTHONPATH" pipenv run py.test --cov=crontools --cov-report=xml tests
33-
- name: Upload coverage to Codecov
34-
uses: codecov/codecov-action@v1
35-
with:
36-
token: ${{ secrets.CODECOV_TOKEN }}
37-
files: ./coverage.xml
38-
flags: unittests
39-
fail_ci_if_error: true
19+
- uses: actions/checkout@v2
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install poetry
28+
poetry install --no-root
29+
- name: Run pre-commit hooks
30+
run: poetry run pre-commit run --hook-stage merge-commit --all-files
31+
- name: Run tests
32+
run: PYTHONPATH="$(pwd):$PYTHONPATH" poetry run py.test --cov=crontools --cov-report=xml tests
33+
- name: Upload coverage to Codecov
34+
uses: codecov/codecov-action@v1
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
37+
files: ./coverage.xml
38+
flags: unittests
39+
fail_ci_if_error: true

.pre-commit-config.yaml

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,64 @@
1+
default_stages:
2+
- commit
3+
- merge-commit
4+
15
repos:
26
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
7+
rev: v4.4.0
48
hooks:
5-
- id: check-docstring-first
6-
stages:
7-
- commit
8-
- push
9-
- id: check-merge-conflict
10-
stages:
11-
- push
9+
- id: check-yaml
10+
- id: check-toml
1211
- id: trailing-whitespace
13-
stages:
14-
- commit
15-
- push
1612
- id: end-of-file-fixer
1713
stages:
1814
- commit
19-
- push
2015
- id: mixed-line-ending
16+
name: fix line ending
2117
stages:
2218
- commit
23-
- push
2419
args:
2520
- --fix=lf
26-
- id: no-commit-to-branch
21+
- id: mixed-line-ending
22+
name: check line ending
23+
stages:
24+
- merge-commit
25+
args:
26+
- --fix=no
27+
- repo: https://github.com/asottile/add-trailing-comma
28+
rev: v2.4.0
29+
hooks:
30+
- id: add-trailing-comma
2731
stages:
2832
- commit
2933
- repo: https://github.com/pre-commit/mirrors-autopep8
30-
rev: v1.5.5
34+
rev: v2.0.1
3135
hooks:
3236
- id: autopep8
3337
stages:
3438
- commit
35-
- push
3639
args:
37-
- --max-line-length=130
3840
- --diff
39-
- repo: https://github.com/asottile/add-trailing-comma
40-
rev: v2.1.0
41-
hooks:
42-
- id: add-trailing-comma
43-
stages:
44-
- commit
45-
- push
46-
- repo: https://gitlab.com/pycqa/flake8
47-
rev: 3.9.0
41+
- repo: https://github.com/pycqa/flake8
42+
rev: 5.0.4
4843
hooks:
4944
- id: flake8
45+
- repo: https://github.com/pycqa/isort
46+
rev: 5.11.5
47+
hooks:
48+
- id: isort
49+
name: fix import order
5050
stages:
5151
- commit
52-
- push
52+
args:
53+
- --line-length=120
54+
- --multi-line=9
55+
- --project=crontools
56+
- id: isort
57+
name: check import order
58+
stages:
59+
- merge-commit
60+
args:
61+
- --check-only
62+
- --line-length=120
63+
- --multi-line=9
64+
- --project=crontools

crontools/__init__.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,10 @@
22
Python cron tools.
33
"""
44

5-
from .crontab import Crontab
6-
from .crontab import Range, SecondsRange, MinuteRange, HourRange, MonthdayRange, MonthRange, WeekdayRange, YearRange
7-
from .crontab import Field, SecondsField, MinuteField, HourField, MonthdayField, MonthField, WeekdayField, YearField, DayField
8-
9-
10-
from .__about__ import (
11-
__title__,
12-
__description__,
13-
__url__,
14-
__version__,
15-
__author__,
16-
__email__,
17-
__license__,
18-
)
5+
from .__about__ import __author__, __description__, __email__, __license__, __title__, __url__, __version__
6+
from .crontab import Crontab, DayField, Field, HourField, HourRange, MinuteField, MinuteRange, MonthdayField
7+
from .crontab import MonthdayRange, MonthField, MonthRange, Range, SecondsField, SecondsRange, WeekdayField
8+
from .crontab import WeekdayRange, YearField, YearRange
199

2010
__all__ = [
2111
'__title__',

0 commit comments

Comments
 (0)