Skip to content

Commit 7860014

Browse files
committed
format
1 parent d406a36 commit 7860014

5 files changed

Lines changed: 42 additions & 20 deletions

File tree

.pre-commit-config.yaml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1+
fail_fast: true
12
repos:
23
- repo: https://github.com/ambv/black
3-
rev: stable
4+
rev: 22.1.0
45
hooks:
56
- id: black
6-
language_version: python3.7
7+
language_version: python3.8
8+
- repo: local
9+
hooks:
10+
- id: pytest-check
11+
name: pytest-check
12+
entry: pytest
13+
language: system
14+
pass_filenames: false
15+
always_run: true
16+
- repo: local
17+
hooks:
18+
- id: flake8-check1 # stop the build if there are Python syntax errors or undefined names
19+
name: flake8-check1
20+
entry: flake8 devpack --count --select=E9,F63,F7,F82 --show-source --statistics
21+
language: system
22+
pass_filenames: false
23+
always_run: true
24+
- repo: local
25+
hooks:
26+
- id: flake8-check2 # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
27+
name: flake8-check2
28+
entry: flake8 devpack --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
29+
language: system
30+
pass_filenames: false
31+
always_run: true

devpack/cli.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ def install_develop():
1515
"PACKAGE_NAME", metavar="Name", type=str, help="Package name to install"
1616
)
1717
"""
18-
parser.add_argument(
19-
"--SITE",
20-
"-s",
21-
type=bool,
22-
default=False,
23-
metavar="SITE",
24-
help="Open user or site dirs (default: User)",
25-
)
26-
"""
18+
parser.add_argument(
19+
"--SITE",
20+
"-s",
21+
type=bool,
22+
default=False,
23+
metavar="SITE",
24+
help="Open user or site dirs (default: User)",
25+
)
26+
"""
2727
args = parser.parse_args()
2828

2929
pip_install_development_package(args.PACKAGE_NAME)

samples/imports.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
print(draugr.__version__)
77
print(apppath.__version__)
88

9-
109
# TOOD: https://www.python.org/dev/peps/pep-0440/#pre-releases
1110
# pip install --pre xxx
1211
# Include pre-release and development versions. By default, pip only finds stable versions.

tests/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/req_unit_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pkg_resources
77

88
_REQUIREMENTS_PATH = Path(__file__).parent.with_name("requirements.txt")
9-
_EXTRA_REQUIREMENTS_PATH = Path(__file__).parent.parent/'requirements'
9+
_EXTRA_REQUIREMENTS_PATH = Path(__file__).parent.parent / "requirements"
1010

1111

1212
class TestRequirements(unittest.TestCase):
@@ -24,9 +24,11 @@ def test_extra_requirements(self):
2424
"""Test that each required package is available."""
2525
if _EXTRA_REQUIREMENTS_PATH.exists():
2626
for extra_req_file in _EXTRA_REQUIREMENTS_PATH.iterdir():
27-
if extra_req_file.is_file() and extra_req_file.suffix == '.txt':
28-
requirements = pkg_resources.parse_requirements(extra_req_file.open())
27+
if extra_req_file.is_file() and extra_req_file.suffix == ".txt":
28+
requirements = pkg_resources.parse_requirements(
29+
extra_req_file.open()
30+
)
2931
for requirement in requirements:
3032
requirement = str(requirement)
3133
with self.subTest(requirement=requirement):
32-
pkg_resources.require(requirement)
34+
pkg_resources.require(requirement)

0 commit comments

Comments
 (0)