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

Move examples to separated files #1704

Closed
marcelofabri opened this issue Jul 22, 2017 · 7 comments
Closed

Move examples to separated files #1704

marcelofabri opened this issue Jul 22, 2017 · 7 comments
Labels
discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions.

Comments

@marcelofabri
Copy link
Collaborator

Maybe we should move nonTriggering/triggering/corrections examples to their own files:

Pros:

  • It'd be easier to make sure they are correctly formatted. Today, since they are Strings in Swift, it's hard to properly format them. With multiline literals in Swift 4, this will get better, but probably it won't be good enough. This is important for documentation.
  • We could run sourcekitten and see if the file is parsed correctly (i.e. is valid Swift code).
  • We'd avoid cluttering source code with data.

Cons:

  • It may be more work to maintain.
  • It might not be obvious for new contributors.
  • How would we deal with custom configurations?
  • How would we deal with corrections?
  • Would this make tests slower? If so, how much?
  • How would we deal with swiftlint rules a_rule_identifier? We can't bundle resources with SPM.
@marcelofabri marcelofabri added the discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. label Jul 22, 2017
@jpsim
Copy link
Collaborator

jpsim commented Jul 25, 2017

I don't think there's significant value in the Pro's section to warrant doing this. 🤷‍♂️

@marcelofabri
Copy link
Collaborator Author

I think we definitely should adopt multiline strings first and see how it turns out. Having the examples poorly formatted is pretty bad IMO.

@jpsim
Copy link
Collaborator

jpsim commented Jul 25, 2017

Yeah, but isn't the whole solution there to just visually inspect the (lovely) Rules.md file now?

@marcelofabri
Copy link
Collaborator Author

I'm not sure I follow, but the issue is that we use those examples to generate the Rules.md file, so some snippets there have really weird formatting.

@jpsim
Copy link
Collaborator

jpsim commented Jul 25, 2017

Sorry, I wasn't clear. I mean that since the examples do exist in a format where we can visually confirm that they're properly formatted (i.e. the Rules.md file), that this should be enough to identify which samples are incorrectly formatted and adjust them?

@marcelofabri
Copy link
Collaborator Author

Yes, hopefully we can fix that in the near future 🙏

@jpsim
Copy link
Collaborator

jpsim commented Jan 8, 2020

Addressed in #3016.

@jpsim jpsim closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions.
Projects
None yet
Development

No branches or pull requests

2 participants