ashb commented on code in PR #68633:
URL: https://github.com/apache/airflow/pull/68633#discussion_r3421838014


##########
scripts/ci/prek/check_no_conventional_commit_message.py:
##########
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+#
+# 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.
+"""
+Reject Conventional Commits style commit subjects.
+
+Airflow does not use Conventional Commits (``feat:``, ``fix:``, ``chore: 
...``).
+Commit messages should describe user impact in plain prose, e.g.
+``Fix airflow dags test command failure without serialized Dags`` rather than
+``fix(cli): dags test failure``.
+
+As a ``commit-msg`` stage hook it receives the path to the file holding the 
commit
+message being created and fails if the subject line looks like a Conventional
+Commit.
+
+With ``--from-stdin`` it instead reads commit subjects (one per line) from 
standard
+input and fails if any of them looks like a Conventional Commit. This is how CI
+validates every commit of a pull request.
+"""
+
+from __future__ import annotations
+
+import argparse
+import re
+import sys
+from pathlib import Path
+
+# Standard Conventional Commits types (https://www.conventionalcommits.org).
+CONVENTIONAL_TYPES = (
+    "build",

Review Comment:
   ```suggestion
       "bugfix"
       "build",
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to