浏览代码

Meta: Add check if AvailablePorts.md is sorted

circl 3 年之前
父节点
当前提交
06eca0a666
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Meta/lint-ports.py

+ 6 - 0
Meta/lint-ports.py

@@ -347,6 +347,12 @@ def run():
     from_table_set = set(from_table.keys())
     ports_set = set(ports.keys())
 
+    if list(from_table.keys()) != sorted(from_table.keys(), key=str.lower):
+        all_good = False
+        print('AvailablePorts.md is not in the correct order, please ensure that all ports are sorted as follows:')
+        for port in sorted(from_table.keys(), key=str.lower):
+            print(f"    {port}")
+
     if from_table_set - ports_set:
         all_good = False
         print('AvailablePorts.md lists ports that do not appear in the file system:')