mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
[Lint] Add pre-commit config
- Added a pre-commit config for code linting and formatting. It will auto-format python, javascript, CSS, YAML and markdown files to save manually doing so. To install: pip install pre-commit pre-commit install - Added a default virtual environment directory to gitignore.
This commit is contained in:
parent
36606fc448
commit
0548bdb655
3 changed files with 41 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -17,3 +17,4 @@ deluge.pot
|
||||||
.build_data*
|
.build_data*
|
||||||
osx/app
|
osx/app
|
||||||
RELEASE-VERSION
|
RELEASE-VERSION
|
||||||
|
.venv
|
||||||
|
|
38
.pre-commit-config.yaml
Normal file
38
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/ambv/black
|
||||||
|
rev: 18.9b0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
name: Fmt Black
|
||||||
|
language_version: python3.6
|
||||||
|
- repo: https://github.com/prettier/prettier
|
||||||
|
rev: 1.14.3
|
||||||
|
hooks:
|
||||||
|
- id: prettier
|
||||||
|
name: Fmt Prettier
|
||||||
|
files: "\\.(
|
||||||
|
css\
|
||||||
|
|less\
|
||||||
|
|scss\
|
||||||
|
|html\
|
||||||
|
|ts|tsx\
|
||||||
|
|graphql|gql\
|
||||||
|
|json\
|
||||||
|
|js|jsx\
|
||||||
|
|md|markdown|mdown|mkdn\
|
||||||
|
|yaml|yml\
|
||||||
|
)$"
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v1.4.0
|
||||||
|
hooks:
|
||||||
|
- id: double-quote-string-fixer
|
||||||
|
name: Fix Double-quotes
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
name: Fix End-of-files
|
||||||
|
- id: mixed-line-ending
|
||||||
|
name: Fix Line-endings
|
||||||
|
args: [--fix=auto]
|
||||||
|
- id: flake8
|
||||||
|
name: Chk Flake8
|
||||||
|
additional_dependencies:
|
||||||
|
- flake8-isort==2.5
|
|
@ -23,8 +23,8 @@ known_third_party =
|
||||||
bbfreeze, win32verstamp,
|
bbfreeze, win32verstamp,
|
||||||
# Ignore gtk modules, primarily for tox testing.
|
# Ignore gtk modules, primarily for tox testing.
|
||||||
pygtk, gtk, gobject, gtk.gdk, pango, cairo, pangocairo,
|
pygtk, gtk, gobject, gtk.gdk, pango, cairo, pangocairo,
|
||||||
# Ignore sphinx dependencies.
|
# Ignore other module dependencies for pre-commit isort.
|
||||||
recommonmark,
|
twisted, OpenSSL, pytest, recommonmark, chardet, pkg_resources, zope, mock
|
||||||
known_first_party = msgfmt, deluge
|
known_first_party = msgfmt, deluge
|
||||||
order_by_type = true
|
order_by_type = true
|
||||||
not_skip = __init__.py
|
not_skip = __init__.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue