Mercurial > public > mercurial-scm > hg
changeset 52752:4eede65d68cf
lint: add comments for disabling unused import warnings where appropriate
As mentioned in the previous commit, this doesn't actually placate `pyflakes`.
But it does cause PyCharm to not show the imports as greyed out, so presumably
it helps other IDEs too.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 06 Feb 2025 20:43:34 -0500 |
parents | 38095e4e9046 |
children | ae2848198462 |
files | mercurial/interfaces/types.py mercurial/pycompat.py mercurial/util.py |
diffstat | 3 files changed, 12 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/interfaces/types.py Thu Feb 06 20:37:22 2025 -0500 +++ b/mercurial/interfaces/types.py Thu Feb 06 20:43:34 2025 -0500 @@ -11,7 +11,7 @@ from __future__ import annotations -from ._basetypes import ( +from ._basetypes import ( # noqa: F401 (ignore imported but not used) FsPathT, HgPathT, UserMsgT,
--- a/mercurial/pycompat.py Thu Feb 06 20:37:22 2025 -0500 +++ b/mercurial/pycompat.py Thu Feb 06 20:43:34 2025 -0500 @@ -11,22 +11,22 @@ from __future__ import annotations import builtins -import codecs -import concurrent.futures as futures +import codecs # noqa: F401 (ignore imported but not used) +import concurrent.futures as futures # noqa: F401 (ignore imported but not used) import getopt -import http.client as httplib -import http.cookiejar as cookielib +import http.client as httplib # noqa: F401 (ignore imported but not used) +import http.cookiejar as cookielib # noqa: F401 (ignore imported but not used) import inspect -import io +import io # noqa: F401 (ignore imported but not used) import json import os -import queue +import queue # noqa: F401 (ignore imported but not used) import shlex -import socketserver +import socketserver # noqa: F401 (ignore imported but not used) import struct import sys import tempfile -import xmlrpc.client as xmlrpclib +import xmlrpc.client as xmlrpclib # noqa: F401 (ignore imported but not used) from typing import ( Any,
--- a/mercurial/util.py Thu Feb 06 20:37:22 2025 -0500 +++ b/mercurial/util.py Thu Feb 06 20:43:34 2025 -0500 @@ -26,7 +26,9 @@ import locale import mmap import os -import pickle # provides util.pickle symbol + +# provides util.pickle symbol +import pickle # noqa: F401 (ignore imported but not used) import re as remod import shutil import stat