Skip to content

Commit

Permalink
Setup pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
danielebriggi committed May 24, 2024
1 parent fdc45c5 commit 897e7bb
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# W503,E501,E701: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#w503
ignore = E203, W503, E501, E701
# align to black choice
max-line-length = 88
max-line-length = 88
2 changes: 1 addition & 1 deletion .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: src/dist/
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: detect-private-key
- id: check-merge-conflict
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 22.8.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.6
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort
- repo: https://github.com/PyCQA/autoflake
rev: v1.4
hooks:
- id: autoflake
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
stages: [push]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ for row in result:

### _Close connection_

```python
```python
client.disconnect(conn)
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

[tool.isort]
# make the tools compatible to each other
profile = "black"
profile = "black"
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pylint==2.13.9
mypy==0.971
flake8==5.0.4
isort==5.10.1
autoflake==1.4
autoflake==1.4
pre-commit==2.17.0
2 changes: 1 addition & 1 deletion src/README-PYPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ for row in result:

### _Close connection_

```python
```python
client.disconnect(conn)
```
5 changes: 1 addition & 4 deletions src/tests/integration/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import pytest

from sqlitecloud import download
from sqlitecloud.types import (
SQCLOUD_ERRCODE,
SQCloudException,
)
from sqlitecloud.types import SQCLOUD_ERRCODE, SQCloudException


class TestDownload:
Expand Down
1 change: 0 additions & 1 deletion src/tests/integration/test_upload.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import uuid


from sqlitecloud.upload import upload_db


Expand Down

0 comments on commit 897e7bb

Please sign in to comment.