Skip to content

Commit

Permalink
code reformatted.
Browse files Browse the repository at this point in the history
  • Loading branch information
dapper91 committed Feb 25, 2023
1 parent fa791ce commit 41286f9
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 127 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
max-line-length = 130
max-line-length = 120
per-file-ignores =
crontools/*__init__.py: F401
42 changes: 21 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv --upgrade
pipenv install --python ${{ matrix.python-version }} --dev
- name: Run linter
run: pipenv run flake8 .
- name: Run tests
run: PYTHONPATH="$(pwd):$PYTHONPATH" pipenv run py.test --cov=crontools --cov-report=xml tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
fail_ci_if_error: true
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root
- name: Run pre-commit hooks
run: poetry run pre-commit run --hook-stage merge-commit --all-files
- name: Run tests
run: PYTHONPATH="$(pwd):$PYTHONPATH" poetry run py.test --cov=crontools --cov-report=xml tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
fail_ci_if_error: true
66 changes: 39 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,64 @@
default_stages:
- commit
- merge-commit

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: check-docstring-first
stages:
- commit
- push
- id: check-merge-conflict
stages:
- push
- id: check-yaml
- id: check-toml
- id: trailing-whitespace
stages:
- commit
- push
- id: end-of-file-fixer
stages:
- commit
- push
- id: mixed-line-ending
name: fix line ending
stages:
- commit
- push
args:
- --fix=lf
- id: no-commit-to-branch
- id: mixed-line-ending
name: check line ending
stages:
- merge-commit
args:
- --fix=no
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
stages:
- commit
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.5.5
rev: v2.0.1
hooks:
- id: autopep8
stages:
- commit
- push
args:
- --max-line-length=130
- --diff
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.1.0
hooks:
- id: add-trailing-comma
stages:
- commit
- push
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.11.5
hooks:
- id: isort
name: fix import order
stages:
- commit
- push
args:
- --line-length=120
- --multi-line=9
- --project=crontools
- id: isort
name: check import order
stages:
- merge-commit
args:
- --check-only
- --line-length=120
- --multi-line=9
- --project=crontools
18 changes: 4 additions & 14 deletions crontools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@
Python cron tools.
"""

from .crontab import Crontab
from .crontab import Range, SecondsRange, MinuteRange, HourRange, MonthdayRange, MonthRange, WeekdayRange, YearRange
from .crontab import Field, SecondsField, MinuteField, HourField, MonthdayField, MonthField, WeekdayField, YearField, DayField


from .__about__ import (
__title__,
__description__,
__url__,
__version__,
__author__,
__email__,
__license__,
)
from .__about__ import __author__, __description__, __email__, __license__, __title__, __url__, __version__
from .crontab import Crontab, DayField, Field, HourField, HourRange, MinuteField, MinuteRange, MonthdayField
from .crontab import MonthdayRange, MonthField, MonthRange, Range, SecondsField, SecondsRange, WeekdayField
from .crontab import WeekdayRange, YearField, YearRange

__all__ = [
'__title__',
Expand Down
Loading

0 comments on commit 41286f9

Please sign in to comment.