Skip to content

optional_string_data_conversion's Data -> String rule should be optional #5785

@jshier

Description

@jshier

New Issue Checklist

Feature or Enhancement Proposal

In 0.57.0, the non_optional_string_data_conversion rule was split: the Data -> String conversion check was actually inverted and made its own rule. Unfortunately, as a default rule it's very heavy handed. In the vast majority of Swift apps, using String(decoding:as:) is perfectly correct, as non-UTF-8 strings are increasingly rare, and there often aren't any arbitrary strings at all. Additionally, using this initializer is an explicit acknowledgment that we don't care if the string isn't fully UTF-8. That is, we don't care if the decoding placeholder is inserted. That's may be a bug, but a far more minor one than not handling a string at all.

This part of the rule made optional by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionTopics that cannot be categorized as bugs or enhancements yet. They require further discussions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions