Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Resolve alias chain recursively
Previously we were resolving only the direct target of an alias in the `resolve_target()` method. This proved to be insufficient as we were later iterating through the whole chain anyway. We also had a method that checked if the alias was resolved, and hackishly also checked if the target was resolved. We now invert these two methods behaviors: - `resolve_target()` tries to resolve the whole chain (done!) and fails at the first resolution error. All resolved parents are marked unresolved (we don't allow partial resolution). A resolution error raises a `CyclicAliasError` that can be caught and handled above in the stack. This effectively helps detecting cyclic aliases and avoid maximum recursion errors. - the `resolved` property then only checks if the current target (and only the current target) is resolved.
- Loading branch information