seaofvoices / darklua

A command line tool that transforms Lua code
https://darklua.com/
MIT License
71 stars 9 forks source link

Add convert data command #178

Closed jeparlefrancais closed 5 months ago

jeparlefrancais commented 5 months ago

Closes #139

This PR add a new convert command to darklua to convert data files (json, yaml or toml) into a Lua module.

github-actions[bot] commented 5 months ago

Coverage after merging convert-data-command into main will be

86.90%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src
   bin.rs89.74%100%100%88.57%41–42, 44–45
src/cli
   convert.rs88.66%100%71.43%91.57%13, 21, 86, 89, 91
   mod.rs69.23%100%58.33%74.07%18, 26–27
src/frontend
   error.rs70.34%100%60%71.58%107–112, 118–120, 122–124, 163, 168, 17, 176, 190, 217–221, 231–234, 236, 240–245, 258–263, 267–272, 276–281, 285–290, 302–303, 316–317, 319–320, 337, 346, 379, 381, 386–387, 405–409, 412–417, 73
   mod.rs75.53%100%70%76.19%57–60, 71–74, 92–97
src/rules/bundle
   mod.rs87.97%100%87.50%88.07%105–109, 17, 33–37, 39, 73
src/rules/bundle/path_require_mode
   mod.rs85.31%100%89.47%85.02%101–103, 120–122, 126–128, 130, 180, 206–208, 223–225, 235–237, 259, 295–298, 326–327, 333–339, 349–350, 359, 36, 360–361