potiuk commented on a change in pull request #10789:
URL: https://github.com/apache/airflow/pull/10789#discussion_r484743805



##########
File path: scripts/ci/pre_commit/pre_commit_check_pre_commits.sh
##########
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+set -euo pipefail
+
+export PRINT_INFO_FROM_SCRIPTS="false"
+
+# shellcheck source=scripts/ci/libraries/_script_init.sh
+. "$( dirname "${BASH_SOURCE[0]}" )/../libraries/_script_init.sh"
+
+cd "${AIRFLOW_SOURCES}"
+
+. breeze-complete
+
+PRE_COMMIT_CONFIG_FILE="${AIRFLOW_SOURCES}/.pre-commit-config.yaml"
+readonly PRE_COMMIT_CONFIG_FILE
+
+STATIC_CODE_CHECKS_FILE="${AIRFLOW_SOURCES}/STATIC_CODE_CHECKS.rst"
+
+all_pre_commits=$(grep "id:" <"${PRE_COMMIT_CONFIG_FILE}" | sort |uniq | awk 
'{ print $3 }')
+
+error="false"
+for pre_commit in ${all_pre_commits}
+do
+    if ! grep -q "${pre_commit}" "${STATIC_CODE_CHECKS_FILE}"; then
+        error="true"
+        >&2 echo "Pre-commit ${pre_commit} is not described in 
${STATIC_CODE_CHECKS_FILE}"
+    fi
+    if [[ ! ${_BREEZE_ALLOWED_STATIC_CHECKS} == *${pre_commit}* ]]; then
+        error="true"
+        >&2 echo "Pre-commit ${pre_commit} is not present in breeze-complete 
in _BREEZE_ALLOWED_STATIC_CHECKS"
+    fi
+done
+
+if [[ ${error} == "true" ]]; then
+  >&2 echo
+  >&2 echo "Error: Some pre-commits are not synchronized!"

Review comment:
       ```
   Check if pre-commits are 
described.................................................................................................Failed
   - hook id: pre-commit-descriptions
   - exit code: 1
   
   ERROR: Pre-commit airflow-config-yaml is not described in 
/home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   FIX: Please add airflow-config-yaml in the table in the 'Pre-commit hooks' 
chapter in /home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   
   ERROR: Pre-commit base-operator is not described in 
/home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   FIX: Please add base-operator in the table in the 'Pre-commit hooks' chapter 
in /home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   
   ERROR: Pre-commit base-operator is missing in _BREEZE_ALLOWED_STATIC_CHECKS 
variable in breeze-complete
   
   FIX: Please add base-operator in the table in the 
'_BREEZE_ALLOWED_STATIC_CHECKS' chapter in 
/home/jarek/code/airflow/breeze-complete
   
   
   ERROR: Pre-commit bat-tests is not described in 
/home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   FIX: Please add bat-tests in the table in the 'Pre-commit hooks' chapter in 
/home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   
   ERROR: Pre-commit black is not described in 
/home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   FIX: Please add black in the table in the 'Pre-commit hooks' chapter in 
/home/jarek/code/airflow/STATIC_CODE_CHECKS.rst
   
   
   ERROR: Pre-commit check-hooks-apply is missing in 
_BREEZE_ALLOWED_STATIC_CHECKS variable in breeze-complete
   
   FIX: Please add check-hooks-apply in the table in the 
'_BREEZE_ALLOWED_STATIC_CHECKS' chapter in 
/home/jarek/code/airflow/breeze-complete
   
   
   Some pre-commits are not synchronized! Please fix the errors above!
   
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to