Skip to content

Commit dfd8902

Browse files
committed
lint
1 parent 98cfee5 commit dfd8902

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

scripts/styles/lint_styles/lint_styles.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
def cli(styles_folder):
1515
"""
1616
Lints all style JSON files in a folder
17-
First runs prettier with recursive JSON sorting
18-
Then runs gl-style-format
17+
1. runs gl-style-migrate
18+
2. runs prettier with recursive JSON sorting
19+
3. gl-style-format
20+
4. gl-style-validate
1921
"""
2022

2123
p = subprocess.run(['pnpm', 'bin'], capture_output=True, text=True)
@@ -33,21 +35,33 @@ def cli(styles_folder):
3335

3436
print(f'formatting {style_file}')
3537

38+
# gl-style-migrate
39+
p = subprocess.run(
40+
[node_bin_path / 'gl-style-migrate', style_file], capture_output=True, text=True
41+
)
42+
with open(style_file, 'w') as fp:
43+
fp.write(p.stdout)
44+
45+
# prettier
3646
subprocess.run(
3747
[node_bin_path / 'prettier', '--config', prettier_config_path, '--write', style_file],
3848
capture_output=True,
3949
)
4050

51+
# gl-style-format
4152
p = subprocess.run(
53+
[node_bin_path / 'gl-style-format', style_file], capture_output=True, text=True
54+
)
55+
with open(style_file, 'w') as fp:
56+
fp.write(p.stdout)
57+
58+
# gl-style-validate
59+
subprocess.run(
4260
[
43-
node_bin_path / 'gl-style-format',
61+
node_bin_path / 'gl-style-validate',
4462
style_file,
4563
],
46-
capture_output=True,
47-
text=True,
4864
)
49-
with open(style_file, 'w') as fp:
50-
fp.write(p.stdout)
5165

5266

5367
if __name__ == '__main__':

0 commit comments

Comments
 (0)