Skip to content

Commit 46d51b3

Browse files
author
rohit.jadhav1
committed
formatting with pre commit
1 parent d8c7589 commit 46d51b3

17 files changed

+43
-17
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ GITHUB_CLIENT_ID=[GITHUB_CLIENT_ID]
66
GITHUB_CLIENT_SECRET=[GITHUB_CLIENT_SECRET]
77
INTERNAL_AUTH_TOKEN='[INTERNAL_AUTH_TOKEN]'
88
SUPERTOKENS_API_KEY='[SUPERTOKENS_API_KEY]'
9-
SUPERTOKENS_CONNECTION_URI='[SUPERTOKENS_CONNECTION_URI]'
9+
SUPERTOKENS_CONNECTION_URI='[SUPERTOKENS_CONNECTION_URI]'

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ next-env.d.ts
3232

3333
# python
3434
__pycache__
35-
.mypy_cache
35+
.mypy_cache

.pre-commit-config.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- repo: https://github.com/psf/black
8+
rev: 23.3.0
9+
hooks:
10+
- id: black

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ rollback_base:
3030
alembic downgrade base
3131

3232
reset:
33-
make rollback migrate seed
33+
make rollback migrate seed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,21 @@ The project is organized into the following directories and files:
7373
4. Rename `.env.example` to `.env` and fill in the values
7474
5. Run `make server` and `make worker` to start the web server and the Celery worker
7575

76+
77+
## Pre-Commit Setup
78+
79+
If you are using this project then pre-commit setup would be very helpful for checking your codebase. In short, pre-commit is a tool that allows developers to define and apply automated checks to their code before they commit it to a version control system. You can find more info [here](https://pre-commit.com)
80+
81+
82+
```commandline
83+
pip install pre-commit
84+
pre-commit --version
85+
pre-commit install
86+
87+
# for the first time, run on all files
88+
pre-commit run --all-files
89+
```
90+
7691
## License
7792

7893
MIT License

alembic.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ class = logging.Formatter
134134
class = app.utils.RichConsoleHandler
135135
args = (100, "blue")
136136
kwargs = {"omit_repeated_times":False, "show_time": False, "enable_link_path": True, "tracebacks_show_locals": True}
137-
level = NOTSET
137+
level = NOTSET

app/celery.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from celery import Celery # type: ignore
2-
from kombu.utils.url import safequote # type: ignore
1+
from celery import Celery # type: ignore
2+
from kombu.utils.url import safequote # type: ignore
33
from app import config
44

55
settings = config.get_settings()

app/db/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Generic single-database configuration.
1+
Generic single-database configuration.

app/db/versions/2023_04_03_1551-184d20e99b62_create_initial_tables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""create initial tables
22
33
Revision ID: 184d20e99b62
4-
Revises:
4+
Revises:
55
Create Date: 2023-03-31 19:31:13.839153
66
77
"""

app/models/event_documentation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@ class EventDocumentationCreate(PydanticModelBase):
5454
domains: List[str]
5555
paths: List[str]
5656

57+
5758
class EventDocumentationUpdate(PydanticModelBase):
58-
last_seen: datetime
59+
last_seen: datetime

app/services/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
from .event import *
33
from .domain import *
44
from .user import *
5-
from .event_documentation import *
5+
from .event_documentation import *

app/services/base.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from sqlalchemy.ext.asyncio import AsyncSession
22
from pydantic import UUID4
33

4+
45
class BaseService:
56
account_id: UUID4
67
db: AsyncSession
7-
8+
89
def __init__(self, db: AsyncSession, account_id: UUID4):
910
self.account_id = account_id
10-
self.db = db
11+
self.db = db

app/subapps/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .client import *
22
from .web_app import *
3-
from .internal import *
3+
from .internal import *

app/utils/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
from .logger import *
22
from .route_handler import *
3-

mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ warn_required_dynamic_aliases = True
1010
warn_untyped_fields = True
1111

1212
[mypy-supertokens_python.*]
13-
follow_imports = skip
13+
follow_imports = skip

requirements/common.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ rich
1212
supertokens-python
1313
requests
1414
boto3
15-
celery[sqs]
15+
celery[sqs]

requirements/dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ types-Pygments
77
types-psycopg2
88
types-python-dateutil
99
types-ujson
10-
boto3-stubs[s3]
10+
boto3-stubs[s3]

0 commit comments

Comments
 (0)