From 434b1c36828e2edd309ee56ef965f0ba51e9b7c3 Mon Sep 17 00:00:00 2001 From: Sara Zan Date: Fri, 29 Jul 2022 17:02:56 +0200 Subject: [PATCH] Disable a few checks in the pre-commit hook (#2929) * Disable small checks giving trouble to pydoc-markdown and JSON Schema * Add instructions for JSON schema generator in the workflow logs --- .github/workflows/black.yml | 2 +- .github/workflows/schemas.yml | 11 ++++++++++- .pre-commit-config.yaml | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 778086216..ef353934b 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -6,7 +6,7 @@ on: jobs: - check: + black: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/schemas.yml b/.github/workflows/schemas.yml index 5acf14d8a..a67b0532f 100644 --- a/.github/workflows/schemas.yml +++ b/.github/workflows/schemas.yml @@ -28,6 +28,7 @@ jobs: run: | if [[ `git status --porcelain` ]]; then git status + echo "###################################################################################################" echo "# " echo "# CHECK FAILED! OpenAPI specs were not updated." echo "# " @@ -35,10 +36,18 @@ jobs: echo "# " echo "# python .github/utils/generate_openapi_specs.py" echo "# " - echo "# Or see https://github.com/deepset-ai/haystack/blob/master/CONTRIBUTING.md for help." + echo "# You need a FULL INSTALLATION of Haystack for this step to work." + echo "# " + echo "# pip install -e .[all]" + echo "# " + echo "# If you cannot do that for any reason, please disable the hook, push " + echo "# and let us know in the PR description." + echo "# " + echo "# See https://github.com/deepset-ai/haystack/blob/master/CONTRIBUTING.md for instructions." echo "# " echo "# If you have further problems, please open an issue: https://github.com/deepset-ai/haystack/issues" echo "# " + echo "###################################################################################################" exit 1 fi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ca5e9e98..8109fd6c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,13 +8,13 @@ repos: - id: check-json # checks JSON syntax - id: check-yaml # checks YAML syntax - id: check-toml # checks TOML syntax - - id: end-of-file-fixer # checks there is a newline at the end of the file - - id: trailing-whitespace # trims trailing whitespace + #- id: end-of-file-fixer # checks there is a newline at the end of the file # FIXME: pydoc-markdown conflicts with this + #- id: trailing-whitespace # trims trailing whitespace # FIXME: pydoc-markdown conflicts with this - id: check-merge-conflict # checks for no merge conflict strings - id: check-shebang-scripts-are-executable # checks all shell scripts have executable permissions - id: mixed-line-ending # normalizes line endings - id: no-commit-to-branch # prevents committing to master - - id: pretty-format-json # indents and sorts JSON files + #- id: pretty-format-json # indents and sorts JSON files # FIXME: JSON schema generator conflicts with this - repo: https://github.com/psf/black rev: 22.6.0 # IMPORTANT: keep this aligned with the black version in setup.cfg