Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add pre-commit file #144

Merged
merged 3 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: "3.9.2"
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: "5.8.0"
hooks:
- id: isort
tadejsv marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ If you are working from the command line, you should use these tools form the ro
black jinahub/encoders/text/BERTTextEncoder
```

We also provide a `.pre-commit-config.yaml` file, which enables you to use [pre-commit](https://pre-commit.com/index.html) to automatically perform the required linting/formatting actions before you commit your changes. You can install it using

```
pip install pre-commit
pre-commit install
```

tadejsv marked this conversation as resolved.
Show resolved Hide resolved
### 📖 Documentation

When writing code you should already be adding documentation, by writing docstrings for all classes, methods and functions. Type hints for all arguments and return values should be added as well.
Expand Down