mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 04:14:38 +00:00
chore: remove unused historic image files
This commit is contained in:
21
check_dashes.py
Normal file
21
check_dashes.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
count = 0
|
||||
for root, dirs, files in os.walk("/Users/baohua/Github/books/docker_practice"):
|
||||
if ".git" in root or "node_modules" in root:
|
||||
continue
|
||||
for file in files:
|
||||
if file.endswith(".md"):
|
||||
filepath = os.path.join(root, file)
|
||||
with open(filepath, "r", encoding="utf-8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
for i, line in enumerate(lines):
|
||||
# match optional spaces, then exactly one dash, then no space and no dash
|
||||
m = re.match(r'^(\s*)-([^- \t\n].*)$', line)
|
||||
if m:
|
||||
print(f"{filepath}:{i+1}:{line.rstrip()}")
|
||||
count += 1
|
||||
|
||||
print(f"Total found: {count}")
|
||||
Reference in New Issue
Block a user