Skip to content

Commit

Permalink
Merge pull request #34735 from jbytheway/detect_unsed_json_members
Browse files Browse the repository at this point in the history
Detect unused json members
  • Loading branch information
kevingranade authored Oct 25, 2019
2 parents 5ad16b6 + 0ec0c52 commit bd9c85f
Show file tree
Hide file tree
Showing 48 changed files with 366 additions and 265 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ WARNINGS += -Wimplicit-fallthrough=0
endif

CXXFLAGS += $(WARNINGS) $(DEBUG) $(DEBUGSYMS) $(PROFILE) $(OTHERS) -MMD -MP
TOOL_CXXFLAGS = -DCATA_IN_TOOL

BINDIST_EXTRAS += README.md data doc
BINDIST = $(BUILD_PREFIX)cataclysmdda-$(VERSION).tar.gz
Expand Down Expand Up @@ -801,7 +802,7 @@ localization:
lang/compile_mo.sh $(LANGUAGES)

$(CHKJSON_BIN): $(CHKJSON_SOURCES)
$(CXX) $(CXXFLAGS) -Isrc/chkjson -Isrc $(CHKJSON_SOURCES) -o $(CHKJSON_BIN)
$(CXX) $(CXXFLAGS) $(TOOL_CXXFLAGS) -Isrc/chkjson -Isrc $(CHKJSON_SOURCES) -o $(CHKJSON_BIN)

json-check: $(CHKJSON_BIN)
./$(CHKJSON_BIN)
Expand Down Expand Up @@ -1040,7 +1041,8 @@ style-all-json: json_formatter
find data -name "*.json" -print0 | xargs -0 -L 1 $(JSON_FORMATTER_BIN)

json_formatter: $(JSON_FORMATTER_SOURCES)
$(CXX) $(CXXFLAGS) -Itools/format -Isrc $(JSON_FORMATTER_SOURCES) -o $(JSON_FORMATTER_BIN)
$(CXX) $(CXXFLAGS) $(TOOL_CXXFLAGS) -Itools/format -Isrc \
$(JSON_FORMATTER_SOURCES) -o $(JSON_FORMATTER_BIN)

