Created
June 14, 2022 13:04
-
-
Save tbnorth/2f995890b0c86297890c3d42a4ab9d8c to your computer and use it in GitHub Desktop.
Update tags file based on paths in tags file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Scans file to find folders on which ctags was originally run.""" | |
import subprocess | |
from pathlib import Path | |
dirs = set() | |
for line in Path("tags").open(): | |
if line.startswith("!"): | |
continue | |
# extract 'tests' from | |
# turn_error_on tests/data/query_engine.py ... | |
dirs.add(line.split()[1].split("/")[0]) | |
subprocess.run(["wc", "-l", "tags"]) | |
cmd = ["ctags", "-R"] + list(dirs) | |
print(cmd) | |
subprocess.run(cmd) | |
subprocess.run(["wc", "-l", "tags"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment