Skip to content

Commit 1a7a018

Browse files
committed
make the deprecated imports script produce a CSV
1 parent c2c6733 commit 1a7a018

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

script/forbid-deprecated-imports.py script/deprecated-modules-csv.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python
2+
import csv
23
import json
34
import os.path as path
45
import re
5-
import subprocess
6+
import sys
67

78
HERE = path.realpath(path.abspath(path.join(path.dirname(__file__), '..')))
89

@@ -29,12 +30,13 @@
2930
else:
3031
widgets[widget] = (current_version, [])
3132

33+
writer = csv.writer(sys.stdout)
34+
3235
for (widget, (latest, deprecated)) in widgets.items():
3336
for version in deprecated:
34-
subprocess.check_call([
35-
'elm-forbid-import',
36-
'forbid',
37+
writer.writerow((
3738
'{}.V{}'.format(widget, version),
38-
'--hint',
39-
'latest is V{}'.format(latest),
40-
])
39+
'upgrade to V{}'.format(latest),
40+
))
41+
42+
sys.stdout.close()

0 commit comments

Comments
 (0)