Skip to content

Commit cef6e9c

Browse files
committed
remove keys
1 parent 130cc7f commit cef6e9c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/styles/lint_styles/lint_styles.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def cli(styles_folder):
3535

3636
print(f'formatting {style_file}')
3737

38+
remove_keys(style_file)
39+
3840
# gl-style-migrate
3941
p = subprocess.run(
4042
[node_bin_path / 'gl-style-migrate', style_file], capture_output=True, text=True
@@ -64,5 +66,16 @@ def cli(styles_folder):
6466
)
6567

6668

69+
def remove_keys(style_file):
70+
with open(style_file) as fp:
71+
data = json.load(fp)
72+
73+
for key in ['id', 'center', 'zoom', 'bearing', 'pitch']:
74+
data.pop(key, None)
75+
76+
with open(style_file, 'w') as fp:
77+
json.dump(data, fp, ensure_ascii=False)
78+
79+
6780
if __name__ == '__main__':
6881
cli()

0 commit comments

Comments
 (0)