chore: add pre-commit
This commit is contained in:
parent
e8291f4bef
commit
72ee09b064
8 changed files with 40 additions and 13 deletions
28
.pre-commit-config.yaml
Normal file
28
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
files: ^secretsanta|apps|tests$
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.5.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
args: [ --markdown-linebreak-ext=md ]
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-ast
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-byte-order-marker
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: check-docstring-first
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-toml
|
||||||
|
- id: debug-statements
|
||||||
|
- id: mixed-line-ending
|
||||||
|
args: [ --fix=lf ]
|
||||||
|
|
||||||
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
|
rev: v0.1.6
|
||||||
|
hooks:
|
||||||
|
- id: ruff
|
||||||
|
args:
|
||||||
|
- --fix
|
||||||
|
- --exit-non-zero-on-fix
|
||||||
|
- id: ruff-format
|
||||||
14
Makefile
14
Makefile
|
|
@ -1,10 +1,3 @@
|
||||||
install:
|
|
||||||
@echo "Installing pdm packages"
|
|
||||||
@. pdm install
|
|
||||||
@echo "Installing node packages"
|
|
||||||
@. cd apps/http/sls npm i
|
|
||||||
|
|
||||||
|
|
||||||
run--sls:
|
run--sls:
|
||||||
@echo "Activating virtual environment and starting serverless offline"
|
@echo "Activating virtual environment and starting serverless offline"
|
||||||
@. .venv/bin/activate && cd apps/http/sls && npx sls offline
|
@. .venv/bin/activate && cd apps/http/sls && npx sls offline
|
||||||
|
|
@ -12,3 +5,10 @@ run--sls:
|
||||||
deploy--sls:
|
deploy--sls:
|
||||||
@echo "Deploying via serverless framework"
|
@echo "Deploying via serverless framework"
|
||||||
@. cd apps/http/sls && pdm export -G sls -f requirements --prod > requirements.txt && npx sls deploy
|
@. cd apps/http/sls && pdm export -G sls -f requirements --prod > requirements.txt && npx sls deploy
|
||||||
|
|
||||||
|
lint:
|
||||||
|
pre-commit run --all-files --color always
|
||||||
|
|
||||||
|
tests--unit:
|
||||||
|
pdm run pytest --cov secretsanta tests
|
||||||
|
coverage html
|
||||||
|
|
@ -241,4 +241,3 @@ yarl==1.9.4 \
|
||||||
--hash=sha256:e23a6d84d9d1738dbc6e38167776107e63307dfc8ad108e580548d1f2c587f42 \
|
--hash=sha256:e23a6d84d9d1738dbc6e38167776107e63307dfc8ad108e580548d1f2c587f42 \
|
||||||
--hash=sha256:ea65804b5dc88dacd4a40279af0cdadcfe74b3e5b4c897aa0d81cf86927fee78 \
|
--hash=sha256:ea65804b5dc88dacd4a40279af0cdadcfe74b3e5b4c897aa0d81cf86927fee78 \
|
||||||
--hash=sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958
|
--hash=sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ chalice = [
|
||||||
sls = [
|
sls = [
|
||||||
"anyio>=4.1.0",
|
"anyio>=4.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["pdm-backend"]
|
requires = ["pdm-backend"]
|
||||||
build-backend = "pdm.backend"
|
build-backend = "pdm.backend"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import json
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
import aioboto3
|
import aioboto3
|
||||||
import botocore
|
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
|
|
||||||
from secretsanta.domain import Group, IRepo
|
from secretsanta.domain import Group, IRepo
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue