Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Commit d3421d0

Browse files
authored
Merge pull request #16 from alma/pre-commit
Check pre-commit on travis for pull-requests.
2 parents 6fcfac6 + 35e9422 commit d3421d0

12 files changed

Lines changed: 36 additions & 18 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.3.0
5+
rev: v3.2.0
66
hooks:
77
- id: check-added-large-files
88
- id: check-ast
@@ -14,23 +14,24 @@ repos:
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/psf/black
17-
rev: 19.10b0
17+
rev: 20.8b1
1818
hooks:
1919
- id: black
2020

2121
- repo: https://github.com/pre-commit/mirrors-isort
22-
rev: v4.3.21
22+
rev: v5.4.2
2323
hooks:
2424
- id: isort
25+
additional_dependencies:
26+
- toml
2527

2628
- repo: https://gitlab.com/pycqa/flake8
27-
rev: 3.7.9
29+
rev: 3.8.3
2830
hooks:
2931
- id: flake8
3032
args: [--max-line-length=99]
31-
language_version: python3.7
3233

3334
- repo: https://github.com/pre-commit/mirrors-mypy
34-
rev: 'v0.761'
35+
rev: 'v0.782'
3536
hooks:
3637
- id: mypy

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ python:
88
- 3.6
99
- 3.7
1010
- 3.8
11-
matrix:
11+
jobs:
1212
fast_finish: true
1313
include:
1414
- python: 3.8
1515
env: TOXENV=flake8
16+
- name: "Code checks"
17+
if: type = pull_request
18+
dist: bionic
19+
language: python
20+
python: 3.8
21+
install: pip install pre-commit
22+
script:
23+
pre-commit run --all-files --show-diff-on-failure

alma/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
from .api_modes import ApiModes
77
from .context import Context
88
from .credentials import (
9-
MerchantIdCredentials,
109
AlmaSessionCredentials,
1110
ApiKeyCredentials,
1211
Credentials,
12+
MerchantIdCredentials,
1313
)
1414
from .version import __version__ as alma_version
1515

alma/credentials/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flake8: noqa
22

3-
from .base import Credentials
43
from .alma_session import AlmaSessionCredentials
54
from .api_key import ApiKeyCredentials
5+
from .base import Credentials
66
from .merchant_id import MerchantIdCredentials

alma/credentials/alma_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from . import Credentials
21
from .. import ApiModes
2+
from .base import Credentials
33

44

55
class AlmaSessionCredentials(Credentials):

alma/credentials/api_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from . import Credentials
21
from .. import ApiModes
2+
from .base import Credentials
33

44

55
class ApiKeyCredentials(Credentials):

alma/credentials/merchant_id.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from . import Credentials
21
from .. import ApiModes
2+
from .base import Credentials
33

44

55
class MerchantIdCredentials(Credentials):

alma/endpoints/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# flake8: noqa
22

33
from .base import Base
4+
from .exports import Exports
45
from .merchants import Merchants
56
from .orders import Orders
6-
from .exports import Exports
77
from .payments import Payments

alma/entities/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from .base import Base
44
from .eligibility import Eligibility
5+
from .export import Export, ExportFormat, ExportType
56
from .installment import Installment, InstallmentState
67
from .merchant import Merchant
78
from .order import Order
89
from .payment import Payment, PaymentFraudType, PaymentState
910
from .refund import Refund
10-
from .export import Export, ExportType, ExportFormat

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ exclude = '''
99
| .venv
1010
)/
1111
'''
12+
13+
[tool.isort]
14+
force_grid_wrap = false
15+
include_trailing_comma = true
16+
line_length = 99
17+
multi_line_output = 3
18+
skip_glob = ''
19+
use_parentheses = true
20+
combine_as_imports = true

0 commit comments

Comments
 (0)