Skip to content

Commit 3aaf262

Browse files
committed
Cleaned and added documentation
1 parent d0488b2 commit 3aaf262

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pwc.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!python3
22

3+
# This little helper script was implemented to extract the sources from the spellcheck configuration file
4+
# The name comes from Python WCMatch, which is used to match the files against the sources
5+
# That is the short name I call it PriceWaterhouseCoopers, since it revises the file listing
6+
37
# read file and interpret it as yaml
48
def read_yaml(file):
59

@@ -9,7 +13,6 @@ def read_yaml(file):
913

1014
import sys
1115
import yaml
12-
#import pprint
1316
from wcmatch import glob
1417

1518
# read filename from command line as first argument
@@ -20,22 +23,14 @@ def read_yaml(file):
2023
# fetch the sources from the YAML data
2124
sources = data.get('matrix')[0].get('sources')
2225

23-
# print the sources from the YAML data
24-
#pprint.pprint(sources)
25-
2626
for changed_file in sys.stdin:
2727
if 'q' == changed_file.rstrip():
2828
break
2929
changed_file = changed_file.rstrip()
30-
#print(f'Input : {changed_file}')
3130

3231
matched = glob.globmatch(changed_file, sources, flags=glob.NEGATE | glob.GLOBSTAR | glob.SPLIT)
3332

3433
if matched:
35-
#print("Matched file:", changed_file)
3634
exit(0)
3735
else:
38-
#print("No match for file:", changed_file)
3936
exit(1)
40-
41-
#pprint.pprint(files)

0 commit comments

Comments
 (0)