diff --git a/scripts/styles/lint_styles/lint_styles.py b/scripts/styles/lint_styles/lint_styles.py index ff06ef3..32f5b18 100755 --- a/scripts/styles/lint_styles/lint_styles.py +++ b/scripts/styles/lint_styles/lint_styles.py @@ -14,8 +14,10 @@ import click def cli(styles_folder): """ Lints all style JSON files in a folder - First runs prettier with recursive JSON sorting - Then runs gl-style-format + 1. runs gl-style-migrate + 2. runs prettier with recursive JSON sorting + 3. gl-style-format + 4. gl-style-validate """ p = subprocess.run(['pnpm', 'bin'], capture_output=True, text=True) @@ -33,22 +35,34 @@ def cli(styles_folder): print(f'formatting {style_file}') + # gl-style-migrate + p = subprocess.run( + [node_bin_path / 'gl-style-migrate', style_file], capture_output=True, text=True + ) + with open(style_file, 'w') as fp: + fp.write(p.stdout) + + # prettier subprocess.run( [node_bin_path / 'prettier', '--config', prettier_config_path, '--write', style_file], capture_output=True, ) + # gl-style-format p = subprocess.run( - [ - node_bin_path / 'gl-style-format', - style_file, - ], - capture_output=True, - text=True, + [node_bin_path / 'gl-style-format', style_file], capture_output=True, text=True ) with open(style_file, 'w') as fp: fp.write(p.stdout) + # gl-style-validate + subprocess.run( + [ + node_bin_path / 'gl-style-validate', + style_file, + ], + ) + if __name__ == '__main__': cli()