From 29985091d05a0d504449d304ecec5733fcf2742f Mon Sep 17 00:00:00 2001 From: Dhruv Bhanushali Date: Mon, 14 Nov 2022 23:16:41 +0400 Subject: [PATCH] Unify pre-commit config across repos (#867) --- ...image_provider_api_integration_request.yml | 2 +- .pre-commit-config.yaml | 39 +++++++++++++------ docker-compose.override.yml | 2 +- docker-compose.yml | 3 +- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml b/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml index eacd01595..13b374ee9 100644 --- a/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml +++ b/.github/ISSUE_TEMPLATE/image_provider_api_integration_request.yml @@ -40,7 +40,7 @@ body: attributes: label: Checklist to complete before beginning development description: | - Please do not modify this section. No development should be done on a Provider API Script until the following info is gathered: + Please do not modify this section. No development should be done on a Provider API Script until the following info is gathered: options: - label: Verify there is a way to retrieve the entire relevant portion of the provider's collection in a systematic way via their API. required: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c683244bc..770cb4bc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,11 @@ -exclude: archive +exclude: Pipfile\.lock|migrations|\.idea|node_modules|archive repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] - id: check-docstring-first - id: check-executables-have-shebangs - id: check-json @@ -20,6 +21,7 @@ repos: args: - --remove - id: pretty-format-json + exclude: package(-lock)?\.json args: - --autofix - id: requirements-txt-fixer @@ -28,7 +30,6 @@ repos: rev: 5.9.1 hooks: - id: isort - name: Run isort to sort imports files: \.py$ exclude: ^build/.*$|^.tox/.*$|^venv/.*$ args: @@ -47,22 +48,36 @@ repos: args: - --py310-plus - - repo: https://gitlab.com/pycqa/flake8 + - repo: https://github.com/PyCQA/flake8 rev: 3.9.2 hooks: - - id: flake8 - args: - - --per-file-ignores=test_*:E501 - - --max-line-length=88 - - --ignore=E203,W503 + - id: flake8 - repo: https://github.com/ambv/black rev: 22.3.0 hooks: - - id: black - args: - - --safe + - id: black + args: + - --safe + + - repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.3.0 + hooks: + - id: eslint + files: ^js/.*$ + additional_dependencies: + - eslint@8.3.0 + - eslint-config-prettier@8.3.0 + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.5.0 + hooks: + - id: prettier + files: ^js/.*$ + - id: prettier + types: [yaml] + - repo: https://github.com/koalaman/shellcheck-precommit rev: v0.8.0 hooks: - - id: shellcheck + - id: shellcheck diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 38dc8a801..ffd5daf9b 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" services: # Services only needed for local development diff --git a/docker-compose.yml b/docker-compose.yml index 78c5cdf38..c0885e646 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: '3' +version: "3" services: - webserver: image: ghcr.io/wordpress/openverse-catalog:${DOCKER_IMAGE_TAG:-latest} env_file: .env