Skip to content

Commit

Permalink
Merge pull request #32 from sot/black
Browse files Browse the repository at this point in the history
Black and isort
  • Loading branch information
taldcroft authored Dec 27, 2022
2 parents 17fd07c + 03c25c1 commit c51a9af
Show file tree
Hide file tree
Showing 10 changed files with 317 additions and 208 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Check black formatting

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
8 changes: 3 additions & 5 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Lint with flake8
run: |
pip install flake8
# W503 - binary expression before line break
# E402 - import order
flake8 . --count --exclude=docs,validate --ignore=E402,W503 --max-line-length=100 --show-source --statistics
flake8 . --exclude=docs --count --ignore=W503,W504,F541,E203 --max-line-length=100 --show-source --statistics
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*~
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3.11

- repo: https://github.com/pycqa/isort
rev: 5.11.4
hooks:
- id: isort
name: isort (python)
5 changes: 3 additions & 2 deletions cxotime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@


def test(*args, **kwargs):
'''
"""
Run py.test unit tests.
'''
"""
import testr

return testr.test(*args, **kwargs)
Loading

0 comments on commit c51a9af

Please sign in to comment.