Opened 2 years ago
Last modified 22 months ago
#6544 closed enhancement
Include list of unused data json files in checkrefs.py — at Version 7
Reported by: | Langbart | Owned by: | marder |
---|---|---|---|
Priority: | If Time Permits | Milestone: | Alpha 26 |
Component: | Simulation | Keywords: | |
Cc: | Patch: | Phab:D4663 Phab:D4725 |
Description (last modified by )
Having fewer files to translate is good. To find unused files automatically, it should be integrated into the python script checkrefs.py
.
Aura
Name | Removed from template with | Removed from the Game |
---|---|---|
[25561] | [26900] | |
unused in the main game | [26900] | |
[26898] | [26900] | |
han_hero_wei_qing_3.json | [26980] |
Technologies
Name | Removed from template with | Removed from the Game |
---|---|---|
| unused in the main game | [26900] |
| unused in the main game | [26900] |
| [26469] | [26900] |
shell function
used for finding unlisted data json files in the simulation folder
function unusedJSON { CURRENT_DIR=$(pwd) cd ~/0ad/binaries/data/mods/public/simulation/data/auras || return 1 printf "\e[1;97mList unused Auras:\e[0m\n" for a in $(find . -name "*.json" | xargs -L 1 basename -s .json); do if [[ $(grep --include=\*.xml -rw ~/0ad/binaries/data/mods/public/simulation -e "$a" | wc -c) -eq 0 ]]; then echo "$a" fi done cd ~/0ad/binaries/data/mods/public/simulation/data/technologies || return 1 printf "\e[1;97m\nList unused Technologies:\e[0m\n" for t in $(find . -name "*.json" | xargs grep -LEw 'autoResearch.+true' | xargs -L 1 basename -s .json); do if [[ $(grep --include={*.xml,test_Researcher.js,pair_unlock*.json} -rw ~/0ad/binaries/data/mods/public/simulation -e "$t" | wc -c) -eq 0 ]]; then echo "$t" fi done cd "${CURRENT_DIR}" || return 1 }
related tickets
- #3800 (4/Mar/16)
Change History (7)
comment:1 by , 2 years ago
comment:3 by , 2 years ago
Patch: | → Phab:D4663 |
---|
comment:4 by , 23 months ago
Description: | modified (diff) |
---|---|
Priority: | Should Have → If Time Permits |
Resolution: | fixed |
Status: | closed → reopened |
Summary: | List of unused data json files → Include list of unused data json files in checkrefs.py |
Type: | defect → enhancement |
- Adding a new unused json file from [26980]
- The ticket should only be closed if the
checkrefs.py
script can find these files.
comment:5 by , 23 months ago
Nice function, it's not cross-platform though, so I have to rewrite it to be:
- mod compatible
- windows compatible (e.g the CI doesn't care but modders might)
comment:6 by , 23 months ago
Patch: | Phab:D4663 → Phab:D4663 Phab:D4725 |
---|
comment:7 by , 23 months ago
Description: | modified (diff) |
---|
han_hero_wei_qing_3
moved from the tech to the aura table.
Note:
See TracTickets
for help on using tickets.
Nice findings. I suppose they should be reported by checkrefs -u