Merge pull request 'Integrating codestyle tools into project' (#1) from codestyle-tools into main

This commit is contained in:
ivnglkv 2022-06-12 16:21:42 +03:00
commit c51710dcb7
4 changed files with 55 additions and 0 deletions

29
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,29 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
entry: pflake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
- pyproject-flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort

View file

@ -1,5 +1,7 @@
# Rectes # Rectes
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Rectes (anagram from "secret") is self-hosted service to share secrets (like passwords) with somebody Rectes (anagram from "secret") is self-hosted service to share secrets (like passwords) with somebody
over the network, but don't want them to appear in chats, unencrypted e-mails, etc. over the network, but don't want them to appear in chats, unencrypted e-mails, etc.
@ -7,3 +9,18 @@ This service tries to be as anonymous as possible. The only personal information
on a server will be IP address of the client that made request to the server. on a server will be IP address of the client that made request to the server.
Service is built with Python, FastAPI and is using Redis for data storage. Service is built with Python, FastAPI and is using Redis for data storage.
## Contributing
Codestyle is enforced with Black, and additional checks are done with the help of pre-commit-hooks,
Flake8 and isort. Prior to making any commits, install `pre-commit` tool and install hooks:
```
# Alternatively, you could use 'pip install ".[development]"'
$ pip install pre-commit==2.19.0
$ pre-commit install
```
This way you will always be sure that new code follows project guidelines.
This project is using trunk-based branching strategy with the `main` as trunk branch.

View file

@ -1,3 +1,10 @@
[build-system] [build-system]
requires = ["setuptools>=42"] requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[tool.isort]
profile = "black"
[tool.flake8]
max-line-length = 88
extend-ignore = "E203, B008"

View file

@ -13,6 +13,8 @@ python_requires = >=3.10
[options.extras_require] [options.extras_require]
hiredis = hiredis =
hiredis==2.0.0 hiredis==2.0.0
development =
pre-commit==2.19.0
[options.packages.find] [options.packages.find]
where = src where = src