tests: version $(BUILD_PREFIX)cataclysm.a
$(MAKE) -C tests
Expand Down
3 changes: 0 additions & 3 deletions data/json/furniture_and_terrain/furniture-medical.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"coverage": 60,
"required_str": 16,
"max_volume": 4000,
"insulation": 2,
"looks_like": "f_washer",
"flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR", "FLAT_SURF" ],
"deconstruct": {
Expand Down Expand Up @@ -138,7 +137,6 @@
"coverage": 60,
"required_str": 16,
"max_volume": 4000,
"insulation": 2,
"looks_like": "f_washer",
"flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR", "FLAT_SURF", "SEALED" ],
"deconstruct": {
Expand Down Expand Up @@ -183,7 +181,6 @@
"coverage": 80,
"required_str": 18,
"max_volume": 7000,
"insulation": 6,
"looks_like": "f_fridge",
"flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR" ],
"deconstruct": {
Expand Down
6 changes: 3 additions & 3 deletions data/json/items/gun/50.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"weight": "14000 g",
"volume": "3500 ml",
"price": 1500000,
"to-hit": -1,
"to_hit": -1,
"bashing": 13,
"material": "steel",
"ammo": "50",
Expand All @@ -119,7 +119,7 @@
"weight": "11800 g",
"volume": "3127 ml",
"price": 870000,
"to-hit": -1,
"to_hit": -1,
"bashing": 12,
"material": "steel",
"ammo": "50",
Expand All @@ -143,7 +143,7 @@
"weight": "8504 g",
"volume": "1387 ml",
"price": 239500,
"to-hit": -1,
"to_hit": -1,
"bashing": 12,
"material": "steel",
"ammo": "50",
Expand Down
3 changes: 1 addition & 2 deletions data/json/items/items_holiday.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
"type": "transform",
"target": "plastic_jack_o_lantern",
"msg": "The candle winks out inside the lantern.",
"menu_text": "Extinguish",
"revert_to": "plastic_jack_o_lantern"
"menu_text": "Extinguish"
},
"flags": [ "LIGHT_6", "TRADER_AVOID" ]
}
Expand Down
3 changes: 1 addition & 2 deletions data/json/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@
"initial_charges": 4000,
"max_charges": 4000,
"charges_per_use": 1,
"use_action": { "type": "WATER_PURIFIER", "moves": 70 }
"use_action": "WATER_PURIFIER"
},
{
"id": "char_smoker",
Expand Down Expand Up @@ -5256,7 +5256,6 @@
"max_charges": 50,
"use_action": {
"type": "fireweapon_off",
"active": true,
"target_id": "shishkebab_on",
"moves": 10,
"noise": 10,
Expand Down
34 changes: 17 additions & 17 deletions data/json/mapgen/basecamps/modular_firestation1.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
],
"palettes": [ "fbmc_firestation1_palette" ],
"place_furniture": [
{ "furn": "f_null", "x": 0, "y": 2, "chance": 100 },
{ "furn": "f_null", "x": 0, "y": 3, "chance": 100 },
{ "furn": "f_null", "x": 1, "y": 2, "chance": 100 },
{ "furn": "f_null", "x": 1, "y": 3, "chance": 100 },
{ "furn": "f_null", "x": 1, "y": 4, "chance": 100 },
{ "furn": "f_null", "x": 2, "y": 2, "chance": 100 },
{ "furn": "f_null", "x": 2, "y": 3, "chance": 100 },
{ "furn": "f_null", "x": 2, "y": 4, "chance": 100 }
{ "furn": "f_null", "x": 0, "y": 2 },
{ "furn": "f_null", "x": 0, "y": 3 },
{ "furn": "f_null", "x": 1, "y": 2 },
{ "furn": "f_null", "x": 1, "y": 3 },
{ "furn": "f_null", "x": 1, "y": 4 },
{ "furn": "f_null", "x": 2, "y": 2 },
{ "furn": "f_null", "x": 2, "y": 3 },
{ "furn": "f_null", "x": 2, "y": 4 }
]
}
},
Expand All @@ -69,7 +69,7 @@
"place_nested": [ { "chunks": [ "fbmc_firestation1_kitchen1" ], "x": 1, "y": 9 } ],
"place_loot": [
{ "item": "2x4", "repeat": 24, "x": 2, "y": 10, "chance": 100 },
{ "item": "nail", "charges": 36, "x": 2, "y": 10, "chance": 100 }
{ "item": "nail", "repeat": 36, "x": 2, "y": 10, "chance": 100 }
]
}
},
Expand Down Expand Up @@ -135,14 +135,14 @@
"object": {
"mapgensize": [ 6, 6 ],
"place_furniture": [
{ "furn": "f_null", "x": 0, "y": 3, "chance": 100 },
{ "furn": "f_null", "x": 0, "y": 4, "chance": 100 },
{ "furn": "f_null", "x": 2, "y": 1, "chance": 100 },
{ "furn": "f_null", "x": 2, "y": 2, "chance": 100 },
{ "furn": "f_null", "x": 1, "y": 0, "chance": 100 },
{ "furn": "f_null", "x": 0, "y": 0, "chance": 100 },
{ "furn": "f_null", "x": 1, "y": 1, "chance": 100 },
{ "furn": "f_null", "x": 1, "y": 2, "chance": 100 }
{ "furn": "f_null", "x": 0, "y": 3 },
{ "furn": "f_null", "x": 0, "y": 4 },
{ "furn": "f_null", "x": 2, "y": 1 },
{ "furn": "f_null", "x": 2, "y": 2 },
{ "furn": "f_null", "x": 1, "y": 0 },
{ "furn": "f_null", "x": 0, "y": 0 },
{ "furn": "f_null", "x": 1, "y": 1 },
{ "furn": "f_null", "x": 1, "y": 2 }
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/cemetery_4square.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
{ "item": "church", "x": [ 11, 12 ], "y": [ 5, 6 ], "chance": 65 },
{ "item": "jackets", "x": [ 12 ], "y": [ 14 ], "chance": 50 }
],
"place_npcs": [ { "chance": 7, "class": "SEER_Brigitte_LaCroix", "x": 18, "y": 6 } ]
"place_npcs": [ { "class": "SEER_Brigitte_LaCroix", "x": 18, "y": 6 } ]
}
}
]
Loading

0 comments on commit bd9c85f

Please sign in to comment.