comparison Tools/scripts/patchcheck.py @ 84775:13950a33f889 2.7

Issue #18439: Make patchcheck work on Windows for ACKS, NEWS.
author Terry Jan Reedy <tjreedy@udel.edu>
date Sun, 21 Jul 2013 20:57:44 -0400
parents 1cfe0f50fd0c
children
comparison
equal deleted inserted replaced
84772:23b0164b9c82 84775:13950a33f889
142 142
143 143
144 @status("Misc/ACKS updated", modal=True) 144 @status("Misc/ACKS updated", modal=True)
145 def credit_given(file_paths): 145 def credit_given(file_paths):
146 """Check if Misc/ACKS has been changed.""" 146 """Check if Misc/ACKS has been changed."""
147 return 'Misc/ACKS' in file_paths 147 return os.path.join('Misc', 'ACKS') in file_paths
148 148
149 149
150 @status("Misc/NEWS updated", modal=True) 150 @status("Misc/NEWS updated", modal=True)
151 def reported_news(file_paths): 151 def reported_news(file_paths):
152 """Check if Misc/NEWS has been changed.""" 152 """Check if Misc/NEWS has been changed."""
153 return 'Misc/NEWS' in file_paths 153 return os.path.join('Misc', 'NEWS') in file_paths
154 154
155 155
156 def main(): 156 def main():
157 file_paths = changed_files() 157 file_paths = changed_files()
158 python_files = [fn for fn in file_paths if fn.endswith('.py')] 158 python_files = [fn for fn in file_paths if fn.endswith('.py')]
159 c_files = [fn for fn in file_paths if fn.endswith(('.c', '.h'))] 159 c_files = [fn for fn in file_paths if fn.endswith(('.c', '.h'))]
160 doc_files = [fn for fn in file_paths if fn.startswith('Doc')] 160 doc_files = [fn for fn in file_paths if fn.startswith('Doc')]
161 special_files = {'Misc/ACKS', 'Misc/NEWS'} & set(file_paths) 161 misc_files = {os.path.join('Misc', 'ACKS'), os.path.join('Misc', 'NEWS')}\
162 & set(file_paths)
162 # PEP 8 whitespace rules enforcement. 163 # PEP 8 whitespace rules enforcement.
163 normalize_whitespace(python_files) 164 normalize_whitespace(python_files)
164 # C rules enforcement. 165 # C rules enforcement.
165 normalize_c_whitespace(c_files) 166 normalize_c_whitespace(c_files)
166 # Doc whitespace enforcement. 167 # Doc whitespace enforcement.
167 normalize_docs_whitespace(doc_files) 168 normalize_docs_whitespace(doc_files)
168 # Docs updated. 169 # Docs updated.
169 docs_modified(doc_files) 170 docs_modified(doc_files)
170 # Misc/ACKS changed. 171 # Misc/ACKS changed.
171 credit_given(special_files) 172 credit_given(misc_files)
172 # Misc/NEWS changed. 173 # Misc/NEWS changed.
173 reported_news(special_files) 174 reported_news(misc_files)
174 175
175 # Test suite run and passed. 176 # Test suite run and passed.
176 if python_files or c_files: 177 if python_files or c_files:
177 end = " and check for refleaks?" if c_files else "?" 178 end = " and check for refleaks?" if c_files else "?"
178 print 179 print