File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 77import json
88import os
99import pathlib
10+ import re
1011import subprocess
1112import sys
1213
@@ -44,13 +45,24 @@ def run_test(name: str) -> bool:
4445 paths = []
4546 extensions = set (config .get ('extensions' , []))
4647
48+ ignore_regexs = [
49+ re .compile (regex )
50+ for regex in config .get ('ignore_regexs' , [])
51+ ]
52+
4753 for root , dir_names , file_names in os .walk (ROOT / 'docs' ):
4854 for file_name in file_names :
4955 path = os .path .join (root , file_name )
5056 ext = os .path .splitext (path )[1 ]
5157
52- if ext in extensions :
53- paths .append (path )
58+ rel_path = os .path .relpath (path , ROOT )
59+ if any (regex .match (rel_path ) for regex in ignore_regexs ):
60+ continue
61+
62+ if ext not in extensions :
63+ continue
64+
65+ paths .append (path )
5466
5567 cmd = [sys .executable , checker_path ] + paths
5668
Original file line number Diff line number Diff line change 11{
22 "extensions" : [
33 " .rst"
4+ ],
5+ "ignore_regexs" : [
6+ " ^docs/docsite/rst/porting_guides/porting_guide_[0-9]+\\ .rst$"
47 ]
58}
You can’t perform that action at this time.
0 commit comments