aboutsummaryrefslogtreecommitdiff
path: root/.pre-commit-config.yaml
diff options
context:
space:
mode:
authorHunternif2021-08-04 01:56:00 +0100
committerHunternif2021-08-04 01:56:00 +0100
commitca861cdc44ca476cec2949f237bbc7503862ad58 (patch)
tree520f918a9a77432bf283b46b4296812eb4332ffe /.pre-commit-config.yaml
parentdd03540398fcab11bfc2c3cebed2fb7a78592c16 (diff)
parent59452711668b9f7a7aeea3c57301b22882987c2b (diff)
Merge remote-tracking branch 'origin/master' into hunternif
# Conflicts: # client/css/post-content-control.styl # client/css/post-list-view.styl # client/html/post_edit_sidebar.tpl # client/js/controllers/post_list_controller.js # client/js/controllers/post_main_controller.js # client/js/controllers/post_upload_controller.js # client/js/controllers/tag_controller.js # client/js/controllers/user_list_controller.js # client/js/controls/expander_control.js # client/js/controls/post_content_control.js # client/js/controls/post_edit_sidebar_control.js # client/js/controls/post_readonly_sidebar_control.js # client/js/controls/tag_input_control.js # client/js/main.js # client/js/models/abstract_list.js # client/js/models/post.js # client/js/models/post_list.js # client/js/models/settings.js # client/js/models/tag.js # client/js/models/tag_list.js # client/js/tags.js # client/js/util/search.js # client/js/util/touch.js # client/js/util/uri.js # client/js/util/views.js # client/js/views/post_main_view.js # client/js/views/post_upload_view.js # client/js/views/posts_header_view.js # client/js/views/posts_page_view.js # client/js/views/settings_view.js # client/js/views/tag_view.js # client/package-lock.json # client/package.json # server/config.yaml.dist # server/szurubooru/api/__init__.py # server/szurubooru/api/post_api.py # server/szurubooru/api/tag_api.py # server/szurubooru/func/posts.py # server/szurubooru/func/tags.py # server/szurubooru/model/__init__.py # server/szurubooru/model/post.py # server/szurubooru/model/tag.py # server/szurubooru/search/configs/__init__.py # server/szurubooru/search/configs/post_search_config.py # server/szurubooru/search/executor.py # server/szurubooru/tests/api/test_post_retrieving.py # server/szurubooru/tests/api/test_post_updating.py # server/szurubooru/tests/api/test_tag_updating.py # server/szurubooru/tests/conftest.py # server/szurubooru/tests/func/test_posts.py # server/szurubooru/tests/func/test_tags.py # server/szurubooru/tests/search/configs/test_post_search_config.py
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r--.pre-commit-config.yaml100
1 files changed, 100 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..5053b6e
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,100 @@
+repos:
+
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v3.2.0
+ hooks:
+ - id: trailing-whitespace
+ - id: end-of-file-fixer
+ - id: check-yaml
+ - id: mixed-line-ending
+
+- repo: https://github.com/Lucas-C/pre-commit-hooks
+ rev: v1.1.9
+ hooks:
+ - id: remove-tabs
+
+- repo: https://github.com/psf/black
+ rev: 20.8b1
+ hooks:
+ - id: black
+ files: 'server/'
+ types: [python]
+ language_version: python3.8
+
+- repo: https://github.com/timothycrosley/isort
+ rev: '5.4.2'
+ hooks:
+ - id: isort
+ files: 'server/'
+ types: [python]
+ exclude: server/szurubooru/migrations/env.py
+ additional_dependencies:
+ - toml
+
+- repo: https://github.com/prettier/prettier
+ rev: '2.1.1'
+ hooks:
+ - id: prettier
+ files: client/js/
+ exclude: client/js/.gitignore
+ args: ['--config', 'client/.prettierrc.yml']
+
+- repo: https://github.com/pre-commit/mirrors-eslint
+ rev: v7.8.0
+ hooks:
+ - id: eslint
+ files: client/js/
+ args: ['--fix']
+ additional_dependencies:
+ - eslint-config-prettier
+
+- repo: https://gitlab.com/pycqa/flake8
+ rev: '3.8.3'
+ hooks:
+ - id: flake8
+ files: server/szurubooru/
+ additional_dependencies:
+ - flake8-print
+ args: ['--config=server/.flake8']
+
+- repo: local
+ hooks:
+ - id: docker-build-client
+ name: Docker - build client
+ entry: bash -c 'docker build client/'
+ language: system
+ types: [file]
+ files: client/
+ pass_filenames: false
+
+ - id: docker-build-server
+ name: Docker - build server
+ entry: bash -c 'docker build server/'
+ language: system
+ types: [file]
+ files: server/
+ pass_filenames: false
+
+ - id: pytest
+ name: pytest
+ entry: bash -c 'docker run --rm -t $(docker build --target testing -q server/) szurubooru/'
+ language: system
+ types: [python]
+ files: server/szurubooru/
+ exclude: server/szurubooru/migrations/
+ pass_filenames: false
+ stages: [push]
+
+ - id: pytest-cov
+ name: pytest
+ entry: bash -c 'docker run --rm -t $(docker build --target testing -q server/) --cov-report=term-missing:skip-covered --cov=szurubooru szurubooru/'
+ language: system
+ types: [python]
+ files: server/szurubooru/
+ exclude: server/szurubooru/migrations/
+ pass_filenames: false
+ verbose: true
+ stages: [manual]
+
+fail_fast: true
+exclude: LICENSE.md

© 2015 - 2026 Jakob L. Kreuze