Skip to content

Commit 897e7bb

Browse files
committed
Setup pre-commit checks
1 parent fdc45c5 commit 897e7bb

File tree

9 files changed

+40
-11
lines changed

9 files changed

+40
-11
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# W503,E501,E701: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#w503
44
ignore = E203, W503, E501, E701
55
# align to black choice
6-
max-line-length = 88
6+
max-line-length = 88

.github/workflows/pypi-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ jobs:
3838
uses: pypa/gh-action-pypi-publish@release/v1
3939
with:
4040
packages-dir: src/dist/
41-
password: ${{ secrets.PYPI_API_TOKEN }}
41+
password: ${{ secrets.PYPI_API_TOKEN }}

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: detect-private-key
8+
- id: check-merge-conflict
9+
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
10+
- repo: https://github.com/psf/black-pre-commit-mirror
11+
rev: 22.8.0
12+
hooks:
13+
- id: black
14+
# It is recommended to specify the latest version of Python
15+
# supported by your project here, or alternatively use
16+
# pre-commit's default_language_version, see
17+
# https://pre-commit.com/#top_level-default_language_version
18+
language_version: python3.6
19+
- repo: https://github.com/pycqa/isort
20+
rev: 5.10.1
21+
hooks:
22+
- id: isort
23+
name: isort
24+
- repo: https://github.com/PyCQA/autoflake
25+
rev: v1.4
26+
hooks:
27+
- id: autoflake
28+
- repo: https://github.com/pycqa/flake8
29+
rev: 5.0.4
30+
hooks:
31+
- id: flake8
32+
stages: [push]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ for row in result:
5757

5858
### _Close connection_
5959

60-
```python
60+
```python
6161
client.disconnect(conn)
6262
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
[tool.isort]
55
# make the tools compatible to each other
6-
profile = "black"
6+
profile = "black"

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ pylint==2.13.9
99
mypy==0.971
1010
flake8==5.0.4
1111
isort==5.10.1
12-
autoflake==1.4
12+
autoflake==1.4
13+
pre-commit==2.17.0

src/README-PYPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ for row in result:
5757

5858
### _Close connection_
5959

60-
```python
60+
```python
6161
client.disconnect(conn)
6262
```

src/tests/integration/test_download.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
import pytest
55

66
from sqlitecloud import download
7-
from sqlitecloud.types import (
8-
SQCLOUD_ERRCODE,
9-
SQCloudException,
10-
)
7+
from sqlitecloud.types import SQCLOUD_ERRCODE, SQCloudException
118

129

1310
class TestDownload:

src/tests/integration/test_upload.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import uuid
33

4-
54
from sqlitecloud.upload import upload_db
65

76

0 commit comments

Comments
 (0)