amoghrajesh commented on PR #53700:
URL: https://github.com/apache/airflow/pull/53700#issuecomment-3113494138
Thanks for the tip @potiuk
Made it using ast now, this is how errors are reported
```
➜ airflow git:(precommit-to-disallow-sdk-imports-in-core) ✗ pre-commit run
check-sdk-imports --all-files
Check for SDK imports in core
files......................................Failed
- hook id: check-sdk-imports
- exit code: 1
airflow-core/src/airflow/__init__.py:
Line 97: from airflow.sdk.definitions.asset import Asset, Dataset
Found 1 SDK import(s) in core files
```
and timing looks like so:
```
(airflow) ➜ airflow git:(precommit-to-disallow-sdk-imports-in-core) ✗ time
pre-commit run check-sdk-imports --all-files
Check for SDK imports in core
files......................................Passed
pre-commit run check-sdk-imports --all-files 1.54s user 0.70s system 355%
cpu 0.629 total
```
--
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]