Skip to content

Commit

Permalink
docs: add pre-commit and add dev instructions in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Rizhiy committed May 27, 2024
1 parent 50572d3 commit c2f32c5
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
7 changes: 0 additions & 7 deletions .gitlab-ci.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
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
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.3
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.1.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,21 @@
## Installation

Released version: `pip install replete`

## Development

- Install dev dependencies: `pip install -e ".[dev]"`
- For linting and basic fixes [ruff](https://docs.astral.sh/ruff/) is used: `ruff check . --fix`
- This repository follows strict formatting style which will be checked by the CI.
- To format the code, use the [black](https://black.readthedocs.io) format: `black .`
- To sort the imports, user [isort](https://pycqa.github.io/isort/) utility: `isort .`
- To test code, use [pytest](https://pytest.org): `pytest .`
- This repository follows semantic-release, which means all commit messages have to follow a [style](https://python-semantic-release.readthedocs.io/en/latest/commit-parsing.html).
You can use tools like [commitizen](https://github.com/commitizen-tools/commitizen) to write your commits.
- You can also use [pre-commit](https://pre-commit.com/) to help verify that all changes are valid.
Multiple hooks are used, so use the following commands to install:

```bash
pre-commit install
pre-commit install --hook-type commit-msg
```
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = ["coloredlogs", "docstring-parser", "python-dateutil", "xxhash"]
[project.optional-dependencies]
testing = ["pytest<8", "pyyaml"]
test = ["flaky", "pytest", "pytest-asyncio", "pytest-coverage", "replete[testing]", "types-python-dateutil", "types-xxhash"]
dev = ["replete[test]", "ruff"]
dev = ["black", "isort", "replete[test]", "ruff"]

[project.entry-points.pytest11]
replete = "replete.testing"
Expand All @@ -31,6 +31,14 @@ minversion = "6.0"
addopts = "--doctest-modules --no-success-flaky-report"
asyncio_mode = "auto"

[tool.black]
line-length = 120
# skip-magic-trailing-comma = true

[tool.isort]
profile = "black"
line_length = 120

[tool.yamlfix]
line_length = 120
section_whitelines = 1
Expand Down
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

0 comments on commit c2f32c5

Please # to comment.