Our docs on dag policy demonstrate usage with type annotations:
https://airflow.apache.org/docs/apache-airflow/stable/concepts.html?highlight=dag_policy#dag-level-cluster-policy

```python
def dag_policy(dag: DAG):
    """Ensure that DAG has at least one tag"""
    if not dag.tags:
        raise AirflowClusterPolicyViolation(
            f"DAG {dag.dag_id} has no tags. At least one tag required. File path: {dag.filepath}"
        )
```

The problem is, by the time you import DAG with `from airflow import DAG`, airflow will have already loaded up the `settings.py` file (where processing of airflow_local_settings.py is done), and it seems nothing in your airflow local settings file gets imported.

So none of these examples would actually work.

To test this you can add a local settings file containing this:

```
from airflow import DAG

raise Exception('hello')
```

Now run `airflow dags list` and observe that no error will be raised.

Remove the `DAG` import.  Now you'll see the error.

Any suggestions how to handle this?  

There are a couple conf settings imported from settings. We could move these to `airflow/__init__.py`.  But less straightforward would be what to do about `settings.initialize()`.  Perhaps we could make it so that initialized is called within settings?


tests/cluster_policies/__init__.py
if not task.owner or task.owner.lower() == conf.get('operators', 'default_owner'):
        raise AirflowClusterPolicyViolation(
            f'''Task must have non-None non-default owner. Current value: {task.owner}'''
        )
TASK_RULES: List[Callable[[BaseOperator], None]] = [
    task_must_have_owners,
]
def _check_task_rules(current_task: BaseOperator):
    """Check task rules for given task."""
    notices = []
    for rule in TASK_RULES:
        try:
            rule(current_task)
        except AirflowClusterPolicyViolation as ex:
            notices.append(str(ex))
    if notices:
        notices_list = " * " + "\n * ".join(notices)
        raise AirflowClusterPolicyViolation(
            f"DAG policy violation (DAG ID: {current_task.dag_id}, Path: {current_task.dag.filepath}):\n"
            f"Notices:\n"
            f"{notices_list}"
        )
def cluster_policy(task: BaseOperator):