Mercurial > hg
changeset 48961:8dec9abf2669
import-checker: allow symbol imports from typing module
As we add typing annotations, we'll want to use a lot of symbols from
the `typing` module. Typing `typing` all the time will be annoying. Let's
allow symbol imports from this module.
While I was here, I changed some comments from "whitelist" to "allow list"
as the former is non-inclusive terminology.
Differential Revision: https://phab.mercurial-scm.org/D12365
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 09 Mar 2022 15:41:39 -0800 |
parents | c3a48dd506da |
children | 7e18fc0bc46c |
files | contrib/import-checker.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/import-checker.py Tue Mar 08 19:11:03 2022 -0800 +++ b/contrib/import-checker.py Wed Mar 09 15:41:39 2022 -0800 @@ -19,7 +19,7 @@ import testparseutil -# Whitelist of modules that symbols can be directly imported from. +# Allow list of modules that symbols can be directly imported from. allowsymbolimports = ( '__future__', 'breezy', @@ -46,9 +46,10 @@ 'mercurial.thirdparty.attr', 'mercurial.thirdparty.zope', 'mercurial.thirdparty.zope.interface', + 'typing', ) -# Whitelist of symbols that can be directly imported. +# Allow list of symbols that can be directly imported. directsymbols = ('demandimport',) # Modules that must be aliased because they are commonly confused with