Skip to content

Commit

Permalink
pre commit config (#2)
Browse files Browse the repository at this point in the history
* pre commit config for python(backend) and frontend/every other doc format

* pre commit config add eslint
  • Loading branch information
AitBaali-Hamza-bcg authored and GitHub Enterprise committed May 31, 2023
1 parent b796d39 commit 9566a4e
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 59 deletions.
68 changes: 68 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: check-merge-conflict
- id: fix-encoding-pragma

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
types: [python]
args: [--max-line-length=88, "--ignore=E203,W503,E501,E231,E741,E722,E203,W"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
types: [python]

- repo: https://github.com/kynan/nbstripout
rev: 0.5.0
hooks:
- id: nbstripout
types: [python]

- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
name: black (python)
types: [python]

- repo: https://github.com/pappasam/toml-sort
rev: v0.20.0
hooks:
- id: toml-sort
pass_filenames: false
always_run: true
args: [backend/app/pyproject.toml, --all, --in-place]
types: [python]

- repo: https://github.com/myint/docformatter
rev: v1.4
hooks:
- id: docformatter
args: ["--in-place", "--pre-summary-newline", "--wrap-descriptions=88", "--wrap-summaries=88"]
types: [python]

- repo: https://github.com/prettier/prettier
rev: 2.1.1
hooks:
- id: prettier
args: ["--single-quote=true"]
types: [javascript, json, markdown, yaml, css, html, graphql, markdown, mdx, vue]
exclude: .*/node_modules/.*

- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v7.9.0'
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
118 changes: 59 additions & 59 deletions backend/app/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
[tool.poetry]
name = "protocol-app"
version = "0.1.0"
description = ""
authors = ["jheyder <heyder.jakob@bcg.com>"]
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0"]

[tool.black]
line-length = 88
target-version = [ "py310", "py311" ]
exclude = "((.eggs | .git | .pytest_cache | build | dist))"

[tool.ruff]
line-length = 88
exclude = [".git", "__pycache__", ".mypy_cache", ".pytest_cache"]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
# "I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
]
ignore = [
"B904",
"B006",
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]
target-version = [ "py310", "py311" ]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
[tool.poetry]
authors = ["jheyder <heyder.jakob@bcg.com>"]
description = ""
name = "protocol-app"
version = "0.1.0"

[tool.poetry.dependencies]
python = ">=3.10,<3.12"
Pillow = "^9.4.0"
SQLAlchemy = "^1.4.41"
SQLAlchemy-Utils = "^0.38.3"
alembic = "^1.10.4"
asyncer = "^0.0.2"
asyncpg = "^0.27.0"
fastapi = {extras = ["all"], version = "^0.95.1"}
sqlmodel = "^0.0.8"
python-jose = "^3.3.0"
celery = "^5.2.7"
celery-sqlalchemy-scheduler = "^0.3.0"
cryptography = "^38.0.3"
passlib = "^1.7.4"
SQLAlchemy-Utils = "^0.38.3"
python-box= "^5.1.1"
SQLAlchemy = "^1.4.41"
snowflake-sqlalchemy = "^1.4.7"
fastapi-pagination = {extras = ["sqlalchemy"], version = "^0.11.4"}
fastapi = {extras = ["all"], version = "^0.95.1"}
fastapi-async-sqlalchemy = "^0.3.12"
fastapi-cache2 = {extras = ["redis"], version = "^0.2.1"}
minio = "^7.1.13"
Pillow = "^9.4.0"
watchfiles = "^0.18.1"
asyncer = "^0.0.2"
fastapi-limiter = "^0.1.5"
fastapi-pagination = {extras = ["sqlalchemy"], version = "^0.11.4"}
httpx = "^0.23.1"
pandas = "^1.5.3"
humps = "^0.2.2"
langchain = "^0.0.177"
minio = "^7.1.13"
openai = "^0.27.6"
openpyxl = "^3.0.10"
redis = "^4.5.1"
fastapi-async-sqlalchemy = "^0.3.12"
oso = "^0.26.4"
celery = "^5.2.7"
celery-sqlalchemy-scheduler = "^0.3.0"
pandas = "^1.5.3"
passlib = "^1.7.4"
pgvector = "^0.1.6"
psycopg2-binary = "^2.9.5"
pymupdf = "^1.22.3"
python = ">=3.10,<3.12"
python-box = "^5.1.1"
python-jose = "^3.3.0"
redis = "^4.5.1"
requests = "^2.29.0"
wheel = "^0.40.0"
setuptools = "^67.7.2"
langchain = "^0.0.177"
openai = "^0.27.6"
fastapi-limiter = "^0.1.5"
tiktoken= "^0.3.3"
transformers = "^4.28.1"
snowflake-connector-python = "^3.0.3"
pgvector = "^0.1.6"
snowflake-sqlalchemy = "^1.4.7"
sqlmodel = "^0.0.8"
tiktoken = "^0.3.3"
torch = [
{url = "https://download.pytorch.org/whl/cpu/torch-2.0.0%2Bcpu-cp310-cp310-linux_x86_64.whl", markers = "sys_platform == 'linux'"},
{url = "https://download.pytorch.org/whl/cpu/torch-2.0.0%2Bcpu-cp310-cp310-win_amd64.whl", markers = "sys_platform == 'win32'"}
]
humps = "^0.2.2"
pymupdf = "^1.22.3"
transformers = "^4.28.1"
watchfiles = "^0.18.1"
wheel = "^0.40.0"

[tool.poetry.group.dev.dependencies]
pytest = "^5.2"
black = "^23.1.0"
pytest = "^5.2"
ruff = "^0.0.256"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
exclude = [".git", "__pycache__", ".mypy_cache", ".pytest_cache"]
ignore = [
"B904",
"B006",
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]
line-length = 88
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
# "I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]

0 comments on commit 9566a4e

Please sign in to comment.