in check_docs_version_diff.py [0:0]
def diff_doc_en(directories):
"""Generate three paths for each directory using predefined version prefixes and check file existence and content differences."""
for directory in directories:
# Construct the paths for each version
path_v21 = os.path.join(version_21_prefix_en, directory + ".md")
path_v30 = os.path.join(version_30_prefix_en, directory + ".md")
path_dev = os.path.join(version_dev_prefix_en, directory + ".md")
# Check if the file is missing in v21 or v30
if not os.path.exists(path_v21):
print(f"Missing in version 2.1: {path_v21}")
if not os.path.exists(path_v30):
print(f"Missing in version 3.0: {path_v30}")
if not os.path.exists(path_dev):
print(f"Missing in current (dev) version: {path_dev}")
# Compare path_v21 with path_dev if path_v21 exists
if os.path.exists(path_v21) and os.path.exists(path_dev):
if not filecmp.cmp(path_v21, path_dev, shallow=False):
print(f"File mismatch between v21 and dev for: {directory}")
print("path_dev: " + path_dev)
print("path_v21: " + path_v21)
print("-" * 50)
# Compare path_v30 with path_dev if path_v30 exists
if os.path.exists(path_v30) and os.path.exists(path_dev):
if not filecmp.cmp(path_v30, path_dev, shallow=False):
print(f"File mismatch between v30 and dev for: {directory}")
print("path_dev: " + path_dev)
print("path_v30: " + path_v30)
print("-" * 50)