meel-ayush opened a new pull request, #76321:
URL: https://github.com/apache/airflow/pull/76321

   ### Description
   
   Adds a pre-commit check (`check_cli_consistency.py`) to prevent argument 
naming drift and missing help strings across Airflow CLI definitions 
(`airflow-core` and providers).
   
   The check uses Python's `ast` parser rather than importing CLI modules 
directly, keeping it fast in pre-commit without triggering Airflow 
configuration or provider loading. It enforces:
   - Long flags use POSIX kebab-case (`--example-flag`).
   - Short flags are single characters (`-e`).
   - Every `Arg` definition has a non-empty `help` docstring.
   - Action commands do not register duplicate flags within the same command 
scope.
   
   Also standardizes `ARG_POOL` in `airflow-core/src/airflow/cli/cli_config.py` 
to use keyword `help=...` like the rest of the CLI definitions.
   
   ### Tests
   
   - Unit tests added in `scripts/tests/ci/prek/test_check_cli_consistency.py` 
covering flag syntax validation, docstrings, and duplicate flag detection.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [ ] Yes (please specify the tool below)


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

  • [PR] Add pre-commit check for ... meel-ayush (via GitHub) via commits

Reply via email to