You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't tested them all (that's just a first draft), I can see in another project that it detects assets and Fonts, but didn't test the other ones just yet), so it's quite open for improvement and for adding rules for other stuff
Note that these are custom_rules, which use Regular Expressions to do the matching. It would be even better to create a PR in SwiftLint to add proper AST-based rules, so that it would analyse the semantics and not the text (allowing the rules to match even if there are some comments in-between the parameters, etc)
Next steps:
Feel free to improve those custom_rules and add or fix the regular expressions used above, so that we end up with a nice set of custom rules that we could share with all users in SwiftGen's wiki
Create a wiki page to host those custom rules for people wanting to use them in their project, until we have time to make an AST-based rule in SwiftLint via a PR
Create a PR in SwiftLint to add the AST-based rules for each type of asset covered by SwiftGen, making those rules more resilient and robust than the RegEx-based ones above.
The text was updated successfully, but these errors were encountered:
To encourage users to use SwiftGen instead of the String-based APIs, it would be nice to have SwiftLint rules that users can enable for their project.
I haven't tested them all (that's just a first draft), I can see in another project that it detects assets and Fonts, but didn't test the other ones just yet), so it's quite open for improvement and for adding rules for other stuff
Note that these are
custom_rules
, which use Regular Expressions to do the matching. It would be even better to create a PR in SwiftLint to add proper AST-based rules, so that it would analyse the semantics and not the text (allowing the rules to match even if there are some comments in-between the parameters, etc)Next steps:
custom_rules
and add or fix the regular expressions used above, so that we end up with a nice set of custom rules that we could share with all users in SwiftGen's wikiThe text was updated successfully, but these errors were encountered: