Skip to content

Commit d9c5d90

Browse files
authored
Merge pull request #2142 from blkerby/formatting-arrays
Fix some issues with auto-formatting
2 parents ff51496 + 5246c2b commit d9c5d90

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/run_scripts.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ jobs:
5858
python ./resources/ci/common/list_actions.py
5959
# Run Strat ID validator
6060
# Run Autoformatter
61-
- name: Run Strat ID Generator & Autoformatter
61+
- name: Run Strat ID Generator
6262
working-directory: scripts
6363
run: python populate_strat_ids.py
64-
- name: Run Tech ID Generator & Autoformatter
64+
- name: Run Tech ID Generator
6565
working-directory: scripts
6666
run: python populate_tech_ids.py
67+
- name: Run Autoformatter
68+
working-directory: scripts
69+
run: python autoformat.py
6770
- name: Create Pull Request
6871
uses: peter-evans/create-pull-request@v6.1.0
6972
with:

schema/m3-room.schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,14 +1263,14 @@
12631263
"description": "Represents that Samus can leave through this door by jumping from a platform to the side, carrying upward momentum into the next room.",
12641264
"required": ["runway", "height", "obstruction"],
12651265
"properties": {
1266-
"runway": {
1267-
"$ref": "#/definitions/runway",
1268-
"description": "Runway available to jump through the door, including unusable parts of the runway near an obstruction."
1269-
},
12701266
"height": {
12711267
"type": "number",
12721268
"description": "The vertical position of the runway, measured in number of tiles below the doorway, at the location where Samus would jump."
12731269
},
1270+
"runway": {
1271+
"$ref": "#/definitions/runway",
1272+
"description": "Runway available to jump through the door, including unusable parts of the runway near an obstruction."
1273+
},
12741274
"obstruction": {
12751275
"type": "array",
12761276
"description": "Coordinates of the block that most restricts where Samus can jump, measured relative to the floor below the transition.",

scripts/format_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def is_one_liner_dict(obj, parent_keys, nesting_allowed=True):
2525
return False
2626
if any(not is_allowed_one_line_key(x, parent_keys) for x in obj.keys()):
2727
return False
28-
if len(obj) == 0:
28+
if all(is_simple_value(x) for x in obj.values()):
2929
return True
3030
if len(obj) == 1:
3131
key, value = next(iter(obj.items()))
3232
if not is_allowed_one_line_key(key, parent_keys):
3333
return False
3434
return is_one_liner(value, parent_keys + [key], nesting_allowed=nesting_allowed)
3535
else:
36-
return all(is_simple_value(x) for x in obj.values())
36+
return False
3737

3838

3939
def is_one_liner_list(obj, parent_keys, nesting_allowed=True):

0 commit comments

Comments
 (0)