Lint headway
This commit is contained in:
parent
32035a005e
commit
29aaea1a45
4 changed files with 18 additions and 17 deletions
|
@ -14,11 +14,11 @@ import yaml
|
||||||
|
|
||||||
|
|
||||||
RECORD_LINE_PATTERN = re.compile(
|
RECORD_LINE_PATTERN = re.compile(
|
||||||
"^(?P<rrset_name>\S+)\s+"
|
r"^(?P<rrset_name>\S+)\s+"
|
||||||
"(?P<rrset_ttl>\S+)\s+"
|
r"(?P<rrset_ttl>\S+)\s+"
|
||||||
"IN\s+"
|
r"IN\s+"
|
||||||
"(?P<rrset_type>\S+)\s+"
|
r"(?P<rrset_type>\S+)\s+"
|
||||||
"(?P<rrset_values>.+)$"
|
r"(?P<rrset_values>.+)$"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ SHITLIST = [
|
||||||
"setuptools",
|
"setuptools",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def req_name(requirement: str) -> str:
|
def req_name(requirement: str) -> str:
|
||||||
requirement = requirement.lower()
|
requirement = requirement.lower()
|
||||||
match = re.match(REQ_PATTERN, requirement)
|
match = re.match(REQ_PATTERN, requirement)
|
||||||
|
@ -58,9 +59,9 @@ def _bq(query):
|
||||||
"""Enumerate the PyPi package names from a Bazel query."""
|
"""Enumerate the PyPi package names from a Bazel query."""
|
||||||
|
|
||||||
unused = subprocess.check_output(["bazel", "query", query, "--output=package"]).decode("utf-8")
|
unused = subprocess.check_output(["bazel", "query", query, "--output=package"]).decode("utf-8")
|
||||||
for l in unused.split("\n"):
|
for line in unused.split("\n"):
|
||||||
if l:
|
if line:
|
||||||
yield l.replace("@arrdem_source_pypi//pypi__", "")
|
yield line.replace("@arrdem_source_pypi//pypi__", "")
|
||||||
|
|
||||||
|
|
||||||
def _unused():
|
def _unused():
|
||||||
|
@ -75,7 +76,7 @@ def _load(fname):
|
||||||
with open(fname, "r") as reqfile:
|
with open(fname, "r") as reqfile:
|
||||||
# FIXME (arrdem 2021-08-03):
|
# FIXME (arrdem 2021-08-03):
|
||||||
# Return a parse, not just lines.
|
# Return a parse, not just lines.
|
||||||
return list(l.strip() for l in reqfile)
|
return list(line.strip() for line in reqfile)
|
||||||
|
|
||||||
|
|
||||||
def _write(fname, reqs):
|
def _write(fname, reqs):
|
||||||
|
|
Loading…
Reference in a new issue