Closed jeparlefrancais closed 9 months ago
Coverage after merging remove-interpolated-str-rule into main will be
87.08% |
---|
File | Stmts | Branches | Funcs | Lines | Uncovered Lines |
---|---|---|---|---|---|
src | |||||
parser.rs | 99.15% | 100% | 73.33% | 99.38% | 37, 43, 507–513, 55–59, 66 |
src/nodes | |||||
arguments.rs | 86.81% | 100% | 85.71% | 87.14% | 130–131, 153–157, 159, 189, 57–59, 87–89 |
src/nodes/expressions | |||||
interpolated_string.rs | 81.09% | 100% | 79.49% | 81.55% | 136–139, 164–167, 198–201, 203, 231–233, 306–312, 356–361, 386–389, 48–50, 76–79 |
src/process | |||||
scope_visitor.rs | 81.70% | 100% | 76.92% | 82.65% | 132, 164–167, 180–190, 195, 219–221, 227–229, 249–251, 259–261 |
src/rules | |||||
mod.rs | 89.03% | 100% | 77.78% | 90.49% | 105–107, 111, 121–123, 141–143, 145, 176–178, 264, 305–306, 341–343, 406–408, 66 |
remove_interpolated_string.rs | 90.59% | 100% | 79.17% | 92.13% | 13, 211–218 |
Closes #92
This new rule replaces interpolated strings with
string.format
calls. The rule has astrategy
property that defines how it converts the interpolated strings.The default strategy
"string"
uses the%s
string specifier instring.format
calls and wrap each interpolated value in atostring
call.The other available strategy is
tostring
, which uses the%*
string specifier instring.format
. This strategy does not need to wrap interpolated values.Example:
Todo: