You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/01/21 20:19:51 UTC

[airflow] 26/44: Add identity pre-commit hook (#13089)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 97c2d63b1b09a94a672f5f3cdba326c42b4780ef
Author: Ruben Laguna <ru...@gmail.com>
AuthorDate: Wed Dec 16 09:03:48 2020 +0100

    Add identity pre-commit hook (#13089)
    
    (cherry picked from commit 99c2e03da9b552b74d78b1b10ce9b8f85c686678)
---
 .pre-commit-config.yaml |  1 +
 BREEZE.rst              | 10 +++++++++-
 STATIC_CODE_CHECKS.rst  |  2 ++
 breeze-complete         |  1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 4c6b733..2e9edda 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -148,6 +148,7 @@ repos:
           - "2"
   - repo: meta
     hooks:
+      - id: identity
       - id: check-hooks-apply
   - repo: https://github.com/pre-commit/pre-commit-hooks
     rev: v3.3.0
diff --git a/BREEZE.rst b/BREEZE.rst
index 03290c3..43018a0 100644
--- a/BREEZE.rst
+++ b/BREEZE.rst
@@ -751,6 +751,14 @@ The above will run mypy check for all files.
       </a>
     </div>
 
+If you want ever need to get a list of the files that will be checked (for troubleshooting when playing with the
+``--from-ref`` and ``--to-ref``
+
+.. code-block:: bash
+
+     breeze static-check identity --verbose # currently staged files
+     breeze static-check identity --verbose -- --from-ref $(git merge-base master HEAD) --to-ref HEAD #  branch updates
+
 Building the Documentation
 --------------------------
 
@@ -1981,7 +1989,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
                  check-apache-license check-builtin-literals check-executables-have-shebangs
                  check-hooks-apply check-integrations check-merge-conflict check-xml debug-statements
                  detect-private-key doctoc dont-use-safe-filter end-of-file-fixer fix-encoding-pragma
-                 flake8 forbid-tabs helm-lint incorrect-use-of-LoggingMixin insert-license
+                 flake8 forbid-tabs helm-lint identity incorrect-use-of-LoggingMixin insert-license
                  language-matters lint-dockerfile lint-openapi markdownlint mermaid mixed-line-ending
                  mypy mypy-helm no-relative-imports pre-commit-descriptions pydevd python2-compile
                  python2-fastcheck python-no-log-warn rst-backticks setup-order setup-installation
diff --git a/STATIC_CODE_CHECKS.rst b/STATIC_CODE_CHECKS.rst
index 3fb49c3..7f02299 100644
--- a/STATIC_CODE_CHECKS.rst
+++ b/STATIC_CODE_CHECKS.rst
@@ -96,6 +96,8 @@ require Breeze Docker images to be installed locally:
 ----------------------------------- ---------------------------------------------------------------- ------------
 ``helm-lint``                         Verifies if helm lint passes for the chart
 ----------------------------------- ---------------------------------------------------------------- ------------
+``identity``                          Prints inputs to the static check hooks for troubleshooting
+----------------------------------- ---------------------------------------------------------------- ------------
 ``incorrect-use-of-LoggingMixin``     Checks if LoggingMixin is properly imported.
 ----------------------------------- ---------------------------------------------------------------- ------------
 ``insert-license``                    Adds licenses for most file types.
diff --git a/breeze-complete b/breeze-complete
index cdf8fe9..7e1ccc6 100644
--- a/breeze-complete
+++ b/breeze-complete
@@ -85,6 +85,7 @@ fix-encoding-pragma
 flake8
 forbid-tabs
 helm-lint
+identity
 incorrect-use-of-LoggingMixin
 insert-license
 language-matters