Add pre-commit (#140)
* Add pre-commit config files * Add linting test on github action
This commit is contained in:
parent
94b26a8781
commit
8f228d6844
15
.github/workflows/lint_test.yml
vendored
Normal file
15
.github/workflows/lint_test.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
- uses: pre-commit/action@v2.0.0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
15
.pre-commit-config.yaml
Normal file
15
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://gitlab.com/pycqa/flake8
|
||||||
|
rev: 3.7.9
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
||||||
|
- repo: https://github.com/pycqa/isort
|
||||||
|
rev: 5.5.4
|
||||||
|
hooks:
|
||||||
|
- id: isort
|
||||||
|
args: ["--profile", "black"]
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 20.8b1
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
language_version: python3
|
|
@ -190,6 +190,6 @@ If you like the project, here's a few things you can do
|
||||||
- Open issues, participate on discussions, report bugs, suggest ideas
|
- Open issues, participate on discussions, report bugs, suggest ideas
|
||||||
- Star the project
|
- Star the project
|
||||||
- Add functionality, work on a PR, fix an issue!
|
- Add functionality, work on a PR, fix an issue!
|
||||||
|
- Before you send a PR, make sure your code is properly formatted. For that, use `pre-commit install` to install a pre-commit hook and run `pre-commit run --all` and fix everything before you commit. This pre-commit will check for your code lint everytime you commit a code.
|
||||||
## Contact
|
## Contact
|
||||||
info@mediacms.io
|
info@mediacms.io
|
||||||
|
|
17
pyproject.toml
Normal file
17
pyproject.toml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[tool.black]
|
||||||
|
line-length = 200
|
||||||
|
target-version = ['py36', 'py37', 'py38']
|
||||||
|
skip-string-normalization = true
|
||||||
|
include = '\.pyi?$'
|
||||||
|
exclude = '''
|
||||||
|
/(
|
||||||
|
\.*
|
||||||
|
| \.git
|
||||||
|
| \.mypy_cache
|
||||||
|
| \.venv
|
||||||
|
# The following are specific to Black, you probably don't want those.
|
||||||
|
| blib2to3
|
||||||
|
| tests/data
|
||||||
|
| profiling
|
||||||
|
)/
|
||||||
|
'''
|
|
@ -32,3 +32,4 @@ flake8
|
||||||
pep8
|
pep8
|
||||||
django-silk
|
django-silk
|
||||||
django-debug-toolbar
|
django-debug-toolbar
|
||||||
|
pre-commit
|
||||||
|
|
Loading…
Reference in a new issue