Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor warnings so that it's not an sideeffect anymore #136

Closed
mac-cain13 opened this issue Dec 16, 2015 · 1 comment · Fixed by #766
Closed

Refactor warnings so that it's not an sideeffect anymore #136

mac-cain13 opened this issue Dec 16, 2015 · 1 comment · Fixed by #766

Comments

@mac-cain13
Copy link
Owner

Functions should just return warnings they have encountered. Later on we can print them at once.

This makes code clearer, easier to test and gives us the ability to suppress warnings. We could even add meta data so specific types of warnings could be shown/hidden etc.

@tomlokhorst
Copy link
Collaborator

tomlokhorst commented May 29, 2016

Plan of attack for part of this, related to identifier warnings:

  • Create a separate SwiftIdentifier type instead of a string
  • Refactor all data types (Struct, Let, etc) to use SwiftIdentifier
  • Refactor code in SanitizedSwiftName.swift to use SwiftIdentifier
  • Move all code related to identifier checking (duplicates, empty names) into a single (parameterised function), instead of repeating it across all validators. This should fix Validation methods don't take duplicate identifiers into account #175

Continuing on:

  • Identify a list of all other warning types
  • Create an enum for those
  • Figure out how to return those best from functions (return value, inout param, or mutable object passed around?)

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants